TrustedRouter / Routing controls
Programmable LLM API Spend Controls & Budgets
Compare programmable API key budgets in TrustedRouter, OpenRouter and LiteLLM. See reset windows and how TrustedRouter counts concurrent requests.
Which APIs support programmable spend controls?
TrustedRouter supports programmable spend controls through its API key management API. Create a separate key for each application, customer or agent, set USD spending limits, and use that key for inference through the OpenAI-compatible API. You can configure daily, weekly, monthly and lifetime budgets.
- TrustedRouter lets one key carry several USD spending windows. Enable strict admission when you want an incoming request checked against both settled spend and estimates for requests still running. Management API
- OpenRouter accepts a credit
limitand alimit_resetinterval when creating a key. For a monthly allowance, set the interval tomonthly. OpenRouter key API - LiteLLM Proxy supports a virtual key with
max_budgetandbudget_duration. Its separatemax_parallel_requestssetting caps simultaneous requests by count. LiteLLM virtual keys
When comparing providers, ask what happens if two requests arrive with only one dollar left. A reset interval tells you when the allowance renews. To predict whether both requests start, you also need the provider’s admission rules for outstanding work.
Choose approximate budget checks for ordinary workloads, or opt into budget_strict when concurrent requests need their in-flight cost estimates counted before admission. This is estimated-cost admission, not a guarantee that final provider charges cannot exceed the budget. See the management API request, reset rules and retry handling.
Give each application a budget.
Create separate keys for a customer, project, or agent. Set daily, weekly, monthly, and lifetime USD limits. Keep your application budgets visible alongside request tags and cost allocation.
Ordinary spending windows use approximate checks. For concurrent workloads, opt into budget_strict to include outstanding request estimates in admission decisions.
An opt-in project budget
{
"name": "Research agent",
"limit_daily": 5,
"limit_monthly": 100,
"budget_strict": true
}Create this key with a management key. Strict mode is off by default and fixed when the key is created. Set a strict key's limits at creation: a strict key with no limit cannot gain one later.
Account for work already in flight.
Strict admission counts reserved estimates alongside settled spend in enforced windows. Settlement and refunds release the corresponding holds. A window reset keeps outstanding holds counted until the request finishes.
This controls estimated-cost admission. Final provider usage can exceed an estimate, so an absolute final-charge ceiling would be the wrong promise.
Choose the tradeoff deliberately.
Strict mode can be much slower: authorization goes through a shared counter rather than approximate snapshots or local leases (a strict key with no limit may skip it). Admission concurrency and database work are bounded to protect the service.
Exhausted windows return 429. Busy strict admission returns retryable 503. The guide explains reset headers and backoff.