Claude Code spends most of its tokens re-reading. On every turn it sends the whole conversation again: the opening prompt, each file it has read, every tool result so far. Priced without caching, almost the whole bill is that re-reading. Caching changes this a lot, so the page shows both.
This page prices one session of a shape we picked for the example, on a range of models, at the rates in our catalog today. The figures are generated from those rates, so they change when the rates do.
The session has 40 turns. The first prompt is 12,000 tokens, and each turn adds 1,500 tokens to it: the model's last reply, whatever the tools returned, your next message. The model writes 700 tokens a turn.
Add it up and the session sends 1,650,000 input tokens and receives 28,000 output tokens. The last prompt is 70,500 tokens long. Of the input, 1,579,500 tokens are text the previous turn had already sent.
These are round numbers for the example, not a measurement of your usage. A session that edits two files in a small repo is shorter. One that reads a monorepo is longer. The arithmetic is the whole model: input on turn n is the opening prompt plus the growth from every turn before it, summed over all turns.
| Model | Per 1M tokens, in / out | Session, no caching | Session, cache reads |
|---|---|---|---|
| MiniMax M3 | $0.03 / $0.12 | $0.053 | $0.015 |
| Claude Haiku 5.5 | $0.10 / $0.50 | $0.179 | $0.037 |
| GLM-5.3-Flash | $0.15 / $0.50 | $0.262 | $0.072 |
| GPT-6.1 Terra | $0.50 / $2.50 | $0.895 | $0.145 |
| GLM-5.3 | $1.40 / $4.40 | $2.43 | $0.633 |
| Claude Sonnet 5.5 | $2 / $10 | $3.58 | $0.579 |
| Claude Opus 5.5 | $4 / $20 | $7.16 | $1.16 |
Prices are what each model bills at its most expensive hour of the day. “No caching” bills every input token at the input rate. “Cache reads” bills the tokens the previous turn already sent at the model’s published cached-input rate and leaves out any charge for writing the cache, so read it as the cheap end of the range.
Two things stand out.
Without caching, input is nearly all of the bill. On GLM-5.3 it is 95% of the uncached cost, and on Claude Sonnet 5.5 it is 92%. A model that writes more cheaply but reads at the same price barely moves the total.
The spread is wide. For this session Claude Opus 5.5 costs 2.0× what Claude Sonnet 5.5 does, and 27× what GLM-5.3-Flash does.
GLM-5.3 is not the cheap end of this list. Without caching, Claude Sonnet 5.5 costs only 1.5× what GLM-5.3 does, and MiniMax M3 is cheaper than both. If you came expecting one open model family to undercut everything else, the table says it is more mixed than that. Choose by the row, not by the maker. The same session ranked across every billed text model that can hold it is in Cheapest LLM API for Coding: Cost Per Session.
Claude Code asks for the front of its prompt to be cached. Where a model supports that, cached tokens bill at a lower cached rate, so a real bill can sit well below the no-caching column. The last column assumes every token the previous turn already sent is a cache read, which makes it the cheap end of the range. It leaves out any charge for writing the cache, and that differs by model. A real session lands between the two columns, and where depends on whether the cache is still warm between your turns.
For Claude Sonnet 5.5 the two columns are $3.58 and $0.579. Models with no published cached rate have no number in that column, because we would be guessing.
Caching also changes what the bill is made of. On Claude Sonnet 5.5, output is 48% of the cost with cache reads, against 8% without. Once re-reading is cheap, what the model writes matters more.
It can also reorder the table. With cache reads, GLM-5.3 costs 1.1× what Claude Sonnet 5.5 does, the reverse of the uncached order. The reason is the cached rate: Claude Sonnet 5.5 reads from cache at $0.10 per 1M tokens, GLM-5.3 at $0.26 per 1M tokens. If your sessions hit the cache often, compare the last column, not the first.
Claude Code needs a base URL, a bearer token, and a catalog model name for each of its three model tiers. By default it sends Anthropic-style model ids, which Openference rejects with a "model is not configured" error. Leaving the tier variables unset is the usual reason a first run fails.
export ANTHROPIC_BASE_URL="https://api.openference.com"
export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="GLM-5.3-Flash"
export ANTHROPIC_DEFAULT_SONNET_MODEL="GLM-5.3"
export ANTHROPIC_DEFAULT_OPUS_MODEL="Claude Opus 5.5"
Use ANTHROPIC_AUTH_TOKEN, not ANTHROPIC_API_KEY. Leave /v1 off the base URL: Claude Code adds /v1/messages itself. The Claude Code setup guide has the persistent settings.json form.
That mapping is an example, not a recommendation. It keeps a Claude model on the top tier for hard tasks and puts cheaper ones underneath. Swap in any name from the table. Claude Code decides which tier each call uses, so your cost lands somewhere between the cheapest and the dearest row, depending on how it splits the work.
A cost per session says nothing about whether the session finishes. A cheaper model that needs three attempts at a refactor costs more than a dear one that needs one. We do not publish a quality ranking here, and a table of costs is not a substitute for running your own task.
A fair test is to take one real task, run it on two models from the table, and compare the cost of the whole thing, retries included, not the cost of the first attempt. Every model in the table has a context window large enough for this session's last prompt, so length alone will not be what separates them.
Openference sells this two ways. A monthly plan covers an allowance across rolling windows: Minion is $20 a month and Boss is $80. Usage beyond the allowance bills as on-demand credits at the same catalog rates, and buying credits adds a 5% processing fee at checkout.
If you run a few sessions a week, credits alone may cost less than a plan, so multiply the table by your sessions and add the credit fee. If you run several a day, price it both ways. The pricing page lists what each plan's allowance covers. If you already route through another gateway, OpenRouter Alternatives: Fees and Same-Model Prices prices this same session on the gateways that publish a rate.
For one request rather than a session, see the cheap AI API page. For the model-by-model rates behind this table, see the model catalog. For the GLM models specifically, including plan limits, see the GLM coding plan page.
All guides are on the guides index.
Model catalog · Pricing · Comparisons · Cost guides · Integration guides · FAQ
Guides: GLM coding plan alternative · Free AI API · LLM gateway · LLM proxy · Cheap AI API · OpenAI-compatible API
Model APIs: GLM API · DeepSeek API · Kimi API · Qwen API · MiniMax API