#token limit per model config entry?

1 messages · Page 1 of 1 (latest)

rocky cosmos
#

hey is it possible setup new model usage so that openclaw will first use 1m tokens of gpt-5.1-codex, then when that is exhausted immediately switch to 10 mill tokens of 5.1-codex-mini and then when that is used switch to the third method? (which will probably be gemini cli) and then have those 1m and 10m token allowances reset daily?

lean whaleBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

solid nightBOT
#

Not as a first‑class “token budget router”, no. OpenClaw can fail over on errors (429/quota/rate limit/auth/timeouts), but it doesn’t have a config like “spend 1M tokens on model A, then automatically switch to B until 10M, reset daily”.

What you can do (and it gets you pretty close):

1) Chain models with failover (error-driven)

Configure your primary + ordered fallbacks:

  • agents.defaults.model.primary
  • agents.defaults.model.fallbacks

Config reference: https://docs.openclaw.ai/gateway/configuration-reference (see agents.defaults.model)
Failover behavior: https://docs.openclaw.ai/help/faq#model-failover-and-all-models-failed

2) Enforce the “1M then 10M” outside OpenClaw

If you can put hard daily limits on the upstream credentials (provider-side limits, or a proxy), then once model A hits its quota it will start throwing 429/quota → OpenClaw falls back to model B automatically.

One common way is LiteLLM virtual keys with budgets (budgeting is in $ not tokens, but you can approximate):