Get model pricing
/v1/models/{model_id}/pricingReturn the price your account pays for one model right now.
Use the id from GET /v1/models as model_id. Upper and lower case both work. The model field in the response is the id to keep.
Authentication
Authorization Bearer
Required. Send an API key (sk-...). A request without a key returns 401.
The price is for the account that owns the key. An enterprise key returns that enterprise's price, including a negotiated price when one exists. A personal key does not receive another enterprise's negotiated price.
Path Parameters
model_idstringrequiredModel id from GET /v1/models, field data[].id.
What you pay
- Pick one rule in
plan.rules. Rules are already in the order to try. Use the first rule whosewhen_exprmatches this request.{ "all": [] }matches every request, so a rule with that condition is the price for every time an earlier rule did not match. - Read
rateon each component of that rule. For tokens,unit1Mmeans USD per 1 million tokens. The top-levelunitper_1m_tokensmeans the same thing. - Apply the account factor:
price_factoris a number: payable =rate × price_factorprice_factorisnull: payable =rate
discount_percent_off restates the factor as a percent. 0.80 and 20.00 are the same discount. Do not subtract the percent again after multiplying.
Which offer you have
LIST | Standard list price for this model. | rate |
MODEL_FACTOR | This enterprise has a factor on this model. The rate is the list price before that factor. | rate × price_factor |
PLATFORM_FACTOR | This personal account has a factor. Same arithmetic as MODEL_FACTOR. | rate × price_factor |
TENANT_PLAN | A price negotiated for this enterprise. The rate is already that price. | rate |
plan.source says where the rate came from. TENANT_PLAN is the negotiated price. PLATFORM_DEFAULT is the platform list price, which you still multiply by price_factor when that field is present.
When a rule applies
when_expr.all lists conditions that must all be true. These two fields are the usual ones:
utc_weekday | Day of week in UTC. 1 is Monday, 7 is Sunday. op in means the day is one of the listed numbers. |
utc_minute_of_day | Minute of the UTC day, from 0 (00:00) to 1439 (23:59). op between and [60, 239] means minute 60 through minute 239, which is 01:00 UTC up to but not including 04:00 UTC. |
1{
2 "all": [
3 { "op": "between", "field": "utc_minute_of_day", "value": [60, 239] },
4 { "op": "in", "field": "utc_weekday", "value": [1, 2, 3, 4, 5] }
5 ]
6}That rule is Monday through Friday, 01:00–03:59 UTC. { "all": [] } has no condition, so it is the price at every other time.
What each component charges
uncached_input_tokens | Input tokens that were not served from cache. |
input_tokens, prompt_tokens | Input tokens. |
cache_read_tokens | Input tokens served from cache. |
cache_creation_tokens | Tokens written into cache. |
output_tokens, completion_tokens | Generated output tokens. |
thinking_tokens, reasoning_tokens | Reasoning tokens, when the model bills them separately. |
type linear means the charge grows in proportion to usage. rate is the price for one unit of that meter.
Some components also include:
included_units: this many units are free; the rate applies after that.subtract: meters already billed by another component. They are removed here so the same usage is not billed twice.dimension_per_unit: how many raw units make one billed unit. When this field is absent, one unit of usage is one billed unit.
name is the plan title. description is the rule's name. price_type is an internal label. None of the three changes the amount you pay.
as_of is the UTC time of this response. The body is the current price only. It does not list older discounts.
Response
objectstringAlways model.pricing.
modelstringModel id to send in later requests.
currencystringCurrency of rate, such as USD.
unitstringper_1m_tokens. Token rates are per 1 million tokens, the same as a component unit of 1M.
offerstringLIST: pay rate. MODEL_FACTOR or PLATFORM_FACTOR: pay rate × price_factor. TENANT_PLAN: negotiated price, pay rate.
price_factornumber|nullAccount factor. 0.80 means you pay 80% of rate. Null means rate is already what you pay. Do not also subtract discount_percent_off.
discount_percent_offnumber|nullThe same factor written as a percent off. 0.80 is 20.00. Null when there is no factor below 1.
planobjectRules for this model, and where the rates came from.
plan.sourcestringPLATFORM_DEFAULT: list price, then apply price_factor when present. TENANT_PLAN: negotiated price, pay rate as shown.
plan.rulesobject[]Try these in order. Use the first rule whose when_expr matches.
as_ofstringUTC time of this response.
Errors
401 | authentication_error | — | No API key. |
404 | not_found_error | model_not_found | Unknown model, or this account cannot use it. |