Skip to main content
Keys and teams carry a budget and rate limits: The instance applies the stricter of a key’s limit and its team’s, and refuses a model request past either. A request past a budget gets 422 with the error type budget_exceeded. A request past a rate limit gets 429 with a retry-after header, in seconds. GET {gateway_url}/v1/models does not count toward the limits. A request’s spend and tokens count when it completes, so the request that crosses a budget completes and the next one is refused. A request whose prompt and max_tokens would exceed the tokens left in the minute is refused before it runs. Budgets enforce on instances created since 2026-10-29. Instances created before that date price every request at 0, so spend never reaches a budget and no request is refused for one (AIPLAT-1630).

New Limits

Limits go in the body of POST /v2/agent_gateways/{id}/teams or POST /v2/agent_gateways/{id}/keys:
A key’s or team’s spend and budget_resets_at show where it stands.

Limit Changes

PATCH /v2/agent_gateways/{id}/keys/{key_id} and PATCH /v2/agent_gateways/{id}/teams/{team_id} change limits without reissuing anything. A field left out stays as it is, and null removes a limit.