Find a model

Browse the full catalog →

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 limit and a limit_reset interval when creating a key. For a monthly allowance, set the interval to monthly. OpenRouter key API
  • LiteLLM Proxy supports a virtual key with max_budget and budget_duration. Its separate max_parallel_requests setting 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.

Set up spend controls

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.

Workspace access

Sign in

Choose a sign in method to access your TrustedRouter workspace.

New to TrustedRouter?

By continuing you agree to the terms of service and privacy policy.