TOKEN & COST UTILITY

LLM Token Counter & Prompt Caching Cost Calculator

Paste representative prompt text—or enter a measured input token count—to compare single-request and 30-day API spend across OpenAI, Anthropic, Google Gemini, and xAI Grok with prompt caching and long-context tiers.

ExecutionZero login · 100% browser-localModel Plaza rates checked November 11, 2026
01

Live token counter and multi-model cache cost comparison

Paste a real prompt or override total input tokens to compare per-request and 30-day monthly spend across active models with prompt caching.

Estimated input tokens192
Uncached / cache read77 / 115
Characters / lines767 / 9
Words / CJK chars121 / 0
ModelActive tierPer request (LLMFly AI)30-day cost (LLMFly AI)Vendor reference (30d)Estimated 30d savings
GPT-6 Astragpt-6-astra · 0.3x≤272K$0.012266$367.97$1,226.55$858.58
GPT-6.1 Solgpt-6.1-sol · 0.3x≤272K$0.00245$73.49$244.97$171.48
GPT-6 Solgpt-6-sol · 0.3x≤272K$0.002453$73.59$245.31$171.72
GPT-6.1 Terragpt-6.1-terra · 0.3x≤272K$0.001225$36.74$122.48$85.74
GPT-5.6 Solgpt-5.6-sol · 0.3x≤272K$0.007333$219.98$733.28$513.29
GPT-5.6 Terragpt-5.6-terra · 0.3x≤272K$0.002933$87.99$293.31$205.32
Codex Auto Reviewcodex-auto-review · 0.3x≤272K$0.000293$8.80$29.33$20.53
Gemini 4 Argongemini-4-argon · 0.4xSingle rate$0.003266$97.99$244.97$146.98
Gemini 2.5 Progemini-2.5-pro · 0.4x≤200K$0.003244$97.33$243.32$145.99
Gemini 3.8 Flashgemini-3.8-flash · 0.4xSingle rate$0.001227$36.80$91.99$55.19
Gemini 3.7 Flashgemini-3.7-flash · 0.4xSingle rate$0.001227$36.80$91.99$55.19
Gemini 3.6 Flashgemini-3.6-flash · 0.4xSingle rate$0.001227$36.80$91.99$55.19
Gemini 3 Flash Previewgemini-3-flash-preview · 0.4xSingle rate$0.000978$29.33$73.33$44.00
Gemini 2.5 Flashgemini-2.5-flash · 0.4xSingle rate$0.000811$24.32$60.80$36.48
Grok 4.7grok-4.7 · 0.4x<200K$0.002005$60.14$150.35$90.21
Grok 4.6grok-4.6 · 0.4x<200K$0.002005$60.14$150.35$90.21
Grok 4.5grok-4.5 · 0.4x<200K$0.001995$59.86$149.66$89.79
Claude Fable 5.2claude-fable-5-2 · 0.5xSingle rate$0.01632$489.59$979.17$489.59
Claude Opus 5.5claude-opus-5-5 · 0.5xSingle rate$0.008166$244.97$489.93$244.97
Claude Opus 5claude-opus-5 · 0.5xSingle rate$0.010221$306.64$613.28$306.64
Claude Fable 5.1claude-fable-5-1 · 0.5xSingle rate$0.020399$611.98$1,223.96$611.98
Claude Fable 5claude-fable-5 · 0.5xSingle rate$0.020443$613.28$1,226.55$613.28
Claude Opus 4.8claude-opus-4-8 · 0.5xSingle rate$0.010221$306.64$613.28$306.64
Claude Opus 4.7claude-opus-4-7 · 0.5xSingle rate$0.010221$306.64$613.28$306.64
Claude Opus 4.6claude-opus-4-6 · 0.5xSingle rate$0.010221$306.64$613.28$306.64
Claude Opus 4.5 (2025-11-01)claude-opus-4-5-20251101 · 0.5xSingle rate$0.010221$306.64$613.28$306.64
Claude Sonnet 5.5claude-sonnet-5-5 · 0.5xSingle rate$0.004083$122.48$244.97$122.48
Claude Sonnet 5claude-sonnet-5 · 0.5xSingle rate$0.004089$122.66$245.31$122.66
Claude Sonnet 4.6claude-sonnet-4-6 · 0.5xSingle rate$0.006133$183.98$367.97$183.98
Claude Sonnet 4.5claude-sonnet-4-5 · 0.5xSingle rate$0.006133$183.98$367.97$183.98
Claude Haiku 5.5claude-haiku-5-5 · 0.5x≤100K$0.000204$6.13$12.27$6.13
Claude Haiku 4.5claude-haiku-4-5 · 0.5xSingle rate$0.002044$61.33$122.66$61.33

Note: Exact subword tokenization varies by model family (for example, Claude 5 and GPT-6 token counts can differ by 10%–30% on identical text). Models without a published cache-read rate fall back to uncached input pricing.

02

Engineering reference and rollout checks

How subword tokenization differs across English, code, and CJK text

Modern BPE tokenizers (such as OpenAI's o200k_base family, Anthropic's Claude 5 tokenizer, and SentencePiece-based Gemini vocabularies) split text into byte or character subwords rather than whitespace words. Plain English prose averages roughly 3.8 to 4.2 characters per token, whereas JSON keys, indentation, stack traces, and URLs introduce punctuation boundaries that push density closer to 2.5 to 3.2 characters per token.

Chinese, Japanese, and Korean scripts encode fewer characters per token—typically 0.6 to 1.1 tokens per character depending on vocabulary coverage—and Anthropic's newer Claude 5 tokenizer can produce up to 25%–30% more tokens than older Sonnet 4.6 vocabularies on dense code or multilingual inputs.

Input content typeTypical token densityBudgeting recommendation
Plain English prose~0.75 tokens / word (~4 chars / token)Safe for initial sizing; add 10% headroom
TypeScript / Python / JSON schemas1 token per 2.5–3.3 charactersMinify repeated tool schemas and strip comments
Chinese / Japanese / Korean (CJK)~0.7–1.1 tokens per characterVerify exact usage.prompt_tokens on one real call
Multi-turn agent transcriptsCompounds on every tool turnPlace static instructions first to maximize cache reads

Why long-context thresholds and prompt caching dominate real API bills

Comparing headline per-million input rates is misleading whenever requests cross a provider's long-context cliff. On GPT-6 Astra, GPT-6.1 Terra, and the GPT-5.6 family, crossing 272,000 total input tokens (including cached prefix tokens) switches the entire request to the higher >272K tier. Similarly, Grok 4.7 and Gemini 2.5 Pro step up at 200,000 input tokens, and Claude Haiku 5.5 steps up above 100,000 input tokens.

Conversely, keeping your system prompt, tool definitions, and reference documents byte-identical at the start of every request unlocks prompt-cache read discounts—often 75% to 90% below uncached input rates. Use the cache-hit slider above to model how prefix stability changes your 30-day run rate.

  • Keep static instructions, JSON schemas, and few-shot examples in a deterministic prefix; append timestamps or user-specific variables at the end.
  • Deduplicate RAG chunks before concatenation so an extra passage does not push a 265K prompt over the 272K billing cliff.
  • Include cache-write warm-up overhead and retry rates when estimating bursty batch jobs with low prefix reuse.

Frequently asked questions

Why do cached tokens still count toward long-context pricing tiers?

Providers select the pricing tier from total prompt context processed in a single request (uncached input + cache writes + cache reads). Cache reads reduce the per-token rate within that tier, not the context length.

Why do some models show the same cost at 0% and 60% cache hit ratio?

If Model Plaza does not publish a separate cache-read price for a route, the calculator conservatively bills all input tokens at the uncached input rate rather than assuming an unlisted discount.

How do I measure the exact token count for my chosen model?

Send one non-streaming test request with your production prompt and read usage.prompt_tokens and usage.completion_tokens from the API response.

Validate your estimate against a live usage record

Create a key in LLMFly AI, send one representative prompt, and compare recorded tokens with your budget.

Open Model Plaza