Model Pricing
The control plane calculates request cost from the usage it observes and the price associated with the upstream provider and model. Most models are priced on token counts; models billed by duration are priced on audio length. Configure a pricing override when a model has no catalog price or when your organization uses a different rate.
Prices can also vary by input length or service tier. A routing model can carry a model-group price and an off-peak discount of its own. To see how these values produced a recorded cost, read its cost breakdown.
Pricing affects the spend shown in Usage and the totals evaluated by budgets. Prompt and completion rates can also affect target ordering for least_cost routing groups. Pricing does not change what the upstream provider charges.
Choose the Organization Currency
Each organization records every amount in one currency: US dollars (USD, the default) or Chinese yuan (CNY). Owners and admins choose it in Settings → General → Currency; see Organization Currency.
Prices are entered by hand in the organization's currency. AISIX has no exchange rate and converts nothing:
- The models.dev catalog is priced in USD, so it applies only to a USD organization. In a CNY organization, catalog prices are not used anywhere: not to bill requests, not to rank
least_costtargets, not as price hints in the model form, and not in the Catalog tab of the Model pricing page. A model the organization has not priced has no price, so its requests record no cost andleast_costranks it last. Set a price for every model you use. - Switching the currency does not convert recorded history. Usage costs, budget limits, budget spend, and prices keep their numbers and are read in the new currency from then on.
- Admin API names for amounts carry no currency, such as
prompt_per_1mandcost. These responses state the currency in a top-levelcurrencyfield:GET /model_pricing, the usage-event list,usage_summary,usage_analysis, andusage_analysis/breakdown. A JSON usage export carries it in the trailer after the rows, and a CSV usage export in its last column,currency. It is the organization's current currency, so amounts recorded before a currency switch are reported in it unconverted. - The older names with a
_usdsuffix, such asprompt_usd_per_1mandcost_usd, remain as deprecated aliases and carry the organization's currency despite their name. Responses return both names with the same value. Requests accept either name, and a request that sends both names for one field with different values is rejected with400.
The currency also appears wherever AISIX reports money: the dashboard's amounts, the budget rejection message, budget alert notifications, the currency field of the alert webhook document, and the currency column of an AISIX Enterprise organization backup.
How AISIX Resolves Prices
AISIX applies the configured rates without hidden multipliers. Each usage event resolves a price by the exact (provider, model name) pair:
- An organization override wins when it matches the provider and model name.
- Otherwise, in a USD organization, AISIX uses the matching catalog default from models.dev. A CNY organization skips this step.
- If neither source matches, the usage event retains its reported usage but records zero spend.
A catalog default exists only for a model that models.dev lists with a price. A model it does not list, such as OpenAI's whisper-1, gpt-4o-transcribe, and tts-1, and a model it lists without price fields, are billed only after you configure a price for them. Until then, their usage is recorded with a cost of 0.
Four rules then adjust the result:
- A request addressed to a routing model that has a model-group price bills at that price instead, apart from the exceptions described there.
- When the price that applies carries service-tier rates and one of its entries names the tier the upstream reported serving the request at, that entry's rates replace the price's base token rates.
- A request addressed to a routing model that has an off-peak discount and completes inside one of its windows or on a day of one of its date ranges has its cost multiplied by the discount.
- A request answered from the gateway's response cache costs
0, whether it was addressed to a direct, embedding, or routing model. Its usage event keeps the replayed token counts and the cache-savings counters. Earlier control-plane versions billed a cache hit on a direct model at the model's full price.
Catalog refresh behavior depends on how pricing synchronization is configured. In online mode, the control plane refreshes the catalog at startup and every 24 hours. If a refresh fails while the catalog is still empty, such as on a host that cannot reach models.dev, the control plane loads the catalog snapshot bundled in its image instead, and later successful refreshes update it. An existing catalog is never replaced by the snapshot.
A refresh skips a catalog row when its stored entry is unchanged. The row's Updated time on the Model pricing page therefore records when the entry last changed, not when the catalog was last refreshed. By default, the AISIX Enterprise Docker Compose package loads the bundled catalog snapshot at startup, even when it has internet access. To enable online synchronization for that package, see Pricing Catalog.
Within a matching price, AISIX calculates token and duration cost independently, then adds the two terms. Token pricing uses the prompt and completion rates, with the cache and reasoning fallbacks described below. Duration contributes only when the event reports audio length and Audio per minute is nonzero.
Cost is calculated and stored when the usage event is recorded. A pricing change applies to later events and does not re-price historical usage.
The control plane is the only component that calculates cost. The gateway reports token counts and calculates no cost, so the usage events it exports to SLS, object storage, or Datadog carry no cost field, and a gateway that runs without a control plane exports no cost at all. Read cost from the control plane's usage data: the usage events of the Admin API and their export. Gateways at 1.9.0 or earlier also estimated a cost for Realtime sessions and Batch jobs and exported it as cost_usd, which was 0 on every other request. The gateway exports no spend metric.
How Reasoning Tokens Are Billed
Upstreams count reasoning in two different ways. OpenAI, for example, counts it inside completion_tokens and names the reasoning part separately. Gemini on the Vertex AI adapter can report its thinking tokens beside the completion instead. Usage events keep the counts as the upstream reported them, so the control plane decides per event which accounting applies, using the total the upstream itself reported (total_tokens):
- Reasoning beside the completion. This applies when
total_tokensandreasoning_tokensare both greater than zero, andtotal_tokensequals prompt + completion + reasoning tokens but not prompt + completion tokens. The whole ofcompletion_tokensbills at the completion rate, and the whole ofreasoning_tokensbills at the reasoning rate. - Reasoning inside the completion. Every other event, including every event without a reported total, is priced this way.
reasoning_tokensbills at the reasoning rate, and the rest ofcompletion_tokens, never below zero, bills at the completion rate. An upstream that reports more reasoning than completion is therefore billed for the reasoning it reported and nothing more.
Either way, a model with no distinct reasoning rate bills reasoning at its completion rate. For example, both of these events bill 20 tokens at the completion rate and 30 at the reasoning rate:
| Upstream | Prompt | Completion | Reasoning | Reported total | Accounting |
|---|---|---|---|---|---|
| Gemini on Vertex AI | 100 | 20 | 30 | 150 | Beside the completion |
| OpenAI | 100 | 50 | 30 | 150 | Inside the completion |
Cached input is recorded as reported too. An OpenAI-shape upstream counts both its cache reads, cached_prompt_tokens, and its cache writes, cache_write_tokens, inside prompt_tokens, so both are taken out of the input billed at the prompt rate. When they add up to more than prompt_tokens, no uncached input is billed rather than a negative amount.
/v1/messages and /v1/completions record reasoning_tokens and total_tokens the same way /v1/chat/completions does, so reasoning tokens reaching those two endpoints bill at the model's reasoning rate. See Recorded Token Counts for what each counter holds.
Review the Prices in Use
The Model pricing page opens on the In use tab. It lists the prices of the models your environments actually dispatch to, from every environment, together with every price the organization set itself:
- Prices in use lists each priced
(provider, model name)pair that a direct or embedding model names. A model whose model name is a*template is not listed, because it names no concrete model. - In use without a price lists the pairs in use that have no price. Requests to them record no cost until you select Set price and enter one. In a CNY organization, every pair in use that the organization has not priced appears here.
- Model groups lists the routing models that carry a model-group price or an off-peak discount. Edit them on the model group.
The Catalog tab shows every price, including the catalog defaults. In a CNY organization it lists only the model names each provider offers, without catalog prices, so you can find a model and set its price.
In the Admin API, GET /model_pricing?view=in_use returns the same view: priced pairs in data, unpriced pairs in unpriced, and the model groups in model_groups. Paging applies to data only.
Identify a Missing Price
Start with an expanded event in Request Logs, which shows the cost of each usage event or routing attempt to six decimal places. The aggregate Usage view rounds spend to two decimal places and shows only the top 10 environment/model rows. Therefore, zero spend or an absent model in Usage does not prove that pricing is missing. When checking a very low-priced request, generate enough token usage to make the expected cost visible before concluding that a price is missing.
A catalog price can be missing when:
- The model runs on a self-hosted or reseller upstream that models.dev does not price.
- The configured model name is a custom alias.
- The provider offers a newer model that the catalog does not yet include under that provider.
In a CNY organization, a missing price usually means the organization has not priced the model yet, because catalog prices do not apply. Check In use without a price on the In use tab.
The Dashboard also flags a missing price while you create or edit a direct or embedding model, and links to the price dialog for it. See Create a Direct Model.
Before adding an override, note the provider and model name exactly as they are configured. A pricing row that differs from either value does not match the usage event.
Add a Pricing Override
- Open Model pricing from the organization navigation.
- Select Add pricing.
- Enter the Provider and Model name exactly as configured on the model. The Provider field suggests known catalog providers but also accepts a custom value.
- Configure the basis the provider charges. Every rate is in the organization's currency:
- For a token-priced model, enter the Prompt and Completion rates per 1M tokens and leave Audio per minute at
0. - For a duration-priced speech-to-text model, leave the token rates at
0and enter the Audio per minute rate per minute of audio, such as0.006.
- For a token-priced model, enter the Prompt and Completion rates per 1M tokens and leave Audio per minute at
- For a token-priced model, optionally enter distinct Cache read, Cache write, One-hour cache write, 12-hour cache write, and Reasoning rates. To price by input length instead of one flat rate set, select Price by input-token tier; see Price by Input-Token Tier.
- To bill requests served at a fast or priority tier at their own rates, add them in Service tier prices (optional); see Price by Service Tier.
- Save the override.
The cache and reasoning rates price the upstream's prompt-cache reads, prompt-cache writes, and reasoning tokens. Cache write prices an Anthropic-style five-minute write and an OpenAI-style write other than a 12-hour one. A one-hour write, which the usage event records separately in its split by lifetime, bills as follows:
- At the One-hour cache write rate,
cache_write_1h_per_1min the Admin API, when the price sets one. It applies to the base rates only, which the first input-token tier shares: a higher input-token tier or a service-tier entry never uses it. - Otherwise, for a Claude model served by Anthropic, Amazon Bedrock, or Google Vertex AI, at twice the input rate in effect, including the rate of the input-token tier or service-tier entry that the request selects. This matches how those providers charge a one-hour write. AISIX recognizes such a model by the price's provider (
anthropic,amazon-bedrock,google-vertex, orgoogle-vertex-anthropic) and a model name that containsclaude, ignoring case. A model name without it, such as a Bedrock application inference profile ARN, is not recognized as Claude. - Otherwise at the Cache write rate. This covers every other model, Claude served through Azure AI Foundry or a reseller, a request billed at a model-group price, and a request on the decision endpoints, where a decision-endpoint cache write rate also replaces the one-hour rate.
A write that the upstream does not split by lifetime bills entirely at the Cache write rate. Leave one blank, null in the Admin API, to fall back: cache tokens then bill at the prompt rate, and reasoning tokens at the completion rate. Enter 0 only to make that token class free. The same rate set, with the same fallbacks, applies to each price tier and to a model-group price.
OpenAI Cache Writes
An OpenAI-compatible upstream reports its prompt-cache writes as cache_write_tokens, which are part of prompt_tokens. AISIX takes them out of the ordinary input and bills them at the Cache write rate, or at the prompt rate when that rate is blank. A model without a cache write rate therefore costs what it did before.
The part written with a 12-hour retention, which a 1.10.0 or later gateway records as cache_write_12h_tokens, bills at the 12-hour cache write rate instead, cache_write_12h_per_1m in the Admin API. The rest of the write, including the 30-minute part and a write the upstream did not split, bills at the Cache write rate. A 12-hour rate can be set wherever a cache write rate can: on the price's base rates, on each input-token tier, on each service-tier entry and its tiers, and on a model-group price and its tiers. The decision-endpoint rates have none. On a tiered price, the price's own 12-hour rate is a separate field, 12-hour cache write (default for every tier), that a tier left blank uses.
A 12-hour write bills at the first of these rates that is set:
- The 12-hour rate of the input-token tier the request selects.
- The 12-hour rate of the price being applied: the model's own price, or the group price when it applies.
- Twice the cache write rate in effect, when a cache write rate is set.
- The input rate in effect.
Under a service-tier entry, the order is the entry's own tier, the entry, the price's base 12-hour rate, twice the entry's cache write rate, and the entry's input rate. Unlike the entry's cache write rate, which falls back to the entry's input rate, a blank 12-hour rate on an entry keeps the price's base 12-hour rate.
On the decision endpoints, a decision-endpoint Cache write rate, when set, bills every write, including the 12-hour part. Without one, writes bill as described above.
Cost is calculated when the event is recorded and is not recalculated later. A control plane before 1.10.0 billed OpenAI-style writes as ordinary input, and the events it recorded keep that cost. Events recorded after the upgrade are priced this way whichever gateway version reported them, as long as it reports cache_write_tokens. Only a 1.10.0 or later gateway reports the 30-minute and 12-hour split, and only when the upstream returns it, so an older gateway's whole write bills at the Cache write rate.
Price by Input-Token Tier
Some providers charge a higher rate for a long request. A tiered price selects its rates by the size of the request's input:
- The input size is the request's input tokens, cache reads and cache writes included. Output length never changes the tier.
- Each tier has an inclusive Up to (input tokens, inclusive) limit, and the limits increase from tier to tier. The last tier has no limit and covers every larger request. A tiered price has at least two tiers.
- The whole request bills at the rates of the first tier whose limit covers its input. Tiers are not marginal: a request one token over the first limit bills every token at the second tier's rates.
- Each tier carries the full rate set: prompt, completion, cache read, cache write, and reasoning. A tier can also carry its own 12-hour cache write rate.
- The price's top-level rates equal the first tier's, and
least_costrouting ranks targets on them.
For example, with a first tier up to 200000 input tokens and an unlimited second tier, a request with 150,000 uncached input tokens and 60,000 cache-read tokens has an input of 210,000 tokens, so the whole request, output included, bills at the second tier's rates.
In a USD organization, a catalog price carries the long-context tiers models.dev publishes for the model, and they refresh with the catalog. The catalog's base rates become the first tier, up to and including the first threshold, and each published threshold starts the next tier; the highest tier has no limit. The same rules as above select the tier: the whole request bills at the tier its input crosses into, and a request exactly at a threshold stays in the lower tier. A catalog tier that publishes no cache read, cache write, or reasoning rate inherits that rate from the first tier, so a long-context cache read is not billed at the full input rate. When a model's catalog tiers cannot be represented, its catalog price stays flat. An organization override replaces the whole catalog price, tiers included.
To configure tiers in the Add pricing dialog, select Price by input-token tier, then edit each tier's limit and rates, and use Add tier or Remove tier as needed. A tiered row shows a tier-count badge on the Model pricing page. Clearing the option makes the first tier the flat price again.
In the Admin API, send the tiers as the tiers array of PUT /model_pricing/precise or PUT /model_pricing. The top-level rates must equal the first tier's, otherwise the request is rejected. null is a flat price:
{
"provider": "google",
"model_name": "gemini-2.5-pro",
"prompt_per_1m": 1.25,
"completion_per_1m": 10,
"cache_read_per_1m": 0.31,
"tiers": [
{"max_input_tokens": 200000, "prompt_per_1m": 1.25, "completion_per_1m": 10, "cache_read_per_1m": 0.31},
{"max_input_tokens": null, "prompt_per_1m": 2.5, "completion_per_1m": 15, "cache_read_per_1m": 0.625}
]
}
Decision-endpoint rates and Audio per minute are not tiered. They apply on top of whichever tier the request selects. Tiers are also available on a model-group price.
Price by Service Tier
Some providers serve a request at a faster or cheaper service tier and charge a different rate for it, such as OpenAI's priority processing or Anthropic's fast mode. A price can carry service-tier rates that bill those requests at their own rates.
The tier that selects the rates is the one the upstream reports it actually served the request at, recorded as the usage event's service_tier. It is never the tier the request asked for. A request that asks for a fast tier but that the upstream serves at its standard tier bills at the base rates.
- Each entry lists one or more tier names in
matchand carries a full rate set: prompt, completion, cache read, cache write, and reasoning, and optionally a 12-hour cache write rate. A blank cache rate falls back to the entry's own prompt rate, and a blank reasoning rate to the entry's own completion rate. An entry can also be tiered by input length, with the same rules as input-token tiers. - The event's
service_tieris compared with everymatchvalue, ignoring case and surrounding whitespace. The entry that names it replaces the price's base token rates and input-token tiers for that request. - A request whose tier no entry names, or whose upstream reported no tier, bills at the base rates.
- A price holds at most 16 entries, and an entry at most 16
matchvalues of up to 256 characters each. A value can appear in only one entry of a price, ignoring case, so a reported tier selects at most one entry. - Decision-endpoint rates and Audio per minute have no per-tier values. They apply the same way whichever entry a request selects.
- A response cache hit still costs
0, and a model group's off-peak discount multiplies the cost that the selected entry produced. - Service-tier rates affect recorded cost and budgets only.
least_costrouting ranks targets on the base rates.
Use the tier names the upstream reports, because AISIX passes the reported value through as is, and the name can differ from the requested tier and from model to model. When OpenAI serves a request with priority processing, GPT-6 models report fast and earlier models report priority, so an entry you write for it lists both names. A request OpenAI downgrades to Standard reports default and uses the base price unless an entry also matches that name. Anthropic's fast mode reports fast. To find the value your upstream reports, expand one of its requests in Request Logs and read Service tier.
To configure service-tier rates in the Add pricing dialog, expand Service tier prices (optional) and select Add service tier price. Type each tier name in Service tier names and press Enter, then enter the entry's rates. Remove service tier price deletes an entry.
In the Admin API, send the entries as the service_tier_prices array of PUT /model_pricing/precise or PUT /model_pricing. A save replaces the whole price, so a request that omits service_tier_prices or sends null removes them. The following price bills requests that the upstream served at priority or fast at one set of rates, and requests served at ultrafast at another. The rates are illustrative:
{
"provider": "openai",
"model_name": "gpt-5",
"prompt_per_1m": 1.25,
"completion_per_1m": 10,
"cache_read_per_1m": 0.125,
"service_tier_prices": [
{"match": ["priority", "fast"], "prompt_per_1m": 2.5, "completion_per_1m": 20, "cache_read_per_1m": 0.25},
{"match": ["ultrafast"], "prompt_per_1m": 5, "completion_per_1m": 40, "cache_read_per_1m": 0.5}
]
}
Where the service-tier rates come from depends on the price:
- In a USD organization, a catalog price carries the rates that models.dev publishes for the model's service-tier modes, and they refresh with the catalog. Each entry matches both the tier value that selects the mode and the mode's name, because an upstream can report either.
- An organization override replaces the whole catalog price, service-tier rates included. An override without service-tier rates bills every request at its base rates, so enter in the override any tier rates you still want.
- A CNY organization uses no catalog prices, so it enters service-tier rates by hand.
Service-tier rates are also available on a model-group price. A gateway at 1.6.x or earlier reports no service tier, so its requests always bill at the base rates.
Price a Model Billed by Audio Length
Some speech-to-text models are billed per minute of audio rather than per token and report no token counts. Such a request records its audio length instead, and the Audio per minute rate turns that length into spend. A model left at 0 for this rate contributes no duration-based cost.
The current AISIX catalog does not supply duration rates, so there is no default to inherit: create the row with the provider and model name exactly as configured. For example, OpenAI currently lists whisper-1 at $0.006 per minute. At that rate, a 60-second transcription costs $0.006.
Token and duration costs are additive. If an event contains both token usage and audio duration, and the matching price has nonzero rates for both, AISIX adds both terms. Configure only the usage basis that the provider charges.
Price the Decision Endpoints
A pricing override can carry a separate set of rates for requests on the decision endpoints, /v1/systemone and /v1/decisions. Use it when a model is billed differently there than on its other endpoints, or to price a decision model the catalog does not list.
- In the Add pricing dialog, enter the base rates as usual.
- Expand Decisions pricing (optional). The section notes that its rates apply to requests on
/v1/systemoneand/v1/decisions, and that a blank rate uses the matching rate above. - Enter the decision-endpoint rates you need, and leave the others blank.
- Save the override.
Each decision-endpoint rate you set replaces the matching base rate for those requests, whichever request format the caller used. A blank rate keeps the base rate. The cache and reasoning fallbacks then run over the rates in effect, so a decision request's cache tokens fall back to its decision-endpoint prompt rate when one is set. Leaving every rate blank stores no decision-endpoint rates.
In the Admin API, send the rates as the decisions object of the price, with the fields prompt_per_1m, completion_per_1m, cache_read_per_1m, cache_write_per_1m, and reasoning_per_1m. A save replaces the whole price, so a request that omits decisions or sends null clears the decision-endpoint rates.
Decision-endpoint rates affect recorded cost and budgets only. least_cost routing still ranks targets on the base rates.
Price a Model Group
A routing model can carry its own price, so that callers of the group pay one price whichever target serves them. Only routing models accept a model-group price; direct, embedding, ensemble, and semantic models reject it.
A request addressed to the group bills at the group price, whichever target serves it. The group price replaces the target's own price, and applies even when the target has no price. Two kinds of request addressed to the group bill at the serving target's own price instead, exactly as if the group had no price, because the group price has no rate for them:
- Requests on the decision endpoints,
/v1/decisionsand/v1/systemone. - Requests that the target's price bills by audio duration.
A group price can carry its own service-tier rates. A request addressed to the group whose tier no entry of the group price names bills at the group price's base rates, never at a target's service-tier rates. The two exceptions above bill at the serving target's own price, including the target's service-tier rates.
The group price does not apply to a request addressed to a target directly, or to a request forwarded by a passthrough route, even if its model field equals the group's name. It affects recorded cost and budgets only: least_cost routing still ranks targets by their own prices.
To set it, open the routing model's create or edit form and select Bill requests to this group at a group price in Model group price (optional). Enter the rates in the organization's currency, optionally as tiers and with service-tier rates. Clearing the option removes the price.
In the Admin API, send the rates as the price object of the routing model, with the same rate fields, optional tiers, and optional service_tier_prices as an organization price. A PATCH with "price": null removes it:
{
"price": {
"prompt_per_1m": 2.5,
"completion_per_1m": 10,
"cache_read_per_1m": 1.25
}
}
The group price and off-peak discount are independent. Configure the discount separately when eligible requests should cost less.
Discount a Model Group Off-Peak
A routing model can discount the requests addressed to it during off-peak hours and on days you list, such as public holidays. An off-peak discount is a set of weekly windows, a set of date ranges, or both, and a multiplier between 0 and 1, exclusive:
timezoneis an IANA timezone name, and it defaults toAsia/Shanghai.- Each window has an inclusive
startfrom00:00to23:59and an exclusiveendfrom00:01to24:00.00:00to24:00is a full day. - A window whose
startis later than itsendcrosses midnight. weekdaysrestricts a window to ISO weekdays,1for Monday to7for Sunday. Omit it for every day. For a window that crosses midnight,weekdaysmatches the day the window starts:22:00to06:00on weekdays1to5covers Friday 22:00 to Saturday 06:00, but not Monday 00:00 to 06:00.- Windows may overlap. A request inside any of them is discounted.
- Each entry in
date_rangeshas astartand anenddate inYYYY-MM-DDform. A range applies all day, from its start date to its end date inclusive, by calendar date in the discount's timezone. For a single day, use the same start and end date. Both must be real calendar dates, the start must not be later than the end, and a discount can list at most 100 date ranges. - A request inside any window or on any day of any date range is discounted at the same
multiplier. A date range has no multiplier of its own and cannot be limited to certain hours. - A discount needs at least one window or one date range, so it can list date ranges only. Responses always return
windows, as an empty list when only date ranges are set, and omitdate_rangeswhen there are none. - A date range in the past is kept as it is. It is not removed automatically and does not prevent the discount from being saved.
Whether a request is off-peak is decided by when it completed, read in the discount's timezone. There is no built-in holiday calendar: a public holiday is discounted only when you list it as a date range, and a make-up workday is not excluded from the windows.
The multiplier applies to the request's whole recorded cost, whichever price produced it: the group price, including its tiers, or the serving target's own price, including the decision-endpoint and audio-duration cases above. A group with an off-peak discount and no group price discounts its targets' prices. A cache hit stays free. The same scope as the group price applies: requests addressed to a target directly or forwarded by a passthrough route are not discounted, and least_cost ranking is unaffected.
The following discount halves the cost of requests that complete between 22:00 and 06:00 starting on a weekday, and all weekend, in China Standard Time:
{
"off_peak": {
"timezone": "Asia/Shanghai",
"windows": [
{"start": "22:00", "end": "06:00", "weekdays": [1, 2, 3, 4, 5]},
{"start": "00:00", "end": "24:00", "weekdays": [6, 7]}
],
"multiplier": 0.5
}
}
A request that completes at 23:00 on Friday, at 05:30 on Tuesday, or at any time on Sunday is discounted. A request that completes at 05:30 on Monday is not: that time belongs to a night that started on Sunday, which the first window does not cover, and the weekend window ends at Sunday 24:00.
The following discount halves the cost of requests that complete between 22:00 and 06:00 starting on a weekday, and at any time from October 1 to October 7, 2026, in China Standard Time:
{
"off_peak": {
"timezone": "Asia/Shanghai",
"windows": [{"start": "22:00", "end": "06:00", "weekdays": [1, 2, 3, 4, 5]}],
"date_ranges": [{"start": "2026-10-01", "end": "2026-10-07"}],
"multiplier": 0.5
}
}
A request that completes at 14:00 on Thursday, October 1, 2026, or at any time on Wednesday, October 7, 2026, is discounted because that day is in the date range. A request that completes at 14:00 on Saturday, October 10, 2026, is not, because that day is in neither the window nor the date range.
In the dashboard, select Discount requests to this group off-peak in the routing model's Off-peak discount (optional) section, then set the timezone, the windows, the date ranges, and the multiplier. Select Add date range to add a range and set its Start date and End date, or select Remove date range to remove it. A new discount starts with one window, 00:00 to 08:00 every day; to discount only the days you list, remove that window with Remove window. Clearing the option removes the discount. On the In use tab of the Model pricing page, the Model groups list summarizes each discount with its date ranges after its windows, and a single-day range as one date, such as ×0.3 · 2026-10-01 to 2026-10-07; 2027-01-01 (Asia/Shanghai). In the Admin API, send the off_peak object on the routing model; a PATCH with "off_peak": null removes it.
Read Platform Cost and the Price Tier
A model group's price and an off-peak discount change what a request is billed, not what the target model costs you. Each usage event therefore records platform cost and the price tier beside cost. All three fields are frozen when the event is recorded and can be null:
| Field | Meaning |
|---|---|
upstream_cost | The attempt's usage at the dispatched target model's own price, in the organization's currency. The target's service-tier rates and input-token tiers apply. A model group's price and an off-peak discount do not, so without either it equals cost. It is 0 on a cache hit, and null when the target has no price. |
price_tier_index | The position, starting at 1, of the tier that produced cost, in the price list that billed the attempt. That list is the model group's, the target model's, or a service-tier entry's. It is null when no tier's rates determined the cost: a flat price, a cache hit, no price, a decision-endpoint request, a request billed by audio length, or an attempt with no tokens. |
price_tier_max_input_tokens | The inclusive input-token limit of that tier. It is null on the open-ended last tier and whenever price_tier_index is null. |
Platform cost covers only usage recorded after the control-plane release that added it. Earlier events keep null in all three fields and are not recalculated.
A CNY organization uses no catalog prices, so a target model the organization has not priced records null. To see platform cost in a CNY organization, add a price for each target model, not only for the model group.
Expanding a row in Request Logs shows Platform cost and Price tier. Exports carry the same three fields. To compare billed amounts with platform cost by target, see Compare a Model's Targets.
Read the Cost Breakdown to see which input tier, service tier, and off-peak discount billed each part of a cost. A provider key budget accumulates platform cost.
Verify the Override
For the simplest verification, send a new request directly to the matching model, then expand the event in Request Logs. For a token-priced model, generate enough token usage to produce a visible cost. For a duration-priced model, use an audio sample with a known or sufficiently long duration. Confirm that the event shows the expected model and event cost. Request Logs does not currently display the measured audio duration, so calculate the expected duration cost from the sample length.
If you verify a routed or ensemble request instead, find the event or attempt rows that share its request ID. Add their costs before comparing the total with the expected cost.
Request Logs shows six decimal places. If the expected event cost rounds to zero at that precision, generate enough token usage to make the cost visible at that precision.
After sufficient traffic, you can also confirm aggregate spend in Usage. Usage rounds spend to two decimal places and shows only the top 10 model rows, so it is less reliable for verifying a single low-cost request.
Historical rows do not change after the override is saved. Compare an event created after the change rather than expecting an earlier zero-cost event to be recalculated.
Edit or Reset a Price
Edit a row to change the rates used for later events. Reset to catalog default removes the organization override. In a USD organization, if a catalog price exists, it takes effect again on the next usage event. In a CNY organization, the pair becomes unpriced.
A manually created duration-pricing row usually has no catalog default. Resetting that row removes its effective price, so later matching events record zero cost until another override is configured.
Next Steps
Continue with Budgets to enforce spending limits, then configure Budget Alerts and Notifications. Use Logging and Auditing to investigate individual request outcomes.