API Cost

AI API Pricing Comparison 2026: OpenAI, Claude, Gemini, and DeepSeek

Compare standard text API prices for leading OpenAI, Anthropic Claude, Google Gemini, and DeepSeek models, with practical cost examples.

Model quality matters, but API economics determine whether a prototype can become a dependable product. A price that looks tiny per million tokens can become material once an application adds system instructions, conversation history, retrieval context, tool definitions, retries, and long model responses.

This guide compares selected standard text rates published by OpenAI, Anthropic, Google, and DeepSeek. Prices are in US dollars per one million tokens and were checked against provider documentation on August 16, 2026. Providers can change model names, rates, context thresholds, and service tiers, so verify the linked official page before approving a budget or shipping a pricing promise to customers.

Free companion toolAI Token & Cost Estimator

Check the estimate or cleanup workflow locally in your browser without uploading your content.

Open tool

2026 standard API price comparison

The table uses standard, on-demand text processing wherever possible. It does not mix consumer subscriptions with API billing. Cached-input prices are shown only when the selected provider publishes a directly comparable rate; DeepSeek uses its cache-hit rate, while the regular input column uses its cache-miss rate.

Output tokens are usually more expensive than input tokens. That difference makes response length, reasoning output, and retry behavior important parts of cost control. A model with a low input price can still be expensive for workflows that generate long reports or code files.

Selected standard text prices, USD per 1M tokens, checked 2026-08-16
Provider and modelInputCached inputOutputPlanning note
OpenAI GPT-5.6 Luna$1.00$0.10$6.00Affordable general-purpose OpenAI option
OpenAI GPT-5.6 Terra$2.50$0.25$15.00Balanced model for more demanding work
Anthropic Claude Sonnet 5$2.00$0.20 cache hit$10.00Strong mid-tier price and capability profile
Anthropic Claude Sonnet 4.6$3.00$0.30 cache hit$15.00Earlier tokenizer and higher standard rate
Google Gemini 3.5 Flash$1.50$0.15$9.00Thinking tokens are included in output billing
DeepSeek Chat$0.27 cache miss$0.07$1.10Low-cost chat model; verify availability and policy needs
DeepSeek Reasoner$0.55 cache miss$0.14$2.19Reasoning workload with separate cache-hit pricing

The cost formula behind every comparison

For a basic text request, estimated cost equals input tokens multiplied by the input rate, plus output tokens multiplied by the output rate, with both rates divided by one million. If 100,000 input tokens and 25,000 output tokens are processed on a model priced at $1 input and $6 output, the estimate is $0.10 plus $0.15, or $0.25.

Production billing can include more than the text visible in one prompt box. System instructions, message history, retrieved documents, image or audio tokens, tool schemas, internal reasoning tokens, cache writes, cache storage, web search calls, and regional processing can all change the invoice. Treat a simple calculator as a planning baseline, then compare it with provider usage reports after a representative test.

  • Count the full request, not only the latest user message.
  • Estimate output separately because it commonly has a higher rate.
  • Model cache hits and cache writes as different billing events.
  • Add a retry and failure allowance for real production traffic.
  • Recalculate when prompts cross a provider's long-context threshold.

How the providers structure pricing differently

OpenAI separates standard input, cached input, and output rates, and also offers service modes such as Batch that may reduce asynchronous processing cost. The standard rate is the clearest starting point for interactive applications, while batch pricing is relevant only when a workload can wait and meets the provider's operational rules.

Anthropic publishes base input, cache-write durations, cache-hit, and output columns. A repeated prompt prefix can be economical after caching, but writing a cache is not free. Claude tool use also adds system-prompt tokens, so an agent request can consume more input than the visible conversation suggests.

Google includes thinking tokens in the output charge for Gemini 3.5 Flash and lists separate standard, batch, flex, priority, and cache-storage terms. Those tiers are not interchangeable: compare the mode your production endpoint actually uses. DeepSeek distinguishes cache-hit and cache-miss input prices, which makes prompt repetition and cache behavior especially visible in estimates.

Three workload shapes that change the winner

A short classifier has a large input-to-output ratio: perhaps 2,000 input tokens and 50 output tokens. Input price and latency dominate, and a smaller fast model may be the sensible choice. A support assistant may carry a growing conversation history and generate a few hundred tokens each turn, making history trimming and caching valuable. A research or coding agent may send tool definitions, retrieved files, command output, and long reasoning traces, so output price and tool overhead can dominate.

There is no universal cheapest model because equivalent quality is not guaranteed. A lower-priced model that needs extra retries, larger prompts, or a second validation call may cost more per successful task. Evaluate cost per accepted outcome: a correctly classified ticket, a useful answer, or a merged code change—not merely cost per request.

What to measure by workload
WorkloadLikely cost driverUseful optimization
Classification and extractionRepeated inputShort schema, small model, batch where appropriate
Customer support chatConversation historySummaries, cache stable instructions, cap answer length
Research and coding agentsTools and long outputRoute tasks, limit retrieved context, monitor retries

A safer way to turn token rates into a monthly budget

Start with a measured sample rather than an optimistic guess. Capture the input and output token counts for at least several normal, short, and unusually large tasks. Use percentiles instead of one average so a small group of long requests does not surprise the budget. Multiply the expected successful requests by cost per request, then add retry, evaluation, and development traffic.

Keep a model-specific price record with a source URL and review date. Do not hard-code marketing claims such as 'always under one cent' without stating the workload. Add provider billing alerts and application-side limits. If a product accepts arbitrary documents, constrain file size, extracted text, maximum output tokens, and the number of automatic retries before launch.

  • Measure p50, p90, and maximum input and output tokens.
  • Budget normal traffic, retries, evaluations, and internal testing separately.
  • Set a monthly provider limit and a per-request application limit.
  • Review model and price changes on a scheduled cadence.
  • Compare the estimate with actual invoices before scaling traffic.

Choosing by value instead of price alone

Use a small benchmark drawn from your own workload. Score answer quality, structured-output reliability, latency, safety requirements, regional availability, rate limits, and total cost. Run the same representative inputs against candidate models and calculate cost per accepted result. This makes trade-offs visible and avoids selecting a model from a headline price that applies to a different service tier.

The RunAIToolkit estimator is useful for the first comparison because it keeps sample text in the browser and separates expected input and output. It is still an estimate: provider tokenizers and hidden request components can differ. Validate the final choice with the provider's token-count endpoint and billing dashboard when available.

Frequently asked questions

Are ChatGPT, Claude, or Gemini subscriptions included in these prices?

No. Consumer and team subscriptions are separate products. This comparison covers selected developer API text rates.

Why is output usually more expensive than input?

Generating tokens requires autoregressive inference, so providers commonly charge a higher output rate. The exact ratio differs by model.

Does prompt caching always reduce cost?

No. Cache writes and storage can have their own costs, and a cache only helps when enough prefix content is reused under the provider's rules.

Can I use the cheapest model for every task?

A low token rate does not guarantee the lowest cost per successful outcome. Quality failures, retries, and extra validation calls can reverse the apparent saving.

Official sources

Prices can change. Recheck these pages before making a budget commitment.