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.

Anatomy of a model record
| Part | Purpose |
|---|---|
| Name | Client-facing alias (for example gpt-5.6-luna). Unique, exact match only (no wildcards) |
| Provider mappings | One entry per provider that can serve it: provider_name, upstream provider_model_name, priority, and weight |
| Capability flags | supports_images (vision), supports_image_generation, supports_tts, supports_stt, supports_embedding, supports_rerank, supports_realtime, supports_systemone (decision models) |
| Catalog metadata | context_length, max_output_tokens, family, release date, knowledge cut-off, and models.dev attributes (attachment, reasoning, tool_call, structured_output, temperature, open_weights, status) |
| Pricing | Model-level rates, optionally overridden per mapping (see below) |
| Parameter overrides | Extra parameters injected by provider config → model → mapping (most specific wins) |
| Retry/timeout | max_retries overrides the global default for this model |
| Smart routing fields | auto_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(default1) splits traffic inside its priority group: with weights2and1, the2is picked twice as often as the1.0keeps the mapping as a last-resort fallback that is not picked while a weighted mapping is usable. Floats such as1.5are supported. - How weight is applied depends on the provider selection strategy:
randomsamples proportionally to weight,session_stickyweights its conversation hash (still deterministic per conversation, so the split shows up across conversations), andcost_optimized/balanceddivide their score by weight (a weight of2tolerates twice the price or combined score of1). - Within a group, the global selection strategy orders candidates (
session_stickyby default, orrandom,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:
| Field | Unit |
|---|---|
input_cost_per_1m, output_cost_per_1m | tokens |
cached_read_cost_per_1m, cached_write_cost_per_1m | tokens (cache hits/writes) |
cached_write_long_cost_per_1m | tokens (cache writes with a long minimum lifetime, e.g. OpenAI's 12-hour writes) |
reasoning_cost_per_1m | reasoning/thinking tokens |
audio_input_cost_per_1m, audio_output_cost_per_1m | tokens |
image_input_cost_per_1m | tokens |
cost_per_image | per generated image |
audio_cost_per_minute | STT duration |
tts_cost_per_1m_chars | TTS characters |
web_search_cost_per_1k | web-search requests |
Billing rules:
- Resolution order: a mapping's rate overrides the model-level rate field by field; provider-level
pricing_tiersoverride model-level tiers. - Context tiers (
pricing_tiers) bill by input-token threshold: the highest tier whosethreshold <= input tokensapplies, 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 hasstartandendinHH:MM, an optionaldayslist (ISO weekdays; empty means every day), and an IANAtimezone(defaultUTC). A window applies to requests that started inside it on the window's clock;endat or beforestartwraps past midnight, anddaysnames 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'sservice_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.devexperimental.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. Whenreasoning_cost_per_1mis 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_1mprices default-lifetime writes andcached_write_long_cost_per_1mprices 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
openrouterandnanogpt: their own figures replace the computed cost. cost_usd = nullmeans 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
| Surface | Contents |
|---|---|
GET /v1/models | Client-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 |
Related
- Providers: the upstreams these models point at
- Virtual Models & Routing:
auto/fast/best - Cost Control: prices, budgets, and enforcement