OpenAI vs Anthropic API pricing

OpenAI and Anthropic both publish prices per million tokens. That makes comparison look like two numbers in a table.

Production bills include uncached input, cache writes, cache reads, output, batch or flex tiers, long-context rules, tools, and retries.

Prices below were checked against official documentation on 6 August 2026. Vendor pricing changes, so use the linked pages before making a purchase or capacity decision.

The short answer depends on model class

OpenAI's current recommended GPT-5.6 family has Sol, Terra, and Luna tiers.

Anthropic's current public line includes Fable 5, Opus 5, Sonnet 5, and Haiku 4.5.

These names do not define equal quality classes. A price comparison cannot tell you whether two models meet the same task-quality threshold.

The useful process is:

  1. Set a quality and latency requirement.
  2. Find the cheapest configuration from each provider that meets it.
  3. Apply your actual input, output, cache, batch, and tool mix.
  4. Include failures, retries, and unused output.

Only then compare cost.

OpenAI standard token prices

The OpenAI API pricing page lists standard short-context prices per million tokens.

At the time checked:

  • GPT-5.6 Sol: $5 input, $0.50 cached input, $6.25 cache writes, and $30 output.
  • GPT-5.6 Terra: $2 input, $0.20 cached input, $2.50 cache writes, and $12 output.
  • GPT-5.6 Luna: $0.20 input, $0.02 cached input, $0.25 cache writes, and $1.20 output.

The page also lists higher long-context rates for these models.

For example, GPT-5.6 Terra long-context rates are $4 input, $0.40 cached input, $5 cache writes, and $18 output per million tokens.

Do not apply short-context rates to a long-context workload without checking the current threshold and model rule.

Anthropic standard token prices

The Anthropic pricing page lists base input, cache write, cache hit, and output rates.

At the time checked:

  • Claude Fable 5: $10 input, $1 cache hits, and $50 output per million tokens.
  • Claude Opus 5: $5 input, $0.50 cache hits, and $25 output.
  • Claude Sonnet 5: $2 input and $10 output through 31 August 2026.
  • Claude Haiku 4.5: $1 input, $0.10 cache hits, and $5 output.

Anthropic says Sonnet 5 standard pricing becomes $3 input and $15 output on 1 September 2026.

That scheduled change can reverse a comparison built around the introductory rate.

Similar prices do not mean similar workloads

GPT-5.6 Terra and the introductory Claude Sonnet 5 rate both start at $2 per million input tokens.

Their listed output prices differ: $12 for Terra and $10 for Sonnet 5 during the promotion.

This is arithmetic, not a quality verdict.

One model may need a longer prompt, more reasoning, more output, a retry, or a stronger tier for the same task.

Anthropic also notes that Claude 4.7 and later models use a tokenizer that produces about 30 percent more tokens for the same text, with variation by workload.

Compare billed tokens from real requests. Character counts and another provider's tokenizer are weak substitutes.

Output tokens often dominate the bill

Output costs more than ordinary input on both current model families.

Consider one million uncached input tokens and 200,000 output tokens.

At the checked short-context rates:

  • GPT-5.6 Terra costs $2 for input plus $2.40 for output, or $4.40.
  • Claude Sonnet 5 at the introductory rate costs $2 for input plus $2 for output, or $4.

If output rises to one million tokens, the same workloads cost $14 and $12.

Reducing unnecessary output can matter more than trimming a small system prompt.

Measure discarded text, verbose tool arguments, and responses users stop reading.

Prompt caching has write and read economics

Both providers offer discounted reuse of repeated prompt prefixes or context.

OpenAI's current prompt caching guide says GPT-5.6 cache writes cost 1.25 times ordinary input.

Its listed cached reads cost one tenth of ordinary short-context input for the GPT-5.6 family.

Anthropic lists five-minute cache writes at 1.25 times base input, one-hour writes at 2 times, and cache hits at one tenth of base input.

A cache write loses money if the content is not reused enough.

For a five-minute cache with a 1.25 write multiplier and 0.1 read multiplier, one later full hit makes total input cost 1.35 times base instead of 2 times base.

Partial hits, changing prefixes, expiry, and routing lower the saving.

Batch cuts token rates but changes the product

OpenAI's Batch API offers a 50 percent token discount and a completion window of up to 24 hours.

Anthropic's Message Batches API also lists a 50 percent discount, with most batches described as finishing within one hour and a 24-hour expiry.

Batch is useful for evaluations, classification, extraction, enrichment, and offline generation.

It is not a cheap substitute for interactive chat because the latency contract is different.

Both providers have limits, supported features, result-retention rules, and failure behavior that belong in the design.

Price the storage, polling, retries, and late results too.

OpenAI Flex adds another serving tier

OpenAI lists Flex rates that match its Batch token rates for supported models.

Flex uses an online API path with slower or less predictable service than standard processing, rather than a file-based batch job.

That can fit background agents and asynchronous tasks that still benefit from ordinary request semantics.

Check current model support and service behavior before treating Flex and Batch as interchangeable.

For GPT-5.6 Terra, the checked Flex short-context rates are $1 input, $0.10 cached input, $1.25 cache writes, and $6 output.

The correct tier is a latency and throughput decision, not only a discount.

Long context can change the comparison

Long prompts add direct input cost and more model work.

OpenAI's pricing page publishes separate short- and long-context columns for its newest models.

Anthropic's current pricing page says Claude 4.6 and later include the full one-million-token context window at standard rates.

That difference can matter for large codebases, document collections, or long agent histories.

Do not send all available context because the window permits it.

Retrieve the smallest useful evidence, compact old state, and place stable content where caching can reuse it.

Long context also changes latency and may change answer quality. Price and evaluate the whole request.

Tool use is not free context

Tool definitions add input tokens. Tool results return more input. Server-side tools may add per-call charges.

Anthropic publishes model-specific system-prompt token counts and prices for server tools.

OpenAI also lists prices for built-in tools such as web search, file search storage, and containers.

An agent can make several model calls for one user request.

Track cost by user task, not only API request. Include planning calls, tool loops, retries, verification, and the final answer.

The back-of-the-envelope lab is useful for turning this request graph into a monthly estimate.

A fair provider test

Choose a fixed set of real tasks and a scoring rubric.

For each provider, tune the prompt and model configuration enough to reach the quality bar. Keep that final configuration.

Record:

  • Billed input, cached input, cache writes, and output.
  • Number of model and tool calls per task.
  • Latency and failure rate.
  • Human or automated quality score.
  • Cost per successful task.

Run enough repetitions to include cache behavior and variance.

Do not force identical prompts if the APIs benefit from different structures. Compare the best reasonable implementation of each.

Which provider is cheaper?

There is no provider-wide answer.

At the checked rates, OpenAI has a very low-priced Luna tier. Anthropic's Sonnet 5 introductory output price is below GPT-5.6 Terra's.

OpenAI Sol and Anthropic Opus 5 share a $5 input rate, while their listed outputs are $30 and $25.

Those pairs are not claims of equal capability.

The cheaper provider is the one that meets your quality and latency target at lower cost per completed task.

Use Fanout's LLM API cost guide to build that calculation from workload distributions rather than a single example.

Recheck both official price pages before publishing a budget. This article is a dated snapshot, not a rate card.