Skip to main content

Overview

Bifrost computes request costs using a built-in pricing catalog that is automatically synced from a remote datasheet. Custom Pricing lets you override those catalog prices at runtime without redeploying, applying your own rates for any model across any combination of provider, key, and virtual key scopes. Key capabilities:
  • Scoped overrides - apply prices globally or narrow them to a specific provider, provider key, or virtual key
  • Pattern matching - target an exact model name or a wildcard prefix (e.g. gpt-4*)
  • Request type filtering - restrict an override to one or more specific operations (chat, embeddings, image generation, etc.); at least one request type is required
  • Hierarchical resolution - the most-specific matching override always wins; broader scopes act as fallbacks

Pricing data source

Before configuring overrides, Bifrost needs a pricing catalog to work from. By default it ships with built-in prices and syncs them every 24 hours. You can point it at a custom pricing URL if you maintain your own datasheet.
  1. Navigate to Models in the sidebar
  2. Click the Pricing Settings tab
  3. Enter your pricing datasheet URL in the Pricing Datasheet URL field
  4. Set the Pricing Sync Interval (in hours)
  5. Click Save

Scope hierarchy

Every override is assigned a scope kind that determines which requests it applies to. When Bifrost resolves pricing for a request, it evaluates all matching overrides and selects the one with the most specific scope. More specific scopes always win over broader ones.
Scope kinds and their required identifiers:
Scope identifiers are exclusive to their scope kind - you cannot mix them. For example, virtual_key_provider requires virtual_key_id and provider_id and must not include provider_key_id.

Pattern matching

The pattern field controls which model names the override applies to. The match_type field controls how the pattern is interpreted.
For wildcard patterns, append a * at the end of the prefix. For example, claude-3* will match all Claude 3 variants.

Lookup precedence

When pricing resolves a request, it tries lookup candidates in this order against the catalog (built-in entries + your overrides):
  1. The alias’s canonical model_name (routing_info.resolved_key_alias.model_name)
  2. The alias’s wire model_id (routing_info.resolved_key_alias.model_id)
  3. The model the caller sent (routing_info.model)
The first non-empty candidate that matches a catalog entry wins. The precedence solves the opaque deployment ID case: when an admin aliases an unrecognisable wire ID (e.g. an Azure deployment 12345-azure-prod) to a catalog-known canonical name (e.g. claude-sonnet-4-5) via Static Aliasing, pricing hits the catalog via the canonical name even though the wire identifier wouldn’t. When no key-level alias matches, candidates (1) and (2) are absent and the lookup falls straight through to the model the caller sent — preserving pre-alias behavior. Overrides are matched against the wire model (model_id when an alias matched, otherwise the caller-sent model) so per-deployment override pricing stays addressable regardless of how the catalog entry was found.

Request type filtering

request_types is required and must contain at least one value. Only request types that have pricing support are accepted. Stream variants are treated identically to their base type - specifying chat_completion covers both streaming and non-streaming chat requests.

Creating an override

  1. Navigate to ModelsPricing Overrides in the sidebar Pricing Overrides Table
  2. Click Create Override
  3. Fill in the form:
    • Name - a human-readable label
    • Scope - select the scope kind and provide the matching IDs
    • Pattern - enter the model name or wildcard prefix
    • Match type - choose Exact or Wildcard
    • Request types - select one or more request types (required)
    • Pricing fields - enter the price values you want to override (only non-zero fields are applied)
  4. Click Save Pricing Override Form

Pricing fields reference

Only fields with non-zero values are applied. All values are cost per unit in USD.

Token costs

Token tier costs

Cache costs

Image costs

Audio and video costs

Other costs


Examples

Flat rate for all Anthropic models

Apply a single input/output rate to every Claude model globally:

Per-virtual-key negotiated rate

A specific virtual key has negotiated lower prices for GPT-4o:

Image generation override

Override costs for a specific image model at global scope:

Global catch-all for a new model

Use a global override to add pricing for a model not yet in the built-in catalog:

Next steps

  • Virtual Keys - Attach virtual-key-scoped overrides to virtual keys for per-customer pricing
  • Budget and Limits - Understand how costs are tracked against budgets
  • Model Catalog - Deep dive into how pricing resolution and cost calculation work internally