Skip to content
LUNAROUTEDocs

Model policy & spend caps

Owners and admins of an organization whose plan includes model policy (the Teams plan today). Find it in the dashboard under Model policy.

  • The organization list is either All models the plan allows or a selected set. Each member inherits the organization’s list or gets their own selected set, limited to what the organization allows.
  • Matching is exact. Allowing a model also allows its -background variant.
  • A blocked model looks like it doesn’t exist: model listings omit it, and a direct call gets the normal unknown-model 404.
  • Changes apply within about a minute.
  • Caps apply only to models served on your own provider keys, never to LunaRoute-managed models.
  • A cap is per model, set for the whole organization and/or per member, in USD per calendar month (UTC). It resets on the 1st.
  • A cap needs a price. Prices come from the synced public price list or from LunaRoute. You can enter your own, and yours wins.
  • Before each request, the worst case is reserved: input tokens, plus max_tokens (or the model’s maximum output), at the model’s price. A request that would cross the cap is refused, never truncated. After the response, the actual cost replaces the reservation.
  • If a response reports no usage, it counts at the worst case until the nightly reconcile corrects it from recorded usage. A provider error response before any output (for example a 502 from the provider) counts nothing; a stream that fails partway counts its reported usage, or the worst case if it reported none.
  • 429 with error.code BYOK_SPEND_CAP_REACHED. The body has scope (org or member), model, cap_usd, spent_usd, reserved_usd, request_worst_case_usd and resets_at. There is no Retry-After: the same request will not fit before resets_at or a higher cap, unless a smaller max_tokens brings its worst case under the cap, or in-flight requests (reserved_usd) settle below their reservation.
  • 429 MODEL_UNPRICED: the model has a cap but no price. Set one on the Spend tab.
  • 503 BYOK_SPEND_GATE_UNAVAILABLE: the spend counter store is unreachable, so capped requests fail closed. Retry later.

See Errors & rate limits for the full list.