Skip to content

Models and token budgets

The gateway holds the provider keys, allows only the models a policy names and stops calls once the day’s token budget is spent.

spec:
models:
allow: ["claude-sonnet-*", "gpt-4.1-mini"]
dailyTokenBudget: 2000000

How budgets count

Input plus output tokens, per policy, per UTC day, metered from each response, including streamed ones. Once the budget is spent, model calls get 429 until midnight UTC, so agents are paused, not killed. status.usage and kubectl leash status show today’s count:

Terminal window
$ kubectl leash status -n agents
NAME PHASE BACKEND TOKENS TODAY AGENTS APPROVALS NOTES
claude-agent Enforced cilium 1.6M / 2M (82%) 3 -

Budgets are soft

A call in flight when the budget runs out still finishes. With several gateway replicas, a budget can be overshot by roughly what the other replicas spend in one flush interval (gateway.usageFlushInterval, 15s by default).

Providers

Provider URLs and how their keys are sent are in the gateway’s registry (gateway.config in the chart). The keys themselves come from the gateway’s credentials Secret. Details in The gateway.