Skip to content

Quickstart

Create an account, add balance and create an API key. Then use one of the examples below to send your first request.

  1. Sign up. Go to console.indorouter.ai/signup and enter your email and a password of at least 12 characters. We’ll email you a verification link. Click it, then sign in.

    If you see Continue with Google or Continue with GitHub, you can use those instead. You won’t need to verify your email again with either option.

  2. Top up. Open Balance, pick or type an amount (at least Rp10.000) and click Continue to payment. You choose how to pay, such as QRIS, GoPay or a bank virtual account, on the Midtrans payment page.

    The full top-up amount is added to your balance. VAT (PPN) is added to the payment total when applicable. You have 15 minutes to pay. Once you’ve paid, the balance updates immediately.

  3. Create an API key. Open the API Key page, click Create API Key, give it a name (for example laptop) and click Create key. Copy the key now, because we won’t show it again. It starts with ir_.

    Keep it in an environment variable so it stays out of your code:

    Terminal window
    export INDOROUTER_API_KEY="ir_..."
  4. Send a request. The base URL is https://api.indorouter.ai/v1. The API is compatible with OpenAI’s, so the official OpenAI SDKs work as they are.

    Terminal window
    curl https://api.indorouter.ai/v1/chat/completions \
    -H "Authorization: Bearer $INDOROUTER_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"model": "openai/gpt-4o-mini",
    "messages": [{"role": "user", "content": "hello"}]}'

    The model’s answer is in choices[0].message.content. The request also shows up on the Requests page in the console, with what it cost.

To use another model, replace openai/gpt-4o-mini with its model ID. A model ID always starts with the vendor. How to find the right one is on Choosing a model.

Status code What it means
401 missing_api_key No Authorization header was sent. Check that INDOROUTER_API_KEY is set in the same terminal.
401 invalid_api_key The key is mistyped or was revoked. Create a new one on the API Key page.
402 insufficient_funds Your balance doesn’t cover this request. Top up, or send a smaller max_tokens.
404 model_not_found The model ID is misspelled or doesn’t start with the vendor.