Models & pricing
Every model costs half its list price per token: input, output, cache reads and cache writes. See how each call's charge is computed and list models.
The pricing rule fits in one line: you pay half the official list price for every token, on every model. That applies to uncached input, output (thinking and reasoning included), cache reads and cache writes alike.
Prices are quoted in US dollars per million tokens. Each call is charged from the token counts the model reports in its own response, and the amount leaves your prepaid balance a few seconds after the call ends.
Half price, token by token#
Here is what that means on claude-sonnet-5.5, per million tokens:
| Token kind | List price | You pay |
|---|---|---|
| Uncached input | $2.00 | $1.00 |
| Output | $10.00 | $5.00 |
| Cache read | $0.10 | $0.05 |
| Cache write | $2.50 | $1.25 |
The same ×0.50 factor applies to every Claude, GPT and Gemini model, in every channel group and in every API format. The live table at the bottom of this page lists the current models.
The formula#
A call's usage breaks down into four token kinds, each with its own price. Where to find them in each API:
| Token kind | Anthropic usage | OpenAI usage | Gemini usage |
|---|---|---|---|
| Uncached input | input_tokens | prompt_tokens minus cached_tokens | promptTokenCount minus cachedContentTokenCount |
| Cache read | cache_read_input_tokens | prompt_tokens_details.cached_tokens | cachedContentTokenCount |
| Cache write | cache_creation_input_tokens | not reported | not reported |
| Output | output_tokens (thinking included) | completion_tokens (reasoning included) | candidatesTokenCount + thoughtsTokenCount |
They combine like this:
charge = ( uncached_input × input_price
+ cache_read × cache_read_price
+ cache_write × cache_write_price
+ output × output_price ) ÷ 1,000,000 × multiplierThe prices are the model's list prices, and the multiplier is that of the channel group that answered, named in the x-halfoff-group response header. All three groups bill at ×0.50, which is where the half price comes from. Each charge is rounded up to the next $0.000001.
GPT and Gemini models report no cache writes, so for them only three of the four terms apply.
A worked example#
One turn of a long coding chat on claude-sonnet-5.5, where most of the history comes from the cache:
| Token kind | Tokens | You pay per 1M | Cost |
|---|---|---|---|
| Uncached input | 3,000 | $1.00 | $0.003000 |
| Cache read | 50,000 | $0.05 | $0.002500 |
| Cache write | 1,500 | $1.25 | $0.001875 |
| Output | 1,200 | $5.00 | $0.006000 |
| Total | $0.013375 |
If none of those 54,500 input tokens had come from the cache, input alone would have cost $0.054500 instead of $0.007375. Caching and the half-price rate stack; Prompt caching shows how to keep the hit rate high.
List models and prices#
GET /v1/models returns every model you can call right now, with context size, your prices (half the list price) and the groups that serve it. It needs no key, and both the OpenAI and the Anthropic SDK can read it with client.models.list().
curl https://halfoff.dev/v1/modelsAn abridged response:
{
"object": "list",
"data": [
{
"id": "gemini-3.1-pro",
"object": "model",
"type": "model",
"display_name": "Gemini 3.1 Pro",
"created": 1700000000,
"created_at": "2025-01-01T00:00:00Z",
"owned_by": "Google",
"context_length": 1048576,
"pricing": {
"input": 1,
"output": 6,
"cache_read": 0.1,
"cache_write": 0.1875,
"unit": "USD per 1M tokens"
},
"groups": ["gemini-value"]
},
{
"id": "claude-sonnet-5.5",
"object": "model",
"type": "model",
"display_name": "Claude Sonnet 5.5",
"created": 1700000000,
"created_at": "2025-01-01T00:00:00Z",
"owned_by": "Anthropic",
"context_length": 1000000,
"pricing": {
"input": 1,
"output": 5,
"cache_read": 0.05,
"cache_write": 1.25,
"unit": "USD per 1M tokens"
},
"groups": ["claude-value"]
}
],
"has_more": false,
"first_id": "claude-fable-5.1",
"last_id": "gpt-5.6-luna"
}| Field | Meaning |
|---|---|
id | The id to send. Other spellings resolve as well; see Model ids. |
owned_by | Vendor: Anthropic, OpenAI or Google. |
context_length | Largest context window, in tokens. |
pricing.input | Your price for uncached input tokens. |
pricing.output | Your price for output tokens, thinking and reasoning included. |
pricing.cache_read | Your price for input tokens read from the prompt cache. |
pricing.cache_write | Your price for input tokens written to the cache. null means writes are billed as ordinary input. |
pricing.unit | Always USD per 1M tokens. |
groups | Channel groups serving the model. |
created, created_at | Fixed placeholders, there for SDK compatibility. |
The pricing fields are already your rates: the official list price × ×0.50. GET /v1beta/models lists the same models in Gemini's format, without prices.
Calls that cost nothing#
- Requests turned away before reaching a model: bad key, model not allowed, no balance, rate limit, malformed JSON.
- Requests that fail on every channel, and any attempt that failed and was retried elsewhere. Only the attempt that answered is billed.
POST /v1/messages/count_tokensand Gemini's:countTokens.- Listing models.
Cancelled and interrupted streams#
Close a stream early and you pay for what was produced up to that moment, at the same half-price rates. Input is the count the stream reported, or roughly one token per four characters of your request if it reported nothing. Output is the larger of the count reported so far and roughly one token per four characters of text already delivered.
When the gateway ends a stream because the model went silent, billing works the same way: you pay for what you received. See Streaming.
Where charges show up#
Logs list every call with its token counts and its charge. The marketplace shows each model's price per group with the multiplier applied, plus live availability. Balance and top-ups are in Billing, usage reports in Usage.
Live price table#
The table below is read live from GET /v1/models and shows your rates per million tokens: half the official list price.
| Model | Context | Input | Output | Cache read | Cache write |
|---|---|---|---|---|---|
Live from GET /v1/models · USD per 1M tokens