Blog

LLM API pricing explained: what per-million-token prices cost

Every major LLM API prices the same way: a rate per million input tokens and a higher rate per million output tokens. The rates are easy to read and hard to turn into a monthly number. This post does the arithmetic once, with real list prices, so you can redo it for your own traffic.

Tokens, briefly

A token is a piece of text the model reads or writes. For English, a token is roughly four characters, or about three quarters of a word. A 750-word page is about 1,000 tokens. Code, non-English text, and unusual formatting use more tokens per word.

You pay for two kinds:

  • Input tokens: everything you send. The system prompt, the conversation so far, retrieved documents, tool definitions.
  • Output tokens: everything the model writes back, including reasoning tokens on thinking models.

The formula

cost = input_tokens / 1,000,000 × input_price
     + output_tokens / 1,000,000 × output_price

Output is the expensive side. In the list prices below, output costs five to eight times as much as input.

List prices to work with

These are the official prices per million tokens, as listed on the AIKeys pricing page in October 2026. Providers change prices, so check the live page before you budget.

Model Input Output Output ÷ input
Claude Opus 4.7 $5.00 $25.00 5×
Claude Sonnet 4.6 $3.00 $15.00 5×
GPT-5.6-Terra $2.00 $12.00 6×
Gemini 3.1 Pro (High) $1.25 $10.00 8×
Claude 4.5 Haiku $1.00 $5.00 5×

A worked example

Take a support assistant that handles 1,000 conversations a day. Each one sends about 2,000 input tokens (system prompt, history, a few retrieved help articles) and gets back about 500 output tokens.

Over 30 days that is:

  • 1,000 × 2,000 × 30 = 60 million input tokens
  • 1,000 × 500 × 30 = 15 million output tokens
Model Input cost Output cost Month at list price Month at half price
Claude Opus 4.7 60 × $5 = $300 15 × $25 = $375 $675.00 $337.50
Claude Sonnet 4.6 $180 $225 $405.00 $202.50
GPT-5.6-Terra $120 $180 $300.00 $150.00
Gemini 3.1 Pro (High) $75 $150 $225.00 $112.50
Claude 4.5 Haiku $60 $75 $135.00 $67.50

The last column is the ceiling on AIKeys, where an ask is never more than half the official price. The actual charge is the cheapest live ask at the time of each request, which can be lower. There is no monthly fee on top.

Two things stand out. First, the model choice moves the bill five-fold. Second, even with four times as many input tokens as output tokens, output is more than half the cost on every model in the table.

Five ways to cut the bill

  1. Cap the output. Set max_tokens to what the task needs. Ask for short answers when short answers will do.
  2. Trim the input. Every request resends the system prompt and the history. Summarize long histories and retrieve fewer, better documents.
  3. Route by difficulty. Send easy requests to a small model and hard ones to a large one. With one API key, routing is a change to the model string. See how to call Claude, GPT and Gemini with one key.
  4. Watch thinking models. Reasoning tokens are usually billed as output. Use a thinking variant only where it changes the answer.
  5. Pay less per token. The same model can cost less from a different seller. Compare the official price with the lowest live ask on each model page.

Estimate your own

Count tokens for one typical request (most SDKs return usage with input and output token counts), multiply by your daily volume and by 30, and put the totals into the formula. Or use the cost estimate on the pricing page: pick a model and drag the token volume.