Pricing
Live prices per million tokens for every model, what each price column means, long-context tiers, and how to work out a request's cost from its usage.
When to use this page
You want to know what a model costs, which tokens are billed at which price, or how to estimate a request's cost from the usage in its response. How the balance is charged is on How billing works.
Prices
| Model | Input | Output | Cache write (5 min) | Cache write (1 h) | Cache read |
|---|---|---|---|---|---|
Claude Fable 5.1 anthropic/claude-fable-5-1 | $9 | $45 | $11.25 | $18 | $0.225 |
Claude Fable 5 anthropic/claude-fable-5 | $9.5 | $47.5 | $11.875 | $19 | $0.95 |
Claude Opus 5.5 anthropic/claude-opus-5-5 | $3.6 | $18 | $4.5 | $7.2 | $0.18 |
Claude Opus 5 anthropic/claude-opus-5 | $4.75 | $23.75 | $5.9375 | $9.5 | $0.475 |
Claude Sonnet 5.5 anthropic/claude-sonnet-5-5 | $1.8 | $9 | $2.25 | $3.6 | $0.09 |
Claude Sonnet 5 anthropic/claude-sonnet-5 | $1.9 | $9.5 | $2.375 | $3.8 | $0.19 |
Claude Haiku 5.5 anthropic/claude-haiku-5-5 | $0.09 | $0.45 | $0.1125 | $0.18 | $0.009 |
Claude Opus 4.8 anthropic/claude-opus-4-8 | $4.75 | $23.75 | $5.9375 | $9.5 | $0.475 |
Claude Opus 4.7 anthropic/claude-opus-4-7 | $4.75 | $23.75 | $5.9375 | $9.5 | $0.475 |
Claude Opus 4.6 anthropic/claude-opus-4-6 | $4.75 | $23.75 | $5.9375 | $9.5 | $0.475 |
Claude Sonnet 4.6 anthropic/claude-sonnet-4-6 | $2.85 | $14.25 | $3.5625 | $5.7 | $0.285 |
Live from the catalog. Struck-through prices are Anthropic's official list prices. Prices are in USD per million tokens and exclude tax.
Long context
| Model | Input | Output | Cache write (5 min) | Cache write (1 h) | Cache read |
|---|---|---|---|---|---|
Claude Haiku 5.5 Requests with more than 100,000 input tokens are billed at these prices instead. | $0.45 | $2.25 | $0.5625 | $0.9 | $0.045 |
Prices are in USD per million tokens. Each price is below Anthropic's official list price for the same model; the struck-through number next to it is that official price. The table is live from the catalog (GET https://api.router.ezat.io/api/models), so it always shows the current prices.
A request is charged at the prices in force when it starts, for the tokens it used. Listing models and counting tokens are free.
What each column means
| Column | What it prices | Anthropic format usage | OpenAI format usage |
|---|---|---|---|
| Input | Input tokens that were not written to or read from the prompt cache | input_tokens | prompt_tokens minus cached_tokens and cache_write_tokens |
| Output | Every token the model generates, thinking included | output_tokens | completion_tokens |
| Cache write (5 min) | Input tokens written to the cache with the default 5-minute lifetime | cache_creation.ephemeral_5m_input_tokens | prompt_tokens_details.cache_write_tokens |
| Cache write (1 h) | Input tokens written to the cache with "ttl": "1h" | cache_creation.ephemeral_1h_input_tokens | Included in cache_write_tokens |
| Cache read | Input tokens read back from the cache | cache_read_input_tokens | prompt_tokens_details.cached_tokens |
cache_creation_input_tokensis the total of both cache writes. When a response doesn't split it, all of it is billed as 5-minute writes.- On the OpenAI-compatible API,
prompt_tokenscounts all input, cached or not. Prompt caching is automatic there, with 5-minute writes, socache_write_tokensare 5-minute writes unless you set a 1-hour breakpoint yourself. See Prompt caching. - A model without prompt caching (see the Features column on Models) bills all input at the input price.
Thinking tokens
Thinking tokens are output tokens and bill at the output price. On /v1/messages they are part of output_tokens. On the OpenAI-compatible API they are part of completion_tokens, and completion_tokens_details.reasoning_tokens says how many there were; the thinking text itself isn't returned.
Long-context tiers
Some models have a long-context tier, listed under Long context below the main table. The tier applies when a request's input is above the threshold shown (in GET /api/models, when it reaches the tier's minInputTokens, which is the threshold plus one). Input here means every input token: input_tokens plus cache writes plus cache reads.
When a request is above the threshold, the whole request is billed at the tier's prices, output and cache tokens included, not only the tokens past the threshold. A request at or below the threshold is billed entirely at the normal prices.
Work out the cost of a request
Multiply each token count by its price and divide by one million:
cost = ( input_tokens × Input
+ 5-minute cache writes × Cache write (5 min)
+ 1-hour cache writes × Cache write (1 h)
+ cache_read_input_tokens × Cache read
+ output_tokens × Output ) / 1,000,000Use the long-context prices instead when the request is above its model's threshold. Amounts are kept to 12 decimal places, so a small request costs a fraction of a cent.
This script makes a request, reads the prices from the public catalog and prints what the request cost:
import json
import os
import urllib.request
import anthropic
client = anthropic.Anthropic(base_url="https://api.router.ezat.io", api_key=os.environ["EZAT_API_KEY"])
message = client.messages.create(
model="anthropic/claude-sonnet-5-5",
max_tokens=64,
messages=[{"role": "user", "content": "Say hello in five words."}],
)
# Prices in USD per million tokens, from the public catalog (no key needed).
with urllib.request.urlopen("https://api.router.ezat.io/api/models") as response:
catalog = json.load(response)["data"]
name = message.model.lower() # the response echoes the id or alias you sent
pricing = next(m["pricing"] for m in catalog if name == m["id"] or name in m["aliases"])
usage = message.usage
written = usage.cache_creation_input_tokens or 0
written_1h = (usage.cache_creation.ephemeral_1h_input_tokens if usage.cache_creation else 0) or 0
tokens = {
"input": usage.input_tokens,
"cacheWrite5m": written - written_1h,
"cacheWrite1h": written_1h,
"cacheRead": usage.cache_read_input_tokens or 0,
"output": usage.output_tokens,
}
# Above a long-context threshold, the whole request uses that tier's prices.
prompt = tokens["input"] + written + tokens["cacheRead"]
prices = {field: pricing[field] for field in tokens}
for tier in sorted(pricing["longContext"], key=lambda tier: tier["minInputTokens"]):
if prompt >= tier["minInputTokens"]:
prices.update(tier["prices"])
cost = sum(count * float(prices[field]) for field, count in tokens.items()) / 1_000_000
print(tokens)
print(f"about {cost:.8f} USD")The script estimates with the catalog's prices. What a request was actually charged is on the dashboard's Usage page (https://router.ezat.io/usage), in the Cost column of Recent requests.
What isn't charged
- Requests refused before they reach a model: a missing or invalid key, an unknown model, a limit, or a zero balance.
- Requests that fail: the provider returns an error, no capacity is available, or the response stops with an error.
POST /v1/messages/count_tokens, and the model lists.
How billing works covers interrupted streams, which are charged for what was generated.
For AI agents
- Prices are in USD per million tokens. Read them from
GET https://api.router.ezat.io/api/models(pricing, withlongContexttiers) orhttps://docs.router.ezat.io/pricing.md. Never hard-code them. - Cost = Σ tokens × price / 1,000,000, over
input_tokens, both kinds of cache write,cache_read_input_tokensandoutput_tokens. - Thinking tokens are output tokens.
- If
input_tokens+ cache writes + cache reads is at least a tier'sminInputTokens, every component uses that tier's price. - On the OpenAI-compatible API, uncached input is
prompt_tokens−cached_tokens−cache_write_tokens.