TrustedRouter / Routing controls
Programmable LLM API Spend Controls & Budgets
Set programmable daily, weekly, monthly and lifetime API key budgets. Include in-flight cost estimates with opt-in strict admission; final charges can exceed estimates.
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.
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.
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. 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.