Skip to main content
The cost_cap policy (“LLM Cost Cap”) is a stateless, per-request price guard. Unlike the LLM Budget — which tracks cumulative spend over a window — cost cap looks only at the list price of the requested model and rejects or downgrades it before the call is made. It runs at pre_request. Use it to stop expensive models from being used at all on a given consumer or gateway, independent of volume.

Settings

SettingTypeDefaultNotes
max_input_cost_per_1k_tokensnumberGlobal input-price ceiling (USD per 1k tokens).
max_output_cost_per_1k_tokensnumberGlobal output-price ceiling (USD per 1k tokens).
per_model_overridesmapPer-model ceilings keyed by model slug / wildcard (most specific wins).
behavior_on_violationenumrejectreject or downgrade.
downgrade_tostringTarget model for downgrade (must be on the same provider).
unknown_modelenumrejectPrice not resolvable: reject, pass_through, or assume_max.
custom_pricingmapPer-token USD rates by model pattern, consulted before the built-in table.
Each per_model_overrides entry and custom_pricing value carries { input, output } price fields.
{
  "slug": "cost_cap",
  "settings": {
    "max_input_cost_per_1k_tokens": 0.005,
    "max_output_cost_per_1k_tokens": 0.015,
    "behavior_on_violation": "downgrade",
    "downgrade_to": "gpt-4o-mini",
    "unknown_model": "reject"
  }
}

Cost cap vs LLM Budget

cost_captoken_rate_limiter (LLM Budget)
StateStateless (per request)Stateful (Redis counters)
GuardsModel list priceCumulative tokens or USD over a window
Use for”Never let anyone use a model over $X/1k""Cap this tenant to $50/day”
Pair them: a cost cap blocks premium models outright, while an LLM Budget bounds total spend on the models that remain allowed.