KONG API AI Docs Start free

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:

LevelWhat it caps
KeyThe usage of one key
MemberThe total usage of all keys that belong to one person
CustomerThe total usage attributed to one of your customers
CreditsThe 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:

ModeWhere requests runKONG API AI token charge
AutoYour own sources first. Credits only if you turned on fallbackOnly when credits are used
CreditsAlways paid from credits, at the KONG API AI priceYes
Own sourcesOnly your sourcesNo

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.