Pricing is configured per target on the AI Model entity’s targets, using the input_cost and output_cost fields. Three optional fields extend those scalars to cover the dimensions in Model pricing dimensions: cache_write_cost_list, context_window_factor, and service_tier_factor. If one of these fields is absent, the calculation falls back to the corresponding scalar. If the field is present but no entry matches a request, the calculation also falls back to the scalar.
cache_write_cost_list, context_window_factor, and service_tier_factor extend the AI Model target schema beyond input_cost and output_cost. Check the AI Model entity reference for more details.
input_cost and output_cost price every target. Add cache_read_cost and cache_write_cost when the provider discounts cache reads or charges more for cache writes:
|
Field
|
Description
|
input_cost
|
Price per one million input tokens.
|
output_cost
|
Price per one million output tokens.
|
cache_read_cost
|
Price per one million cache-read (cache-hit) tokens.
|
cache_write_cost
|
Price per one million cache-write tokens. For a model with a single cache TTL tier, this scalar is the cache-write price and no cache_write_cost_list is needed.
|
Use cache_write_cost_list when a provider prices cache writes differently depending on how long the entry is kept, for example Anthropic’s 5-minute and 1-hour TTL tiers. Set a ttl and its cost per entry:
|
Field
|
Description
|
ttl
|
The cache lifetime, given as a number plus a time unit (h for hours, m for minutes), for example 1h or 5m.
|
cost
|
The price per one million cache-write tokens at that TTL.
|
If a request’s TTL doesn’t match any entry, the model falls back to cache_write_cost.
Use context_window_factor when a provider re-prices an entire request once it crosses a context-size threshold, for example GPT-5.6’s rate change above 272K input tokens. Each entry pairs a token threshold with its input and output multipliers:
|
Field
|
Description
|
above
|
The input-token threshold, given as a number plus a size unit (k or m), for example 200k or 1m. The threshold is measured on input tokens and gates both factors below.
|
input_factor
|
The multiplier applied to input-side pricing when the threshold is exceeded.
|
output_factor
|
The multiplier applied to output-side pricing when the threshold is exceeded.
|
If multiple entries exist, the model applies the highest threshold that the request’s input tokens cross.
With a 2M-token request and tiers at above: 200k and above: 1m, the above: 1m tier applies.
Use service_tier_factor when a provider offers a priority tier for lower latency or a flex tier for lower cost, and you want that price difference reflected in the calculated cost. The standard (default) tier is 1 and needs no configuration. Pair each tier name with its multiplier:
|
Field
|
Description
|
tier
|
The service tier this factor applies to, for example priority or flex. Matched case-insensitively as a substring of the provider’s reported service tier. If more than one entry matches, the longest (most specific) match wins.
|
factor
|
The multiplier applied across the whole request (input and output, and therefore cache) when this tier is in effect.
|
This example configures an AI Model target that bills:
- $4 per million input tokens and $24 per million output tokens, on the standard service tier.
- $0.4 per million cache-read tokens, a tenth of the input rate.
- $5 per million cache-write tokens by default, or $8 per million tokens for entries with a 1-hour TTL.
- Double the input rate and 1.5x the output rate, once a request’s input crosses 200K tokens.
- Double the resulting rate on the
priority tier, or half on the flex tier.
# Scalar fields (always present)
input_cost: 4 # $ per 1M input tokens
output_cost: 24 # $ per 1M output tokens
cache_read_cost: 0.4 # $ per 1M cache-read tokens
cache_write_cost: 5 # $ per 1M cache-write tokens (fallback)
# Cache-write pricing by TTL
cache_write_cost_list:
- ttl: 5m
cost: 5
- ttl: 1h
cost: 8
# Context-window pricing
context_window_factor:
- above: 200k # threshold measured on input tokens
input_factor: 2
output_factor: 1.5
# Service-tier pricing (standard = 1, omitted)
service_tier_factor:
- tier: priority
factor: 2
- tier: flex
factor: 0.5