Billing and routing

Token pricing

Token pricing is how AI APIs charge for their models: a price per million input tokens and another per million output tokens, so each call costs what it reads and writes.

Also called Per-token billing, Price per million tokens, Pay-as-you-go pricing

Checked November 29, 2026

At a glance

Unit
A price per 1M tokens
Priced apart
Input, cached input and output
Usually dearest
Output tokens
A call's cost
Input × input price + output × output price
On /model
The serving channel's prices, on the pricing page

A call's cost is its input tokens times the input price, plus its output tokens times the output price. Prices are quoted per million tokens, which Anthropic writes as MTok, and they differ from model to model (Anthropic). Output usually costs more than input, often several times more, and input read from a cache can be priced differently from other input (OpenAI).

What adds to a bill

  • The conversation so far: each request sends it again, so a long chat costs more input with every turn.
  • Reasoning tokens: billed as output, though you don't see them.
  • The cache: at Anthropic, writing to the cache costs more than plain input, and reading from it less (Anthropic). See prompt caching.
  • Long prompts: some models charge more per token past a length. See context window.
  • Server tools: some, such as web search, are charged per use on top of the tokens.

Token prices on /model

  • Every model is billed per token at the prices of the channel that served the request. Most models have several channels, each with its own price (Routing).
  • The pricing page lists every model's prices next to its maker's official price, with the discount.
  • A non-streaming response gives its charge in USD in the x-sm-cost-usd header; every charge, streamed or not, shows under Usage on your dashboard (Streaming).
  • A call's cost can rise a few minutes after it ends, if the provider bills it for more than we estimated, for example when a reply broke off before reporting its usage. Usage shows the final cost (Balance).
  • One-hour cache writes cost twice the channel's input price, as at Anthropic.

What does a day of Claude Code come to? Claude Code pricing works it out.

Where it applies on /model

Questions

How do I estimate what a request will cost?

Count its input tokens, guess the length of the answer, and multiply each by the model's price. On /model, POST /v1/messages/count_tokens counts the input, and the pricing page has the prices.

Why did the same request cost different amounts on /model?

A different channel served it, at a different price, or the cache was read one time and not the other. The x-sm-channel response header names the channel that served each request.

Sources

The makers' own pages, each opened on November 29, 2026.

One key for every model here.

Top up from $10, change one URL, and pay only for the tokens you use.