Crescendo Lab Docs Deploy
English
Sign up

Gateway limits and budgets

Each request's maximum cost is held against workspace and department limits before sending. Rate limits cap requests and tokens per minute. Refusals return 429.

Last updated

Held before sending#

Before a request goes to a model, the Gateway works out the most it can cost: the prompt it estimates plus the output the request asks for (max_tokens or max_completion_tokens), at the price the request asks for. That amount is held against every limit that applies, together with what is already spent this month and what other requests in flight are holding. If it doesn't fit, the request is refused before it is sent and costs nothing. Requests that fit run in parallel.

When the answer arrives, the held amount is replaced by the measured usage. If the provider never reports usage (the connection broke, for example), the request is settled 15 minutes after it was sent at an estimate: the usage a Messages stream had reported before it stopped, otherwise the held amount. An owner or admin can correct an estimate once, on the request's row under AI Gateway › Usage.

Monthly limits#

LimitCountsWhere you see it
Workspace monthly spendUSD, at the catalog price of each modelAI Gateway › Usage › Monthly limits
Monthly tokens and requestsAll Gateway requests of the workspaceAI Gateway › Usage › Monthly limits
Department ceilingsUSD spent by keys charged to that departmentSettings › Usage
Rolling windowTokens in the last 6 hours, and each key's share of themThe refusal names it
End user, per keyUSD spent by one end user of a key this month (optional)The key's settings

Monthly limits reset on the first day of the next month, UTC. A key charged to departments counts against each of them and against the workspace; the tightest limit decides.

Rate limits#

Each key and each workspace also has a limit on requests per minute and tokens per minute. The defaults come from the workspace's plan and are set above the model providers' own per-minute limits, so a tool that works when connected directly does not hit ours first. Owners and admins can lower them for a key, for example for a batch job, or for the whole workspace.

The counts are shared by every Gateway server, so a key's limit applies to all its requests together. A request over a rate limit is refused before it is sent and holds nothing.

A key can also have a cap on concurrent requests. There is none unless you set one.

The three kinds of 429#

CodeWhat it meansRetry?What to do
provider_rate_limitedThe model provider is busy.Yes. The provider's Retry-After is passed on.Nothing; the official SDKs wait and retry.
gateway_rate_limitedThis key or workspace sends too fast.Yes. Retry-After and X-Should-Retry: true are sent.Wait, or raise the key's or the workspace's rate limit.
inference_allowance_exceededA monthly limit or ceiling has no room left.No. X-Should-Retry: false is sent.Ask an owner or admin to raise the limit, or wait for the reset.

The message names the limit, how much of it is used and, for a monthly limit, the day it resets, for example: This workspace reached its monthly spend limit (US$60.00 of US$60.00). Resets 2026-11-01. Ask a workspace admin to raise it.

Alerts#

When a monthly limit or a department ceiling reaches 80% and 100%, owners and admins see a banner on AI Gateway, and the workspace's notification destinations (email and signed webhook, set in Settings › Notifications) are told once per limit and threshold each month.