YouMind
Sign in

What Claude Code costs on API billing, October 2026

@uplinkswitch
ENGLISHOct 17, 2026
122K
0
0
0
0

TL;DR

This article details the token-based pricing structure for using Claude Code via API keys, comparing list prices against discounted gateway rates. It explains how prompt caching affects costs, provides daily usage scenarios, and offers practical tips for reducing bills.

A Claude Code bill on an API key comes from three rates, each per million tokens: input, cached input and output. Claude Code sends the whole conversation again on every request, so most tokens in a session are the same tokens, read back from cache. The cached rate decides most of the bill.

The prices

Per million tokens, input / cached input / output:

  • Claude Opus 5.5: $2.10 / $0.12 / $6.00 here. Anthropic's list: $4.00 / $0.20 / $20.00
  • Claude Sonnet 5.5: $1.20 / $0.12 / $3.00 here. Anthropic's list: $2.00 / $0.20 / $10.00

One turn, worked

Take one turn late in a session: 80,000 tokens read from cache, 2,000 new input tokens and 1,500 output tokens.

  • Opus 5.5: $0.054 at list, $0.0228 here
  • Sonnet 5.5: $0.035 at list, $0.0165 here

Sonnet at list: 80,000 × $0.20 + 2,000 × $2.00 + 1,500 × $10.00, all per million, is $0.035.

When the cache expires

On an API key the prompt cache lasts five minutes by default. Step away for longer and the next request pays the input rate for the whole context: 82,000 input tokens plus 1,500 output. On Sonnet 5.5 that turn is $0.179 at list and $0.1029 here, about five times the cached turn.

A day of use

Each turn as above, every turn hitting the cache. The day sizes are assumptions, not measurements.

  • Light, 40 turns: Sonnet $1.40 at list, $0.66 here. Opus $2.16 at list, $0.912 here
  • Steady, 150 turns: Sonnet $5.25 at list, $2.475 here. Opus $8.10 at list, $3.42 here
  • Heavy, 400 turns: Sonnet $14.00 at list, $6.60 here. Opus $21.60 at list, $9.12 here

Twenty steady days on Sonnet 5.5: $105.00 at list, $49.50 here.

Setup

Two environment variables:

export ANTHROPIC_BASE_URL="https://api.uplinkswitch.com/v1"

export ANTHROPIC_AUTH_TOKEN="sk-uplink-live-..."

claude

Prompt caching works through the gateway, and cached input bills at the cached rate above. Claude Code's /usage figure is computed on your machine at Anthropic's list price; the charge for each request is in the UplinkSwitch console.

Lowering the bill

  • /clear between tasks, so the next request doesn't carry the last task's context
  • Haiku 5.5 for subagents and small edits
  • A shorter CLAUDE.md, since it rides in every request
  • Keep sessions moving: a turn after the five-minute cache expiry pays the input rate for the whole context

Full tables and sources: uplinkswitch.com/blog/claude-code-api-cost

One-click save

Use YouMind for AI deep reading of viral articles

Save the source, ask focused questions, summarize the argument, and turn a viral article into reusable notes in one AI workspace.

Explore YouMind
For creators

Turn your Markdown into a clean 𝕏 article

When you publish your own long-form writing, images, tables, and code blocks make 𝕏 formatting painful. YouMind turns a full Markdown draft into a clean, ready-to-post 𝕏 article.

Try Markdown to 𝕏

More patterns to decode

Recent viral articles

Explore more viral articles