Cross-provider cost planning

Token Cost Calculator: OpenAI, Claude, Gemini & DeepSeek

Enter one request size, then see every major model priced side by side — sorted from cheapest to most expensive, with a monthly forecast built in.

Count Tokens Locally

What is a token, and how much does one cost?

A token is the small chunk of text a model actually reads and generates — roughly 4 characters, or about 0.75 of an English word, though the exact split depends on the provider's own tokenizer. That rule of thumb means 1,000 words of plain English usually comes out to somewhere around 1,300-1,500 tokens, a bit more for technical writing, and noticeably more for code, JSON, or non-English text, since those tokenize less efficiently.

On its own, a single token costs a tiny fraction of a cent — providers price per million tokens, not per token, so the real question is what a request, or a month of requests, adds up to. A short message like "Hello, how are you?" is usually 6-7 tokens. A typical email runs 200-400 tokens. An article like this one runs 1,000-3,000 tokens. None of that is expensive on its own; it's multiplying by thousands or millions of calls that turns tokens into a real line item, which is exactly what the calculator below does for you.

Every provider counts slightly differently, so the same text can come out to a different token count on OpenAI's tokenizer versus Anthropic's or Google's. Treat any token count as a close estimate for planning, not an exact figure to bill against.

How to use this calculator

  1. Pick a preset close to your workload below, or enter your own input, cached-read, and output token counts.
  2. Set how many requests you expect per month — this turns a single-request price into a real monthly budget.
  3. Read the three summary cards for the cheapest, best-value, and most expensive model at that size.
  4. Scroll to the full table to compare every model side by side, or filter down to one provider.
  5. Use "Share this estimate" to send the exact numbers to a teammate — no sign-up, nothing is stored.

Estimate cost across all six providers

Enter a request pattern, or start from an example workload below.

Not sure how long the reply will be? Set output as a share of input:
Currency:

Prices convert live in your chosen currency (approximate FX). Share copies a link that reopens this exact estimate for anyone you send it to.

Reasoning tokens (used by thinking models before the visible answer) are billed at each model's output rate. Token counts are estimates — every provider's tokenizer counts slightly differently, so treat these as close, not exact.

Lowest estimate
$0.0003
Gemini 2.5 Flash-Lite
Best value
$0.0016
DeepSeek V4 Pro
Highest estimate
$0.0990
GPT-5.5 Pro

"Best value pick" compares capable, general-purpose models rather than the absolute cheapest lite tier — useful when quality matters as much as price.

Every model, ranked by monthly cost

Sorted lowest to highest for this request size. Cache writes, storage, Batch, Flex, Priority, tools, media charges, and Perplexity's per-request search fee aren't included.

Input
$0.10
Cache read
$0.010
Output
$0.40
Per 1M reqs
$0.0344
Context1,048K / 65K
Total$0.0003
Input
$0.22
Cache read
$0.007
Output
$0.66
Per 1M reqs
$0.0664
Context1M / 384K
Total$0.0005
Input
$0.22
Cache read
$0.007
Output
$0.66
Per 1M reqs
$0.0664
Context1M / 384K
Total$0.0005
Input
$0.20
Cache read
$0.020
Output
$1.20
Per 1M reqs
$0.0838
Context1,050K / 128K
Total$0.0007
Input
$0.20
Cache read
$0.020
Output
$1.25
Per 1M reqs
$0.0856
Context400K / 128K
Total$0.0007
Input
$0.25
Cache read
$0.025
Output
$1.50
Per 1M reqs
$0.1047
Context1,048K / 65K
Total$0.0008
Input
$0.30
Cache read
$0.030
Output
$2.50
Per 1M reqs
$0.1519
Context1,048K / 65K
Total$0.0012
Input
$0.30
Cache read
$0.030
Output
$2.50
Per 1M reqs
$0.1519
Context1,048K / 65K
Total$0.0012
Input
$0.66
Cache read
$0.022
Output
$1.98
Per 1M reqs
$0.1994
Context1M / 384K
Total$0.0016
Perplexity
Input
$1.00
Cache read
n/a
Output
$1.00
Per 1M reqs
$0.2250
Context127K
Total$0.0018
Input
$1.00
Cache read
$0.200
Output
$2.00
Per 1M reqs
$0.2750
Context256K
Total$0.0022
Input
$0.75
Cache read
$0.075
Output
$3.75
Per 1M reqs
$0.2859
Context1,048K / 65K
Total$0.0023
Input
$0.75
Cache read
$0.075
Output
$3.75
Per 1M reqs
$0.2859
Context1,048K / 65K
Total$0.0023
Input
$0.75
Cache read
$0.075
Output
$3.75
Per 1M reqs
$0.2859
Context1,048K / 65K
Total$0.0023
Input
$0.75
Cache read
$0.075
Output
$4.50
Per 1M reqs
$0.3141
Context400K / 128K
Total$0.0025
Input
$1.25
Cache read
$0.200
Output
$2.50
Per 1M reqs
$0.3406
Context1M
Total$0.0027
Input
$1.00
Cache read
$0.100
Output
$5.00
Per 1M reqs
$0.3812
Context200K / 64K
Total$0.0031
Input
$1.25
Cache read
$0.125
Output
$10.00
Per 1M reqs
$0.6172
Context1,048K / 65K
Total$0.0049
Input
$1.50
Cache read
$0.150
Output
$9.00
Per 1M reqs
$0.6281
Context1,048K / 65K
Total$0.0050
Input
$2.00
Cache read
$0.500
Output
$6.00
Per 1M reqs
$0.6312
Context500K
Total$0.0050
Input
$2.00
Cache read
n/a
Output
$8.00
Per 1M reqs
$0.6750
Context128K
Total$0.0054
Input
$2.00
Cache read
$0.200
Output
$10.00
Per 1M reqs
$0.7625
Context1M / 128K
Total$0.0061
Input
$2.00
Cache read
$0.200
Output
$12.00
Per 1M reqs
$0.8375
Context1,050K / 128K
Total$0.0067
Input
$2.00
Cache read
$0.200
Output
$12.00
Per 1M reqs
$0.8375
Context1,048K / 65K
Total$0.0067
OpenAI
Input
$2.50
Cache read
$0.250
Output
$15.00
Per 1M reqs
$1.05
Context1,050K / 128K
Total$0.0084
Perplexity
Input
$3.00
Cache read
n/a
Output
$15.00
Per 1M reqs
$1.12
Context200K
Total$0.0090
Input
$3.00
Cache read
$0.300
Output
$15.00
Per 1M reqs
$1.14
Context1M / 128K
Total$0.0092
Input
$4.00
Cache read
$0.400
Output
$20.00
Per 1M reqs
$1.52
Context1,050K / 128K
Total$0.0122
Anthropic
Input
$5.00
Cache read
$0.500
Output
$25.00
Per 1M reqs
$1.91
Context1M / 128K
Total$0.0152
Input
$5.00
Cache read
$0.500
Output
$25.00
Per 1M reqs
$1.91
Context1M / 128K
Total$0.0152
OpenAI
Input
$5.00
Cache read
$0.500
Output
$30.00
Per 1M reqs
$2.09
Context1,050K / 128K
Total$0.0168
Input
$10.00
Cache read
$0.250
Output
$50.00
Per 1M reqs
$3.77
Context1M / 128K
Total$0.0301
Input
$10.00
Cache read
$0.250
Output
$50.00
Per 1M reqs
$3.77
Context1M / 128K
Total$0.0301
Input
$10.00
Cache read
$1.000
Output
$50.00
Per 1M reqs
$3.81
Context1,050K / 128K
Total$0.0305
Input
$10.00
Cache read
$1.000
Output
$50.00
Per 1M reqs
$3.81
Context1M / 128K
Total$0.0305
Input
$10.00
Cache read
$1.000
Output
$50.00
Per 1M reqs
$3.81
Context1M / 128K
Total$0.0305
Input
$30.00
Cache read
n/a
Output
$180.00
Per 1M reqs
$12.38
Context1,050K / 128K
Total$0.0990

Cost breakdown, lowest to highest

All providers — input, cache read, and output cost for this request size.

Worked examples

Three common shapes of request. Click the matching preset above the calculator to load these exact numbers and see live, current-rate pricing across every model.

Chatbot conversation

A short user message plus conversation history as input, with a longer generated reply. Output tokens usually dominate this shape, and at high call volume the per-request price matters more than raw model capability.

Code generation

A large input — existing files, a spec, a system prompt — with a comparatively short generated diff or function. Input-heavy workloads like this benefit the most from prompt caching if the surrounding code or instructions stay the same across calls.

Large document processing

A long document, transcript, or codebase as input with a short summary or extraction as output. This is where context-window size and long-context pricing tiers matter most — see the section below.

The cost formula, in plain terms

Every provider on this page publishes rates per million tokens, which is convenient for their invoicing but awkward when you're sizing a single request. The math underneath is the same everywhere: price each token type separately, then add the pieces together.

input_cost = (input_tokens ÷ 1,000,000) × input_rate
cache_cost = (cached_tokens ÷ 1,000,000) × cache_rate
output_cost = (output_tokens ÷ 1,000,000) × output_rate
total = input_cost + cache_cost + output_cost

OpenAI cost per token

OpenAI publishes API prices per million tokens, which works fine for a monthly invoice but takes a small conversion to size one request. Take the listed rate, divide by 1,000,000, then multiply by your input and output counts separately — output is priced several times higher than input across the whole GPT-5.x lineup, so a short prompt with a long, unconstrained answer can end up costing more than a long prompt with a tight response.

ChatGPT-style API cost

If you're building a ChatGPT-style feature on the API rather than using the consumer app, remember that cost isn't just the visible user message. System instructions, few-shot examples, retrieved context, and the model's expected answer length all get counted — a chatbot that looks lightweight to the end user can still carry a large system prompt behind the scenes.

Claude token cost

Claude workflows tend to involve long documents, long chat histories, or large reference material, which means the input side of the bill often dominates even when the generated answer is short. Prompt caching matters more here than on a short-prompt workload — a stable system prompt or document prefix reused across many calls can meaningfully cut the input portion of the bill.

Gemini token cost

Gemini estimates are easiest to reason about when you keep text input and expected output separate, exactly as this calculator does. The catch is multimodal input — images, audio, video, and long PDFs convert to tokens at their own rate, separate from plain text, so a text-only estimate like this one is a floor, not the full picture, once attachments are involved.

DeepSeek token cost

DeepSeek's rate card includes an off-peak discount — the numbers on this page use the lower off-peak rate, with peak-hour pricing running roughly double. For workloads that run around the clock rather than in a predictable window, budget closer to the peak rate so an unexpected traffic spike during peak hours doesn't blow past your estimate.

Grok API price

xAI's Grok models double their input, cache, and output rates once a single request passes 200K input tokens — a hard cliff rather than a gradual ramp, and it applies to the entire request, not just the tokens over the line. This calculator uses the standard (under 200K) rate; if you're routinely sending very long prompts, double-check your real cost against xAI's long-context tier.

Perplexity Sonar API price

Sonar's token rates above are only part of the bill — Perplexity also charges a per-1,000-request search fee that scales with how much web context a query retrieves (roughly $5-$14 per 1,000 requests depending on the model and search depth). That fee isn't included in this calculator's total, so treat the Sonar numbers here as a floor for low-volume use and check Perplexity's pricing page before estimating a production budget.

Long context, reasoning tokens, and cache writes

Long-context pricing tiers

Several providers charge a higher rate once a single request crosses a size threshold — commonly somewhere past 128K-272K input tokens, depending on the model. This calculator uses each model's standard rate; if your real request is unusually large, check that model's official pricing page for whether a long-context tier applies before you commit to a number.

Reasoning tokens

Thinking or reasoning models generate internal reasoning tokens before their visible answer, and most providers bill those at the output rate even though you never see them. A short visible reply from a reasoning model can still be expensive if it "thought" for a while first — the output field above is the number to increase if you want to model that.

Cache write costs

Prompt caching has two sides: reading a cache hit is cheap — that's the "cache read" rate used above — but writing new content into the cache the first time is often billed at its own rate, sometimes split into a short-lived (around 5 minutes) and a longer-lived (around 1 hour) tier. This calculator doesn't include cache-write cost, since it depends on how often your cache expires and gets rewritten. Budget a small write cost on top of this estimate if your traffic pattern refreshes the cache frequently.

Agent workflows: cost grows with every step

A single request is easy to price — an agent loop is not, because most agent frameworks re-send the growing conversation or tool-call history as input on every step. If each step adds roughly the same amount of new context, total input tokens across an N-step task grow faster than N itself, closer to N² than to a straight line.

total_input_tokens ≈ N × base_context + growth_per_step × N × (N − 1) / 2

In practice: a 10-step agent doesn't cost 10x a single call — it can easily cost 30-50x, because steps 8, 9, and 10 are each re-reading everything steps 1 through 7 already produced. Prompt caching helps a lot here, since the growing prefix is usually identical between consecutive steps, but only if your agent framework actually reuses the cache instead of rebuilding the prompt from scratch each time. If you're estimating an agent's monthly cost, model it step by step rather than multiplying one request's price by the number of steps.

Token cost calculator FAQ

Double-check these against each provider's pricing page

Methodology: rates on this page are entered by hand from each provider's official, public pricing page (linked below) and refreshed on a regular pass — prices were last checked 2026-09-29. Model prices move over time, so use this page for planning, then confirm anything affecting production billing directly with the provider.