When you use a model through a developer interface, the charge depends on how many tokens go in and come out, each at its own rate. OpenAI says the rate depends on the model and the token category.1
Both Anthropic and OpenAI publish rates per million tokens.23 This page covers those programming interfaces. For a chat subscription, check the maker's plan page.
What gets counted
OpenAI's help page lists the categories. Input tokens are what you send, output tokens are what the model writes, and cached input tokens are input reused through prompt caching.1 The unit itself is explained in the opening page on tokens.
The same page says input, cached input and output tokens can have different prices.1
Why input and output cost differently
The makers' tables show different rates for each. The sources I've saved publish the rates but don't explain the reason, so I won't guess at one.
Here's what one maker's table showed on 10 November 2026. All the prices are in USD, and the Australian-dollar cost will depend on the exchange rate on the day you're billed.2
| Model (Anthropic) | Input | Output |
|---|---|---|
| Claude Sonnet 5.5 | $2 per million tokens | $10 per million tokens2 |
| Claude Haiku 5.5, prompts up to 100,000 tokens | $0.10 per million tokens | $0.50 per million tokens2 |
OpenAI's pricing page, also checked on 10 November 2026, is laid out the same way, with prices per 1M tokens and separate columns for input, output and cached input.3
Anthropic's table also shows that for Claude Haiku 5.5 the rates go up for prompts over 100,000 tokens. The input rate for those longer prompts is $0.50 per million tokens.2
I'm not recommending any model here. These rows only show how a price table is built. Prices and plans change often, so go to the maker's pricing page before you budget.
A worked example
Take the Sonnet row above. Say a request sends 10,000 tokens in and gets 1,000 tokens back.2
- Input: 10,000 tokens at $2 per million is $0.02.2
- Output: 1,000 tokens at $10 per million is $0.01.2
- Total for the one request: $0.03.2
The sum is my own arithmetic from the published rates. Real bills have extras such as caching, so treat it as an illustration of the method and nothing more.
Two things that make a bill bigger than it looks
Reasoning tokens. OpenAI says reasoning tokens aren't visible as answer text, but they count toward output usage and are billed as output tokens.1 A short answer can hide a long stretch of thinking. The limits page, input versus output, goes deeper.
The whole chat is sent again. Anthropic says each turn's input contains all previous conversation history plus the current message, as explained in why a chat forgets.4 Earlier turns are therefore input again.
Cached input
Both makers describe prompt caching, where input that's reused is priced differently. OpenAI says the pricing of cached input tokens can differ from uncached input.1 Anthropic adds that caching changes what you pay for those tokens, not whether they count toward the context window.4
Comparing models fairly
A lower price per million tokens doesn't necessarily mean a lower total cost, according to OpenAI. Models can split the same text differently and write different amounts of output.1
If cost matters, estimate with real samples of your own work. Count them first using the makers' counters.
Testing costs doesn't need real data. Use made-up sample text, and leave out customer records and secrets unless your workplace policy allows them.
Cited material
- Understanding and counting tokens, OpenAI Help Center
- Pricing, Anthropic (Claude Platform Docs)
- Pricing, OpenAI API documentation
- Context windows, Anthropic (Claude Platform Docs)