
Tokens Explained: Why AI Coding Costs What It Costs
Tokens are the unit behind every AI bill. Understanding how they're counted — and what consumes them invisibly — turns billing anxiety into control.
Every AI coding bill ultimately reduces to one unit: tokens. Plans cap them, usage bills multiply them, rate limits throttle them. Yet most people using these tools daily have never seen a token defined precisely — which is why invoices surprise them. The concept takes five minutes to learn and permanently changes how you read both pricing pages and your own sessions.
What a token actually is
Models don't read words; they read tokens — chunks of text a few characters long, produced by breaking language into statistically convenient pieces. English averages roughly four characters per token; code varies more because symbols and identifiers fragment differently. A typical paragraph runs a hundred-ish tokens; an entire source file might be thousands. Everything downstream — context windows, per-request costs, subscription allowances — is denominated in these units.
Connect the Claude or Codex you already pay for — the rest runs on workers that cost a fraction.
Download meshcode →Why sessions cost more than they feel like they should
The non-obvious part: models have no memory between calls. Every request re-sends relevant history — instructions, conversation, previously read files — so a long session pays repeatedly for its own past. Late-session requests carry far larger inputs than early ones even when you type little, because accumulated context rides along each time. This compounding explains bills that feel disproportionate to visible activity. Hidden baseline overhead compounds it further; see token overhead before your first prompt.
Where coding work concentrates spend
Agentic sessions spend tokens in predictable places. Reading source files dominates exploration-heavy tasks. Re-reading unchanged files wastes spend that caching or discipline could save. Long outputs cost proportionally — generating boilerplate is expensive, editing precisely is cheap. And verification loops (run tests, read failures, retry) multiply everything by attempt count. None of these are reasons to avoid agents; they're levers for steering spend toward value.
Subscription versus metered, revisited with tokens in mind
Flat plans convert variable token consumption into predictable fees plus limits — good for budgeting, frustrating when heavy weeks hit caps. Metered billing passes raw consumption through — efficient for disciplined users, anxiety-inducing without visibility. Neither dominates; matching depends on how spiky your usage is and how much you trust your own scoping habits. Practical comparisons appear in guides to prepaid credits versus subscriptions.
Habits that measurably reduce spend
Scope tasks tightly so agents read less irrelevant code. Commit frequently so recovery restarts don't replay whole histories. Prefer targeted edits over wholesale regeneration. Start fresh sessions when conversations bloat rather than pushing through degradation. Match model weight to task difficulty — frontier models on trivia is burning money politely. Together these habits routinely cut effective spend substantially, which is why they recur throughout guides like reducing Claude Code token usage.
Reading pricing pages correctly
Armed with tokens, pricing pages decode cleanly: context window sizes tell you how much fits per request, input-versus-output rates reveal which behaviors dominate cost, cache discounts reward repetitive prefixes, and free tiers reveal their real size once you imagine your heaviest session measured in tokens. Vendors aren't hiding anything — the units were simply unfamiliar.
The meshcode angle
Token economics favor setups where you watch spend while working instead of discovering it at invoice time. meshcode runs your choice of models — including ones billed through subscriptions you already hold or metered pay-as-you-go credits — across parallel panes, so scoping decisions happen where their consequences are visible. Download and bring existing access to start.
👉 Download meshcode — Mac, Windows
More from the blog
Windsurf Pricing in 2026 — and Cheaper Ways to Get the Same Work Done
What Windsurf's tiers actually include, how usage limits behave, and the alternative arrangements that often cost less for the same output.
The Cheapest Way to Use GPT-6 Astra in 2026
GPT-6 Astra's $10 input rate is only one of four prices — cache writes, output, and the 272K-token multiplier all move the bill. Here's the cheapest way to run Astra on real coding work.
The Cheapest Way to Use Gemini CLI in 2026
Gemini CLI's free tier is one of the most generous in AI coding, with Google AI Pro and per-token API billing above it. Here's what each shape costs and how to keep routine work off your most expensive tokens.