Skip to content

Models & Pricing ​

A model record is what clients send as model: a name you choose, mapped to one or more providers with capability flags, context size, and prices.

Model configuration

Anatomy of a model record ​

PartPurpose
NameClient-facing alias (for example gpt-5.6-luna). Unique, exact match only (no wildcards)
Provider mappingsOne entry per provider that can serve it: provider_name, upstream provider_model_name, priority, and weight
Capability flagssupports_images (vision), supports_image_generation, supports_tts, supports_stt, supports_embedding, supports_rerank, supports_realtime, supports_systemone (decision models)
Catalog metadatacontext_length, max_output_tokens, family, release date, knowledge cut-off, and models.dev attributes (attachment, reasoning, tool_call, structured_output, temperature, open_weights, status)
PricingModel-level rates, optionally overridden per mapping (see below)
Parameter overridesExtra parameters injected by provider config → model → mapping (most specific wins)
Retry/timeoutmax_retries overrides the global default for this model
Smart routing fieldsauto_eligible, quality_tier (economy/balanced/premium), routing_assignments, used only when smart routing is on

Not every flag is enforced on the request path: supports_images and context_length filter smart-routing candidates, supports_realtime is enforced on the Realtime WebSocket, supports_rerank gates /v1/rerank (a model without it is rejected with 400), and supports_systemone gates /v1/systemone and /v1/decisions. The remaining flags are catalog and display metadata.

Provider priority, weight and fallback ​

  • Candidates are grouped by mapping priority (higher wins). The highest non-empty group is tried first, then the rest in order.
  • A mapping's weight (default 1) splits traffic inside its priority group: with weights 2 and 1, the 2 is picked twice as often as the 1. 0 keeps the mapping as a last-resort fallback that is not picked while a weighted mapping is usable. Floats such as 1.5 are supported.
  • How weight is applied depends on the provider selection strategy: random samples proportionally to weight, session_sticky weights its conversation hash (still deterministic per conversation, so the split shows up across conversations), and cost_optimized / balanced divide their score by weight (a weight of 2 tolerates twice the price or combined score of 1).
  • Within a group, the global selection strategy orders candidates (session_sticky by default, or random, cost_optimized, balanced).
  • Each mapping is attempted once per request. Failures retry within the provider (max_retries) and then fall back across providers (max_fallback_attempts).
  • Any provider error falls back to the next mapping while one remains, because upstreams sometimes misreport errors (such as a context-window rejection returned as a generic 400).
  • 408, 429, 500, 502, 503, 504, and network/timeout errors retry before falling back; other errors move straight to the next provider.

Pricing ​

All prices are in USD. Rates are per 1M tokens unless stated otherwise:

FieldUnit
input_cost_per_1m, output_cost_per_1mtokens
cached_read_cost_per_1m, cached_write_cost_per_1mtokens (cache hits/writes)
cached_write_long_cost_per_1mtokens (cache writes with a long minimum lifetime, e.g. OpenAI's 12-hour writes)
reasoning_cost_per_1mreasoning/thinking tokens
audio_input_cost_per_1m, audio_output_cost_per_1mtokens
image_input_cost_per_1mtokens
cost_per_imageper generated image
audio_cost_per_minuteSTT duration
tts_cost_per_1m_charsTTS characters
web_search_cost_per_1kweb-search requests

Billing rules:

  • Resolution order: a mapping's rate overrides the model-level rate field by field; provider-level pricing_tiers override model-level tiers.
  • Context tiers (pricing_tiers) bill by input-token threshold: the highest tier whose threshold <= input tokens applies, and unset dimensions inherit the base rate. Thresholds must be unique. Unit-based rates (images, audio minutes, TTS chars, searches) are never tiered.
  • Time windows (pricing_time_windows) support peak/off-peak pricing. Each window has start and end in HH:MM, an optional days list (ISO weekdays; empty means every day), and an IANA timezone (default UTC). A window applies to requests that started inside it on the window's clock; end at or before start wraps past midnight, and days names the day the window starts on. Requests outside every window bill at the base rates. Windows must not overlap in UTC time. In the console, windows sharing a timezone, day set, and rates are edited as one band with multiple clock ranges. Enter these manually; models.dev does not publish time-of-day pricing.
  • Service tiers (service_tier_pricing) map mode names (flex, priority, etc.) to rates, selected by the request's service_tier (the provider's reported tier wins over the requested one). Tiers with no entry keep the rates resolved by earlier overlays. Synced from models.dev experimental.modes.
  • Provider overrides: for tiers, time windows, and service tiers, a provider mapping can be unset/null (inherit model-level value), non-empty (replace it), or an empty list/map (disable the overlay for that provider).
  • Overlay order: base rates → context tier → time window → service tier. Each overlay replaces only the dimensions it sets and reprices the whole request.
  • Reasoning tokens are counted inside output_tokens. When reasoning_cost_per_1m is set they are carved out and charged at that rate; otherwise they bill at the output rate.
  • Cache tokens are repriced from the base input rate to the cached read/write rate, and the net difference is recorded as cache_savings_usd (reads saved minus extra write cost, which can be negative on write-heavy turns). Without a base input rate, cache tokens bill at the cache rates directly.
  • Cache writes split by lifetime: cached_write_cost_per_1m prices default-lifetime writes and cached_write_long_cost_per_1m prices long-lifetime writes (such as OpenAI's 12-hour cache). When the long rate is unset, all written tokens bill at the default rate.
  • Audio and image tokens are carved out of prompt/completion tokens when a dedicated rate exists so they are not double-charged.
  • Provider-reported cost wins for openrouter and nanogpt: their own figures replace the computed cost.
  • cost_usd = null means unknown rather than free: it is null when there is no billable usage or no rate configured at any level. For chat requests without upstream usage, tokens are estimated before pricing.

Sync from models.dev ​

The Sync from models.dev dialog on the Models screen covers Pricing (per provider mapping) and Capabilities (per model) in two tabs. Both previews load when the dialog opens and show how many rows would change. If one section fails to load, it shows its own error and retry button while the other stays usable.

  • Pricing matches rows by provider_model_name (falling back to the proxy model name). Each row lets you switch catalog sources to preview what would be written, or click a rate to override it manually.
  • Capabilities lists each changed field as "old → new".

Rows are badged by what writing them does: New and Fill only set values you have not configured, while Overwrite replaces or clears an existing value. Only New and Fill rows are checked by default, and the bottom bar shows how many Overwrite rows remain unchecked. Unchecked rows are skipped.

The bottom bar summarizes what will be written ("3 rows will be written"). Clicking Apply expands an inline confirmation listing the affected mappings and models, and confirming writes both tabs in one step.

Pricing sync writes to mapping-level rates only, leaving model-level rates untouched. It pulls reasoning token rates, per-tier reasoning rates, and service-tier prices, and never modifies hand-authored pricing_time_windows. Missing catalog data never counts as a change.

Seeing what clients can use ​

SurfaceContents
GET /v1/modelsClient-facing list: every configured model name plus the highest-priority provider, filtered by the API key's allowlist. Includes auto/fast/best when smart routing is enabled
Models screen (admin)Full management view
Models screen (viewer)Read-only catalog of what that account may use

MIT licensed