API keys
Create a separate API key for each app or tool. You can then track usage, set limits and revoke access for each application independently.
Creating a key
Section titled “Creating a key”On the API Key page, click Create API Key. The form asks for:
| Field | What it does |
|---|---|
| Unit | The unit the key belongs to. Shown only when the account has more than one unit. |
| Name | A label so you can tell keys apart, for example production server. |
| For | A member of the unit, or Service (no person). A key issued to a person counts against that person’s limits. A service key counts against the account’s. Only people with API Key and unit admins see this field. |
Click Set limits (optional) to see additional settings. Settings you leave unchanged use the account defaults.
| Field | What it does |
|---|---|
| Validity | None, 7 days, 30 days, 90 days, 1 year, or a date. The key works until the end of that day, WIB. |
| Spend limits | A Daily and a Monthly limit, each Account default, No limit or an Amount in rupiah, on the WIB calendar. When reached chooses Refuse or Warn only. See Spending limits. |
| Rate | Requests per minute, Tokens per minute and Requests at once. Leave blank to use the account’s defaults. See Rate limits. |
| When the balance runs low | Lower max_tokens lets the request run with a smaller output cap, so the answer may stop early. This suits coding agents. Refuse the request answers with a 402 instead, so no answer is cut short. See How billing works. |
| Model | The models the key may call. Leave it empty to allow every model. |
Click Create key. The NEW KEY panel shows the API key only once, so copy and save it now. We store only a verification value and cannot show the key again. Click I’ve saved it when you’re done.
Keys start with ir_. Keep the key in an environment variable such as INDOROUTER_API_KEY rather than in your code.
Someone without API Key sees only Name and Unit: the key is issued to them, with the account’s defaults.
Changing key settings
Section titled “Changing key settings”Edit on a key’s row changes its name, validity, limits, rate and models. People with the API Key permission and the unit’s admins can do this; a member can’t loosen the limits on their own key. A key’s unit and the person it belongs to can’t change. To move a key, revoke it and create a new one.
Revoking a key
Section titled “Revoking a key”Revoke on a key’s row stops the key immediately. This can’t be undone. The person the key belongs to, the unit’s admins and people with the API Key permission can revoke it. Usage before revocation is still billed.
If a key leaks, revoke it and create a new one.
Admin keys
Section titled “Admin keys”An admin key lets your own systems create API keys for this account through the API, for example to give each of your customers their own key. It can’t call models and can’t spend the balance. API error messages call it a provisioning key.
Only people with the API Key permission see the Admin Key page. Click Create Admin Key, give it a Name and, if you like, an Expires (optional) date. Like an API key, it is shown once.
With an admin key you can:
- create, list and revoke API keys in this account with
/v1/keys; - read the account’s usage and cost reports at
/v1/organization/usage/...and/v1/organization/costs.
You can’t create another admin key with it, and a key it creates can’t be edited afterwards. Revoking an admin key stops it creating keys, but the keys it already created keep working. See Account and keys for request and response details.