Short answer
A regular developer running 20 agent sessions a day (about 50,000 input and 20,000 output tokens each, 22 working days) spends about $198 a month on Claude Sonnet 4.6 at official API prices and about $75.81 through APIVAI, before prompt caching (prices as of 2026-10-10).
Subscriptions for Claude Code, Cursor and Codex CLI charge a fixed monthly fee with usage limits instead. If your monthly per-token figure is below your plan's price, or you keep hitting plan limits, a per-token key is usually the better deal.
What are Claude Code, Cursor and Codex CLI?
- Claude Code is Anthropic's terminal coding agent. It reads your repository, edits files and runs commands. You can use it with a Claude subscription plan or with an API key billed per token (docs).
- Cursor is an AI code editor built on VS Code. Its own plans bundle a monthly fee with usage limits; you can also add your own OpenAI-compatible API key and custom models.
- Codex CLI is OpenAI's open-source terminal agent. It can sign in with a ChatGPT plan or use an API key billed per token, and it can point at any OpenAI-compatible provider.
All three can be billed two ways: a subscription (fixed monthly fee, usage limits that reset over time) or your own API key (no cap, you pay for every token). Plans and limits change often, so check Claude plans, Cursor pricing and ChatGPT plans for current terms.
Why do coding agents use so many tokens?
A chat message is a few thousand tokens. An agent session is much more, because the model has no memory between turns: on every step the tool resends the system prompt, tool definitions, the files it has read and the conversation so far. A task that takes 15 steps can resend the same 30,000 tokens of context 15 times. Output is smaller but more expensive per token, and it includes code edits, plans and command calls.
Prompt caching reduces this. When the start of a request matches a recent one, the provider reads it from cache at a much lower rate than fresh input. Claude Code and Codex CLI are designed to keep their context stable so caching works well. On APIVAI, cache reads are billed at $0.12 per 1M tokens for Claude Sonnet 4.6, compared with $1.15 for normal input. The tables below assume no caching, so treat them as an upper bound.
How much does each profile cost per day and per month?
Assumptions for all tables: each session uses about 50,000 input and 20,000 output tokens, and a month has 22 working days. Prices as of 2026-10-10; see /pricing for the live list.
Light user: 5 sessions a day
| Model | Official daily | APIVAI daily | Official monthly | APIVAI monthly |
|---|---|---|---|---|
| Claude Sonnet 4.6 | $2.25 | $0.862 | $49.50 | $18.95 |
| Claude Sonnet 5.5 | $1.50 | $0.575 | $33.00 | $12.64 |
| Claude Opus 5.5 | $3.00 | $1.15 | $66.00 | $25.30 |
| GPT-5.5 | $4.25 | $0.648 | $93.50 | $14.27 |
Regular user: 20 sessions a day
| Model | Official daily | APIVAI daily | Official monthly | APIVAI monthly |
|---|---|---|---|---|
| Claude Sonnet 4.6 | $9.00 | $3.45 | $198 | $75.81 |
| Claude Sonnet 5.5 | $6.00 | $2.30 | $132 | $50.56 |
| Claude Opus 5.5 | $12.00 | $4.60 | $264 | $101 |
| GPT-5.5 | $17.00 | $2.59 | $374 | $57.07 |
Heavy user: 60 sessions a day
| Model | Official daily | APIVAI daily | Official monthly | APIVAI monthly |
|---|---|---|---|---|
| Claude Sonnet 4.6 | $27.00 | $10.34 | $594 | $227 |
| Claude Sonnet 5.5 | $18.00 | $6.89 | $396 | $152 |
| Claude Opus 5.5 | $36.00 | $13.80 | $792 | $304 |
| GPT-5.5 | $51.00 | $7.78 | $1,122 | $171 |
Your own numbers will differ. Long refactors on a large repository can use far more than 50,000 input tokens per session, while quick fixes use less. The APIVAI Dashboard shows every request with its tokens and cost, so after a week you can replace these assumptions with your real figures.
Should you pay for a subscription or a per-token key?
Compare two things: the monthly figure for your profile above, and the price and limits of the plan you are considering.
- A subscription fits when your per-token figure would clearly exceed the plan's price and you rarely hit its usage limits. You get a predictable bill.
- A per-token key fits when your usage is light or uneven, when your monthly figure is below the plan's price, or when you keep running into plan limits and waiting for them to reset. You pay only for what you use and nothing on days you do not code.
- Both together is also common: keep a plan for daily work and use a per-token key for overflow, for a second tool, or for models the plan does not include.
Plan limits are often described in messages or usage windows rather than tokens, so they are hard to compare directly. Check the current terms on the Claude, Cursor and ChatGPT pricing pages. For a wider look at per-token options, see the Claude API pricing comparison.
For Claude Code on its own, Claude Code without a subscription compares the Pro and Max plans with per-token billing. It counts usage in hours of active work (about 40 requests of 40,000 input and 1,000 output tokens per hour), so its regular profile of one hour per working day rests on different assumptions than the 20 sessions a day used here.
How can you cut the cost of a coding agent?
- Pick the model per task. Use a Sonnet model for everyday edits and switch to Claude Opus 5.5 only for hard debugging or design work. In Claude Code, switch with
/model. - Let caching work. Keep long sessions on one task instead of restarting often, so repeated context is billed at the cache rate.
- Keep context short. Point the agent at the files that matter, and exclude build output, lock files and large data from what it reads.
- Compact long sessions. Claude Code has a
/compactcommand that summarizes the conversation so far, which usually shrinks the context resent on later turns. Behavior may change between versions; see the Claude Code docs. - Set a budget per key. On APIVAI each key can have its own budget, which helps when a tool or teammate runs more than expected.
How do you set up each tool with a per-token key?
Claude Code (Anthropic format, no /v1):
# Mac/Linux export ANTHROPIC_BASE_URL="https://api.apivai.com" export ANTHROPIC_AUTH_TOKEN="your-key" unset ANTHROPIC_API_KEY # it takes priority if set claude
# Windows PowerShell $env:ANTHROPIC_BASE_URL="https://api.apivai.com" $env:ANTHROPIC_AUTH_TOKEN="your-key" Remove-Item Env:ANTHROPIC_API_KEY -ErrorAction SilentlyContinue claude
Codex CLI (0.121+), in ~/.codex/config.toml, with your key in the OPENAI_API_KEY environment variable:
model = "gpt-5.5" model_provider = "apivai" [model_providers.apivai] name = "APIVAI" base_url = "https://api.apivai.com/v1" env_key = "OPENAI_API_KEY" wire_api = "responses"
Cursor: open Settings > Models, turn on Override OpenAI Base URL and set it to https://api.apivai.com/v1, paste your APIVAI key as the OpenAI API key, then add model IDs such as claude-sonnet-4-6 as custom models.
Full walkthroughs: Claude Code setup guide and Cursor setup guide. If you get a 404, check the base URL: Claude Code must not include /v1, while Cursor and Codex CLI need it exactly once.
FAQ
Which is cheapest: Claude Code, Cursor or Codex CLI?
With a per-token key, the tool matters less than the model and how much context you send. The same model costs the same per token in any of the three tools; the tables above show the difference between models.
Are these monthly figures what I will actually pay?
They are an upper bound for the stated assumptions, because they ignore prompt caching. Real agent sessions reuse a lot of context, so cached input usually brings the bill down.
Can I use one APIVAI key for all three tools?
Yes. Claude Code uses the Anthropic format at https://api.apivai.com, and Cursor and Codex CLI use the OpenAI format at https://api.apivai.com/v1. You can also create a separate key with its own budget for each tool.
Is there a monthly fee or minimum?
No. APIVAI uses a prepaid balance with no subscription and no monthly minimum. The minimum top-up is $10 by card or crypto, or ¥20 via Alipay or WeChat Pay.
Does the Cursor subscription still matter if I bring my own key?
Some Cursor features may depend on its own plan, and the rules for custom keys can change. Check Cursor's pricing page for what your key covers.