Skip to content

Set a budget, a model allowlist and an expiry on every LLM API key

Every Router One API key has four controls you set yourself in Dashboard → API Keys: a cumulative lifetime wallet cap (maxSpend), a daily or monthly period budget that resets at midnight Beijing time (UTC+8; monthly budgets on the 1st), a model allowlist, and an expiry date. Once the cap or the budget is used up, the key's wallet-billed requests return HTTP 402; with an allowlist on, the key can only call the models you list, and model="auto" is refused with HTTP 403. Requests covered by a Pro, Max or Ultra plan draw from the account's shared plan quota and do not count toward any key's cap or budget.

Key-level controls at a glance

A key's spend cap (maxSpend) limits what that key can charge to your wallet: once its cumulative wallet charges reach the cap, its wallet-billed requests return HTTP 402. Requests covered by your plan's quota draw from the account's shared plan quota and do not count toward any key's cap. A key can also carry a daily or monthly budget. It limits what that key can charge to your wallet in the period, resets at midnight Beijing time (UTC+8; monthly budgets on the 1st), and works alongside maxSpend: whichever runs out first stops the key's wallet-billed requests with HTTP 402. Requests covered by your plan's quota do not count toward it. A key can be limited to a model allowlist: it can only call the models you list, model="auto" is refused with HTTP 403, and channel ids such as aws/ or azure/ have to be added separately.

Key-level controls at a glance
ControlWhat it limitsWhen it resetsAt the limitPlan requests count?
Spending Limit (maxSpend)Lifetime wallet charges (USD)Never (edit to raise or turn off)HTTP 402 on wallet-billed requestsNo
Period budget (Daily / Monthly)Wallet charges per day or month (USD)00:00 Beijing time (UTC+8); 1st of month for MonthlyHTTP 402 on wallet-billed requests; works alongside maxSpend, whichever runs out firstNo
Model allowlistWhich models the key can callNever (until you edit it)Only listed models can be called; model="auto" returns HTTP 403Applies to all calls
Expiration DateHow long the key worksNever (extend or turn off in Edit)HTTP 401; an expired key you have not deleted still counts toward the active-key limitBlocks all calls
Default rate limits (rateLimit, tokenLimitTpm)Requests and tokens per minute, per key and per accountEvery minuteHTTP 429; email support@router.one to raiseApplies to all calls

How to set budgets and a model allowlist

Create the key first, then open its Edit dialog to turn on a period budget or a model allowlist. The command below lists the exact model IDs to copy:

terminal
curl -s https://api.router.one/v1/models \
  -H "Authorization: Bearer $ROUTER_ONE_API_KEY"
  • Open Dashboard → API Keys → Create Key and fill in Key Name, an optional Expiration Date and an optional Spending Limit (USD) (maxSpend).
  • On the key's row, open ... → Edit to change those fields or turn on Period budget (USD) and Model allowlist.
  • Under Period budget (USD), pick a Reset period (Daily or Monthly) and enter the Period budget amount (USD). Once a budget is saved, the dialog shows the Next reset in your browser's local time.
  • Under Model allowlist, click Add model and use Search models to pick catalog models, for example openai/gpt-6.2-sol. Channel IDs such as aws/ or azure/ have to be added separately.
  • In the key table, the Wallet charges / limit column shows cumulative charges, plus Today or This month against the period budget; once that budget is used up, it also shows when it resets and a Raise budget shortcut. A key with an allowlist shows how many models it is limited to.

Four ways to use per-key budgets and allowlists

Personal tools: one key per tool + daily budget

Give your IDE extension, terminal agent and scripts separate keys, each with a daily period budget. If one tool loops, only that key's wallet-billed requests stop, and they resume after the reset at midnight Beijing time; the other tools keep working. Requests your plan covers are not limited by the budget.

Small team: one key per developer + monthly budget

Issue one key per developer under one account, with a monthly period budget as the recurring allowance and an optional expiry date for contractors. Usage lists every key separately and Logs can be filtered by key, so offboarding someone means deleting one key (/blog/claude-code-codex-team-rollout).

Building a service for customers: one server-side key per customer

Keep one key per customer or tier strictly server-side in the service you run (never in client code). Combine a monthly period budget with a model allowlist so each tier only calls the models you priced for it (https://router.one/llm-api-reseller).

CI jobs: single-model allowlist + tight budget + expiry

Lock a CI key to one model such as deepseek-v4.1-flash or openai/gpt-6.2-sol, add a small daily budget and an expiry date, and write that exact model ID in the job, because model="auto" is refused on a key with an allowlist.

What these controls do not cover

  • Shared plan quotas: Pro, Max and Ultra quotas belong to the account, so plan-covered requests are limited by neither maxSpend nor the period budget.
  • Leaked keys on a plan account: lowering a budget does not stop plan-covered calls. Delete the key in Dashboard → API Keys so new calls return HTTP 401; in-flight calls still finish and settle.
  • Rate limits are separate from budgets. No low fixed cap for normal paid usage. Each key and each account runs under default request-per-minute and token-per-minute limits, and upstream constraints may still apply; if a request returns 429, back off and retry (honor Retry-After when it is sent), and if your traffic needs higher limits, email support@router.one to have the key or account limits raised.
  • No weekly reset and no group budget: period budgets reset daily or monthly, per key. The prepaid wallet balance is the only ceiling across all keys.
  • Expired keys you have not deleted still count toward the account's active-key limit, so delete keys you no longer use. Web Playground requests are sent without an API key, so a key's budget and allowlist do not apply to them.

How to verify usage and reconcile by key

Dashboard → Logs records each request the gateway forwards to a model with its model, tokens, wallet charge or plan quota used, latency and status, filtered by API key and date range. Requests refused before any model is called — a 401 for the key, a 402 for funds, a 429 from the key's or account's own limits, or a 400 or 404 for the model ID or endpoint — leave no record; a streamed request that failed before any output may have none either.

  • Dashboard → Usage ranks keys by wallet charges, tokens or requests, shows plan-covered request counts, and links to each key's filtered logs.
  • Dashboard → Logs and the wallet ledger each export up to 100,000 rows per CSV for reconciliation.
  • To alert before the account wallet hits zero, poll GET /v1/balance from your server (/blog/llm-api-balance-monitoring).

FAQ

When do daily and monthly API key budgets reset?

Daily budgets reset at 00:00 Beijing time (UTC+8); monthly budgets reset on the 1st of each month at 00:00 Beijing time (UTC+8). Once a budget is saved, the key's Edit dialog shows the next reset in your browser's local time.

What happens if a key has both maxSpend and a period budget?

Both apply at the same time: whichever runs out first stops the key's wallet-billed requests with HTTP 402, and raising one does not lift the other.

Do plan-covered requests count toward a key's daily or monthly budget?

No. Period budgets and maxSpend count wallet charges only. Plan-covered requests draw from the account's shared plan quota; requests past the plan quota and models the plan does not cover (including channel IDs) bill the wallet and do count.

Does a model allowlist cover model="auto" and channel IDs?

No. On a key with an allowlist, model="auto" is refused with HTTP 403, so set a specific model ID in your client. Channel IDs such as aws/ or azure/ are separate entries and have to be added on their own. Copy the exact IDs from /models when you build the list.

Can I set a budget or an allowlist while creating the key?

Create Key takes the key name, an optional expiration date and an optional spending limit (maxSpend). The period budget and the model allowlist are turned on afterwards, in the key's Edit dialog.

Can I change or turn off a budget later?

Yes. Open the key's Edit dialog in Dashboard → API Keys to raise, lower or turn off the spending limit, the period budget, the model allowlist or the expiry date. Once a period budget is used up, the key list also shows a Raise budget shortcut.

Does lowering a key's budget stop a leaked key on a plan account?

No. A leaked key on a Pro, Max or Ultra account can still use the shared plan quota. Delete the key in Dashboard → API Keys; new requests with it then return HTTP 401 (/blog/llm-api-key-leak-spend-cap).