Benchmarks tell you which model is smarter. They don't tell you what a working day in Claude Code or Codex CLI costs. So I priced one realistic agent session on four current models, at the official API rates, and showed my working.
Disclosure: I run Model.sale, a prepaid API gateway, so I also show what the same session costs there, including the cases where the official API is cheaper.
The session
A medium refactor in a coding agent:
| Tokens | Count | What it is |
|---|---|---|
| Fresh input | 150,000 | your prompts, newly read files, tool results |
| Cached input | 2,000,000 | the same context re-sent on every agent step |
| Output | 60,000 | code, explanations, tool calls |
That shape is typical. Agents re-send the whole conversation on every step, so cached input dwarfs everything else, and output is small.
Official prices for that session
Rates per 1M tokens (input / cached input / output), checked 2026-10-01 on the Anthropic and OpenAI pricing pages. Cache writes (Anthropic bills a 5-minute write at 1.25× input) are left out, which flatters Claude a little.
| Model | Rates | Session cost |
|---|---|---|
| Claude Opus 5.5 | $4 / $0.20 / $20 | 0.15×4 + 2×0.20 + 0.06×20 = $2.20 |
| Claude Sonnet 5.5 | $2 / $0.20 / $10 | $1.30 |
| GPT-6 Astra | $10 / $1 / $50 | 0.15×10 + 2×1 + 0.06×50 = $6.50 |
| GPT-6.1 Sol | $2 / $0.10 / $10 | $1.10 |
Two things stand out:
- GPT-6 Astra is the expensive one. Its cached-input rate is 5–10× the others, and agent sessions are mostly cached input.
- Opus 5.5 is not that much dearer than Sonnet 5.5 for agent work, because both charge $0.20 for cache reads. The gap is mostly output.
Why per-token prices mislead
The cheapest model per token is rarely the cheapest per finished task. If Sonnet needs three attempts where Opus needs one, Opus wins. The only number worth comparing is cost per finished task:
- Take five real tasks from your backlog (bug fix, small feature, refactor, tests, review).
- Run each on two models and count attempts until the tests pass.
- Sum the charges of all attempts.
The same session on a flat-rate gateway
Model.sale charges one rate per 1M "charged tokens", and cached input counts at 40%:
charged = fresh + output + 0.4 × cached
= 150,000 + 60,000 + 0.4 × 2,000,000 = 1,010,000
| Model | Rate | Session | vs official |
|---|---|---|---|
| claude-opus-5-5 | $1.40 | $1.41 | −36% |
| claude-sonnet-5-5 | $0.90 | $0.91 | −30% |
| gpt-6-astra | $1.125 | $1.14 | −82% |
| gpt-6.1-sol | $0.40 | $0.40 | −63% |
Where the official API wins: a flat rate makes output and fresh input cheap, but cached input relatively expensive. On a very cache-heavy, low-output workload the official API catches up. A small model like GPT-6 Luna costs ~$0.065 officially for this session and $0.08 on the gateway. Always run your own token mix through the numbers.
What I'd actually use
- Daily driver: Sonnet 5.5 in Claude Code, or GPT-6.1 Sol in Codex CLI.
- Escalate to Opus 5.5 when a task fails twice or needs real design judgment.
- GPT-6 Astra only for the hardest reasoning, where one right answer replaces several attempts.
Setup in one line
Both Claude Code and Codex only need a base URL and a key:
# Claude Code: Anthropic-compatible endpoint, no /v1
export ANTHROPIC_BASE_URL="https://api.model.sale"
export ANTHROPIC_AUTH_TOKEN="your-key"
claude
# Codex CLI, Cursor, Aider, OpenAI SDKs: OpenAI-compatible endpoint
export OPENAI_BASE_URL="https://api.model.sale/v1"
Put a daily spend limit on the key before an agent runs unattended. Opus burns budget fastest in long loops.
The full write-up with live prices and the cost calculator is on the Model.sale blog. How do your own sessions break down between fresh, cached and output tokens? I'd like to compare notes in the comments.
Top comments (0)