A price table gives you two numbers per model, one for input and one for output, and leaves you to guess which one matters. For a coding agent it is usually the input price, because the agent sends the whole conversation back on every turn. Sorting by the wrong column gives you a different list of "cheapest" models than the one you will pay for.
This page ranks models by what one agent session costs. It also shows where that ranking disagrees with the two simpler ones, and what none of the rankings tell you.
The session is 40 turns. It starts with a prompt of 12,000 tokens that grows by 1,500 tokens a turn, and the model writes 700 tokens a turn. In all that is 1,650,000 input tokens against 28,000 output tokens. The Claude Code guide shows the arithmetic and the effect of caching.
Input outweighs output by a wide margin, and the share hardly depends on the model. Across all 50 billed text models in the catalog, input is 89% to 98% of an uncached session's cost. On Gemma 4 26B, the cheapest for this session, it is 95%. On Claude Opus 5.5, which ranks #42 of 50, it is 92%.
| Rank | By input price | By output price | By session cost |
|---|---|---|---|
| #1 | Gemma 4 26B | Gemma 4 26B | Gemma 4 26B |
| #2 | GPT-OSS 20B | GPT-OSS 20B | GPT-OSS 20B |
| #3 | Llama 4 Scout | GPT-OSS 120B | Llama 4 Scout |
| #4 | MiniMax M3 | Llama 4 Scout | MiniMax M3 |
| #5 | GPT-OSS 120B | MiniMax M3 | GPT-OSS 120B |
| #6 | Qwen3.8 27b | Qwen3.8 Flash | Qwen3.8 27b |
| #7 | GPT-6 Luna | GPT-6 Luna | GPT-6 Luna |
| #8 | GLM-4.7-Flash | Hy4 Flash | GLM-4.7-Flash |
Same models, same session, same prices at each model’s most expensive hour of the day, with no caching. The columns differ only in what they sort by.
Sort by input price and the eight cheapest models are the same eight that are cheapest for the session: the overlap is 8 of 8. Sort by output price, the number many comparison tables put first, and the overlap with the session ranking is 6 of 8. The models that appear only in the output-price column have a lower output price than the models they displace, and a higher input price. They look cheap on a table and cost more once the agent starts re-reading.
| Rank | Model | Per 1M tokens, in / out | Session, no caching |
|---|---|---|---|
| #1 | Gemma 4 26B | $0.01 / $0.03 | $0.017 |
| #2 | GPT-OSS 20B | $0.02 / $0.03 | $0.034 |
| #3 | Llama 4 Scout | $0.027 / $0.085 | $0.047 |
| #4 | MiniMax M3 | $0.03 / $0.12 | $0.053 |
| #5 | GPT-OSS 120B | $0.035 / $0.075 | $0.06 |
| #6 | Qwen3.8 27b | $0.045 / $0.32 | $0.083 |
| #7 | GPT-6 Luna | $0.05 / $0.25 | $0.089 |
| #8 | GLM-4.7-Flash | $0.06 / $0.40 | $0.11 |
| #9 | Hy4 Flash | $0.063 / $0.2529 | $0.111 |
| #10 | Qwen3.8 Flash | $0.075 / $0.235 | $0.13 |
| For reference | |||
| #17 | DeepSeek V4.1 Flash | $0.30 / $1.20 | $0.529 |
| #36 | GLM-5.3 | $1.40 / $4.40 | $2.43 |
| #38 | Claude Sonnet 5.5 | $2 / $10 | $3.58 |
| #42 | Claude Opus 5.5 | $4 / $20 | $7.16 |
Ranked among the 50 billed text models that can hold this session, at each model’s most expensive hour of the day, with no caching. The cheapest model for the money is not the one that finishes your task: cost here says nothing about quality.
The cheapest model for this session is Gemma 4 26B. Whether a model that cheap can finish your task is a different question, and one a price table cannot answer. A session that fails and gets rerun on a larger model costs more than going straight to the larger one.
The models under "For reference" are ones we picked, not a quality ranking. They all sit below the top ten in the cost order: DeepSeek V4.1 Flash is #17 of 50, GLM-5.3 is #36 of 50, Claude Sonnet 5.5 is #38 of 50, and Claude Opus 5.5 is #42 of 50. "Cheapest" is the wrong goal. A better one is the cheapest model that does your task, and you find that by trying two or three.
A model's price also depends on where you buy it. DeepSeek V4.1 Flash is a useful case, because several gateways publish a rate for it.
| Gateway | Per 1M tokens, in / out | Session | Against Openference | Rates read |
|---|---|---|---|---|
| Avian | $0.1275 / $0.51 | $0.225 | 57% less | 19 November 2026 |
| Vercel AI Gateway | $0.15 / $0.60 | $0.264 | 50% less | 19 November 2026 |
| AZET | $0.2425 / $0.9702 | $0.427 | 19% less | 19 November 2026 |
| Openference | $0.30 / $1.20 | $0.529 | — | live catalog |
Each competitor’s rates are as that gateway publishes them on the date shown, linked from its name. Openference’s are read from the live catalog at the most expensive hour of the day. Rows are ordered by session cost, so a gateway that is cheaper than Openference for this model appears above it.
For this model the tally is 3 of 3: every other gateway that publishes a rate prices the session below Openference. If this one model is your whole workload and price is the only criterion, the table points to a different gateway. What Openference sells instead is a catalog and a plan. Minion is $20 a month and Boss is $80, each with an allowance, and use beyond that bills as credits at the catalog rates. The OpenRouter alternatives guide looks at gateway fees, and at a model where the answer comes out the other way.
To check a model's rate, open it in the model catalog. For the rest of the catalog's prices in one place, see the cheap AI API 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