Using a key
Limits and routing
Monthly limits in USD for each key, member and customer; the three routing modes; and what happens when a limit is reached.
How limits work
Limits are monthly, in USD, and reset on the 1st of each month, UTC.
You can set a limit at several levels:
| Level | What it caps |
|---|---|
| Key | The usage of one key |
| Member | The total usage of all keys that belong to one person |
| Customer | The total usage attributed to one of your customers |
| Credits | The credits left in the whole workspace |
A request stops at the first limit it reaches. The API returns 402 with a code that names the limit that ran out, such as key_limit or budget_exceeded.
What a limit counts
A limit counts only what is paid with KONG API AI credits. Requests served by your own AI sources are not capped by these limits; their limit is the quota your provider sets on your account.
Three routing modes
Each key runs in one of three modes:
| Mode | Where requests run | KONG API AI token charge |
|---|---|---|
| Auto | Your own sources first. Credits only if you turned on fallback | Only when credits are used |
| Credits | Always paid from credits, at the KONG API AI price | Yes |
| Own sources | Only your sources | No |
In Auto mode, if none of your own sources can serve and fallback is off, the API returns 429 with own_quota_unavailable.
When a limit runs out
- Raise the limit of the key, member or customer in the console.
- Or add credits.
- The next request goes through. You do not need a new key.
Pause all keys
An admin can pause every key of the workspace on the Billing page. The API then returns 503 with workspace_paused.