TokenRate
Article · Fundamentals4 min read

Tokens to Dollars: How to Convert AI Token Counts to Real Costs

A step-by-step guide to converting token counts into dollar amounts for Claude, GPT-4o, Gemini, and other LLM APIs — with formulas and worked examples.

Published

The basic formula

All major AI APIs price tokens in units of one million (1M). To convert a token count to dollars:

Cost = (tokens ÷ 1,000,000) × price_per_million

For example: 50,000 input tokens on Claude Sonnet 4 ($3.00/M): (50,000 ÷ 1,000,000) × $3.00 = 0.05 × $3.00 = $0.15

Simple — but most API calls have both input and output tokens, each priced differently.

Full cost calculation with input and output

Every LLM API call has two costs: input (what you send) and output (what the model generates). Output tokens typically cost 3–5× more than input tokens.

Full formula: Total cost = (input_tokens / 1,000,000 × input_price) + (output_tokens / 1,000,000 × output_price)

Example: 2,000 input tokens + 500 output tokens on GPT-4o ($2.50 input / $10.00 output): (2,000/1,000,000 × $2.50) + (500/1,000,000 × $10.00) = $0.005 + $0.005 = $0.01 per call

Current pricing for major models (2025)

Claude Haiku 4.5: $0.80 input / $4.00 output per million tokens Claude Sonnet 4: $3.00 input / $15.00 output per million tokens Claude Opus 4: $15.00 input / $75.00 output per million tokens

GPT-4o Mini: $0.15 input / $0.60 output per million tokens GPT-4o: $2.50 input / $10.00 output per million tokens GPT-4.5 Turbo: $75.00 input / $150.00 output per million tokens

Gemini 1.5 Flash: $0.075 input / $0.30 output per million tokens Gemini 1.5 Pro: $1.25 input / $5.00 output per million tokens Gemini 2.0 Flash: $0.10 input / $0.40 output per million tokens

Scaling to production: monthly cost estimation

To estimate monthly costs for a production app:

1. Measure average input tokens per call (your prompt + context) 2. Measure average output tokens per call (model response length) 3. Multiply by your expected daily call volume 4. Multiply by 30 for monthly totals

Example: An app with 1,500 input tokens + 300 output tokens per call, 10,000 calls/day on Claude Sonnet 4: Input: (1,500 × 10,000 × 30) / 1,000,000 × $3.00 = 450M tokens / 1M × $3 = $1,350/month Output: (300 × 10,000 × 30) / 1,000,000 × $15.00 = 90M tokens / 1M × $15 = $1,350/month Total: $2,700/month

Use the TokenRate calculator to run these numbers without the math.

Quick reference: tokens to dollars at a glance

1,000 tokens on Claude Sonnet 4 (input): $0.003 1,000 tokens on GPT-4o (input): $0.0025 1,000 tokens on Gemini 1.5 Flash (input): $0.000075

1,000 tokens on Claude Sonnet 4 (output): $0.015 1,000 tokens on GPT-4o (output): $0.01 1,000 tokens on Gemini 1.5 Flash (output): $0.0003

For real-time conversion across all models, enter any token count into the TokenRate calculator.

Frequently Asked Questions

How do I convert 1 million tokens to dollars?

Multiply 1,000,000 by the price per million tokens for your model. For Claude Sonnet 4 input, that's 1 × $3.00 = $3.00. For GPT-4o output, that's 1 × $10.00 = $10.00.

How much does 1,000 API calls cost?

It depends on your prompt and response length. A typical chatbot call with 1,500 input + 300 output tokens on GPT-4o costs about $0.00675 per call, or $6.75 for 1,000 calls. Use the calculator with your actual token counts for an accurate estimate.

Are input tokens or output tokens more expensive?

Output tokens are always more expensive, typically 3–5× the input price. For Claude Sonnet 4, output tokens ($15.00/M) cost 5× input tokens ($3.00/M). For GPT-4o, output ($10.00/M) costs 4× input ($2.50/M).

Does the API charge for tokens in the system prompt?

Yes. System prompt tokens count as input tokens and are billed at the input rate on every call. This is why large system prompts are expensive at scale, and why prompt caching can save a significant amount for apps with long system prompts.

Try the TokenRate Calculator

Enter any token count and see the exact dollar cost across Claude, GPT-4o, Gemini, and more — instantly.

Open Calculator →