trelvane
100% Free Forever 100% Private · Inputs Never Saved No Sign-Up Required

AI LLM Token Counter & Production API Cost Calculator

Paste any prompt, JSON schema, or code snippet to count BPE subword tokens and compare live per-call, per-1K, and monthly DAU production costs across 11 frontier LLM APIs—including Prompt Caching and Batch API discounts.

Live BPE: 125 tokens · 47 words · 354 chars (2.83 chars/tok)
Override Input Tokens:
Quick Sample Scenario:
Calculating...
Monthly Production API Bill (45,000 Calls/Mo)
$421.88/ mo$0.00937 / call · $9.38 / 1K calls
Tokens/Call: 125 in + 600 outContext Used: 0.36% of 200K
All 11 Frontier Models Side-by-Side (45,000 Calls/Mo)
ModelPer 1K CallsMonthly Bill
Claude 4 Sonnet($3/$15)$9.38$421.88
GPT-5 / 4.1($2/$8)$5.05$227.25
GPT-4o($2.5/$10)$6.31$284.06
GPT-4o mini($0.15/$0.6)$0.38$17.04
OpenAI o3-mini($1.1/$4.4)$2.78$124.99
Claude 4 Opus($15/$75)$46.88$2,109.38
Claude 3.5 Haiku($0.8/$4)$2.50$112.50
Gemini 2.5 Pro($1.25/$10)$6.16$277.03
Gemini 2.5 Flash($0.15/$0.6)$0.38$17.04
DeepSeek R1($0.27/$1.1)$0.69$31.22
Llama 4 70B($0.59/$0.79)$0.55$24.65
Caching 75% of repeated system prompts saves $11.39/mo!

Specialized LLM API Pricing & Prompt Caching Calculators

2026 Frontier LLM API Pricing & Context Window Comparison Table ($ / 1M Tokens)

Model Provider Input ($/1M) Cached Input ($/1M) Output ($/1M) Context Window
Anthropic Claude 4 Sonnet / 3.7 Sonnet Anthropic $3.00 $0.300 $15.00 200K
OpenAI GPT-5 / GPT-4.1 Flagship OpenAI $2.00 $0.500 $8.00 1,000K
OpenAI GPT-4o Multimodal OpenAI $2.50 $1.250 $10.00 128K
OpenAI GPT-4o mini (High-Speed) OpenAI $0.15 $0.075 $0.60 128K
OpenAI o3-mini / o4-mini (Reasoning) OpenAI $1.10 $0.275 $4.40 200K
Anthropic Claude 4 Opus Anthropic $15.00 $1.500 $75.00 200K
Anthropic Claude 3.5 Haiku Anthropic $0.80 $0.080 $4.00 200K
Google Gemini 2.5 Pro (2M Context) Google $1.25 $0.310 $10.00 2,000K
Google Gemini 2.5 Flash (1M Context) Google $0.15 $0.037 $0.60 1,000K
DeepSeek R1 / V3 Reasoning API DeepSeek $0.27 $0.070 $1.10 128K
Meta Llama 4 70B / 405B (Groq / Together) Meta / Cloud $0.59 $0.200 $0.79 128K

Frequently Asked Questions

How does an LLM tokenizer split text, JSON, and code into BPE tokens? ▾

Modern Large Language Models (OpenAI o200k_base, Anthropic Claude, Google Gemini) use Byte-Pair Encoding (BPE). In English prose, 1 token averages ~4 characters (~0.75 words). However, in JSON, Python, and TypeScript code, punctuation symbols ({}[](),:;), numbers, and camelCase identifiers split into additional subword tokens—which our lexer-based BPE estimator models automatically.

How much does Prompt Caching reduce monthly LLM API bills? ▾

Prompt Caching discounts repeated system prompts, tool schemas, and RAG documents by 50% to 75% on OpenAI and Google Gemini, and by 90% on Anthropic Claude ($0.30/1M vs. $3.00/1M on Claude Sonnet).

Are internal "Thinking / Reasoning" tokens billed as input or output tokens? ▾

Reasoning models (such as OpenAI o3-mini / o4-mini, Claude Extended Thinking, and DeepSeek R1) bill internal chain-of-thought reasoning tokens at the model’s output token rate.