Token pricing for a model API
Coho Models sells API access to three model families: large, medium and small. Each family is released as dated snapshots, such as model-medium-20260929. Prices differ by model family and token type, batch requests get 50% off, and requests with more than 200,000 input tokens pay a long-context premium. Its biggest customer, Initech, has signed a $50,000 prepaid annual commit with 20% off large-model output.
This example uses:
- Products
- Meters
- Rate cards, in preview
- Customers
- Orders, with negotiated pricing and a commit
- Events
- Commits
The calls below show only the request body. Every request also sends the Authorization and Paid-Version headers, and a Paid-Beta header opting in to the betas these endpoints require: products=v1, meters=v1, rate_cards=v1, customers=v1, orders=v1, commits=v1 and events=v1, plus event_costs=v1 for an event that sends cost. Writes should also send an Idempotency-Key. See request headers and idempotency.
Rate-card amounts are decimal strings in cents. Commit amounts are integers in cents, so $50,000.00 is 5000000.
Set up the catalog
These calls run once.
Create a product for the API:
Create a meter for each token type. Each meter sums one usage field from the model_call event and groups by model and service tier, so the rate card can price each combination separately:
Create three more the same way:
inputTokens counts uncached input only, so no token is billed twice.
The list prices, per million tokens:
Set up a rate card, api_list_prices, with one rate per meter and family. The rate card API is in preview; Introduction to pricing explains how a rate card prices meters. Each rate matches on the model name by prefix, so every snapshot of a family, past or future, bills at that family’s rate. Each rate’s key is its family and token type, such as large_output. Modifiers on the rate card apply multipliers on top of the rates, for every customer:
- Batch halves every rate for events whose
serviceTierisbatch. - Long context doubles input, cache read and cache write when the three input counts on one event sum to more than 200,000.
- Long context multiplies output by 1.5 under the same condition.
Sign Initech
Create an order for the 2027 contract. It bills the rate card monthly and carries the negotiated terms inline:
- A negotiated discount takes 20% off the
large_outputrate. It has no dates, so it lasts as long as the order. - A $50,000 prepaid commit for the whole term. Usage draws it down, and
billAtRatebills any usage beyond it at the normal rates.
An order with a rate card line is activated when you create it, so there is no separate activate call: Paid pins the version of api_list_prices in effect on 1 January 2027 and starts billing. This request needs an Idempotency-Key. If Paid can’t confirm the activation, it returns a retryable 503 with the order ID; retry with the same key. Because the commit is on the order, activation issues the $50,000.00 prepaid invoice straight away.
Send usage
Coho Models sends an event for every request, with the model, service tier and token counts in the payload. The request ID is the dedupeKey, so a retried send is not counted twice. This one is a long-context request: its three input counts sum to 240,000.
The optional cost line records what the request cost Coho Models to serve, for margin reporting. It is never shown to Initech.
To send many requests at once, send a batch of up to 1,000 events.
Initech’s first month
How each line is priced:
- Medium, standard: input 80M × $3.00/M = $240.00, cache read 160M × $0.30/M = $48.00, output 28M × $15.00/M = $420.00. Total $708.00.
- Medium, long context: the three input counts sum to 240k, over 200k, so input and cache read are ×2 and output ×1.5. Input 200M × $3.00/M × 2 = $1,200.00, cache read 1,000M × $0.30/M × 2 = $600.00, output 10M × $15.00/M × 1.5 = $225.00. Total $2,025.00.
- Older medium snapshot: the prefix match bills it at the medium rate. Input 1.5M × $3.00/M = $4.50, output 0.15M × $15.00/M = $2.25. Total $6.75.
- Small, batch: input 60M × $0.80/M = $48.00, output 6M × $4.00/M = $24.00, then ×0.5 for batch. Total $36.00.
- Large, standard: input 8M × $15.00/M = $120.00, cache write 16M × $18.75/M = $300.00, output 7M × $75.00/M = $525.00, for $945.00 at list price. The negotiated discount takes 20% off output: $525.00 − $105.00 = $420.00. Total $840.00.
The invoice shows usage at list price, $3,720.75, then the “Negotiated discount” line of −$105.00, then “Drawn from prepaid commit” of −$3,615.75. Amount due: $0.00.
Retrieve the commit to see what is left. Its balance.remaining drops from 5000000 to 4638425 ($46,384.25), counted at Initech’s negotiated rate:
The response is trimmed to the fields that matter here.