The problem this solves
AI model APIs are priced per token, and two providers can list similar headline numbers while charging very different amounts for the same workload. Input, output and cached input are billed at separate rates, long prompts can move into a higher price band, and usage tiers cap monthly spend. This tutorial shows how to read a token price table, estimate a monthly bill with transparent arithmetic, and compare providers on the same basis.
The examples use the OpenAI API and the Anthropic Claude API, whose per-million-token rates SIDAN has recorded. All figures are as listed on 24 October 2026 and may have changed. Browse more providers in LLM APIs and AI infrastructure.
Who this is for and prerequisites
This is for developers, product managers and founders budgeting for an application that calls a language model API. You need a description of one feature (for example, summarising support tickets), estimates of requests per day and prompt and response length, a spreadsheet, and each provider's official pricing page. No code is required.
Tools and versions
We refer to the OpenAI and Anthropic pricing documentation as published on 24 October 2026, plus each provider's rate limit, prompt caching and batch processing pages. Rates are quoted exactly as shown. Nothing was tested by running code against either API; see how we research.
Estimated time
Estimate only: 1 to 2 hours for one feature across two providers.
Step 1: Understand what a token is
A token is the unit a model reads and writes. Anthropic's glossary describes tokens as the smallest individual units of a language model, corresponding to words, subwords, characters or bytes; it says a token represented approximately 3.5 English characters on earlier Claude models, and that Claude 4.7 and later models produce approximately 30 percent more tokens for the same text. Tokenizers differ between providers, so one paragraph can cost a different number of tokens on each API.
Two consequences follow: prices quoted per million tokens (MTok) are only comparable across providers once you know how many tokens each counts for your text, and non-English text and code tokenize differently from English prose, so test with real content.
Expected result: you can explain why "per million tokens" is not "per million words", and you know which counting tool each provider offers.
Step 2: Separate input, output and cached input
Both pricing pages list at least three rates per model:
- Input tokens: everything you send, including system instructions, history, documents and the user's message.
- Output tokens: everything the model generates. On every model in the table below, output costs five times the input rate.
- Cached input: a repeated prefix the provider has recently seen and serves from a cache at a reduced rate. Anthropic also lists cache write rates (1.25x base input for a 5-minute cache, 2x for a 1-hour cache).
The split matters because workloads differ: classification sends long inputs and returns little, drafting does the opposite, and chat re-sends the conversation on each turn.
Expected result: average input tokens, average output tokens and the repeated-prefix share, written down for your feature.
Step 3: Read the rate table correctly
The table below records the Standard tier rates we verified on 24 October 2026. OpenAI's rates are for short context (up to 272K input tokens); the page shows a dollar sign without naming a currency, and SIDAN's catalog records them as USD. Anthropic's page states that all prices are in USD.
| Model (provider) | Input, USD per 1M tokens | Cached input, USD per 1M tokens | Output, USD per 1M tokens |
|---|---|---|---|
| gpt-6-astra (OpenAI) | 10.00 | 1.00 | 50.00 |
| gpt-6.1-sol (OpenAI) | 2.00 | 0.10 | 10.00 |
| gpt-6-luna (OpenAI) | 0.10 | 0.01 | 0.50 |
| Claude Fable 5.1 (Anthropic) | 10 | 0.25 (cache hit) | 50 |
| Claude Opus 5.5 (Anthropic) | 4 | 0.20 (cache hit) | 20 |
| Claude Sonnet 5.5 (Anthropic) | 2 | 0.10 (cache hit) | 10 |
Anthropic's cache hit column is the read rate; cache writes are billed separately (12.50 and 20 USD per 1M tokens for the 5-minute and 1-hour caches on Claude Fable 5.1, 5 and 8 on Claude Opus 5.5, 2.50 and 4 on Claude Sonnet 5.5). OpenAI's pricing page lists a cached input column without describing write pricing; its caching guide says writes on GPT-5.6 and later cost more than ordinary input. Neither API has a monthly fee: you pay for tokens consumed.
Expected result: one spreadsheet row per candidate model with the three rates, the tier, the context band and the date copied.
Step 4: Estimate monthly cost with a worked example
The following is illustrative arithmetic with invented usage figures; it does not describe a real application.
Assume a ticket-summary feature that makes 2,000 requests a day, each with 3,000 input tokens (of which 2,000 are a fixed system prompt) and 400 output tokens. Over 30 days that is 60,000 requests, 180 million input tokens and 24 million output tokens.
| Scenario (illustrative) | Input cost | Output cost | Monthly total |
|---|---|---|---|
| Claude Sonnet 5.5, no caching (2 / 10 USD per 1M) | 180 x 2 = 360 USD | 24 x 10 = 240 USD | 600 USD |
| gpt-6.1-sol, no caching (2 / 10 USD per 1M) | 180 x 2 = 360 USD | 24 x 10 = 240 USD | 600 USD |
| Either model, 2,000-token prefix served from cache at 0.10 USD per 1M | 60 x 2 + 120 x 0.10 = 132 USD | 240 USD | about 372 USD, before cache writes |
| Claude Fable 5.1 or gpt-6-astra, no caching (10 / 50 USD per 1M) | 180 x 10 = 1,800 USD | 24 x 50 = 1,200 USD | 3,000 USD |
Three lessons fall out of the arithmetic. Model choice moves the bill by a factor of five here. Output tokens are 12 percent of the volume but 40 percent of the uncached cost. Caching the fixed prefix removes roughly a third of the total, before the cache writes each provider charges. The two mid-tier models happen to share base rates here; that will not generally be true, so run the arithmetic per model.
Expected result: a low, expected and high monthly figure per model, with assumptions written next to them.
Step 5: Account for context windows and conversation history
Anthropic's glossary describes the context window as the amount of text a model can look back on and reference when generating new text. Everything inside it on a request is billed as input. Two documented effects matter:
- Long context bands. OpenAI defines short context as up to 272K input tokens and long context above that, with higher rates: gpt-6.1-sol long-context input is listed at 4.00 and output at 15.00 USD per 1M tokens, against 2.00 and 10.00 for short context. Anthropic says Claude 4.6 and later models (except Claude Haiku 5.5) include the full 1M token context window at standard pricing.
- Re-sent history. Each turn of a chat carries the prior turns as input, so ten turns cost far more than ten single requests. Caching, summarising or truncating history are the usual mitigations.
Expected result: you know whether any request crosses a long-context threshold and have a rule for how much history you send.
Step 6: Apply only the discounts that are documented
Both providers document two discount mechanisms as of 24 October 2026:
- Batch processing. Anthropic's pricing page states a 50 percent discount on both input and output tokens for asynchronous batches; its batch documentation says most complete within 1 hour and batches expire after 24 hours. OpenAI's batch guide states a 50 percent discount compared to synchronous APIs, completion within 24 hours and separate rate limits. Batch suits evaluations, backfills and nightly jobs, not live chat.
- Prompt caching. Anthropic lists cache reads at 0.1x base input for most models, 0.05x on Claude Opus 5.5 and Sonnet 5.5 and 0.025x on Claude Fable 5.1, and says caching and batch discounts stack. OpenAI's caching guide says caching is on by default, needs a prefix of at least 1,024 tokens on GPT-5.6 and later, and discounts cached input by up to 95 percent.
Do not assume a discount a provider does not document, and re-check its conditions (cache lifetime, minimum prefix, write charges) before budgeting on it.
Expected result: a "with discounts" column, each discount tied to a documented condition.
Step 7: Check rate limits and usage tiers
A price you cannot spend is not a price. Both providers place new accounts in tiers that cap throughput and monthly spend:
- Anthropic measures limits in requests, input tokens and output tokens per minute, returns HTTP 429 when one is exceeded, and lists monthly spend caps of 500 USD (Start), 1,000 USD (Build) and 200,000 USD (Scale), with a Custom tier above. For most Claude models only uncached input tokens count toward the input-token limit, so caching also raises throughput.
- OpenAI measures requests and tokens per minute and per day, returns a 429 error when a limit is hit, and describes a Free tier plus Build, Launch and Grow tiers with monthly usage limits of 100, 500, 5,000 and 200,000 USD; tiers upgrade automatically as total credit purchases reach 5, 100 and 500 USD.
Our illustrative 600 USD a month would exceed Anthropic's Start cap and OpenAI's Build limit, so the plan must include moving up a tier.
Expected result: expected monthly spend and peak requests per minute checked against your starting tier.
Step 8: Compare providers like for like
Put candidates side by side with the same workload, tier, context band and discount assumptions, then add the columns that often decide the outcome: model availability (limited or retired models), data residency surcharges (both providers document a 10 percent uplift for certain regional endpoints) and quality on your own test set. A cheaper model that needs two attempts costs more than a dearer one that needs one.
Expected result: a one-page comparison a colleague could reproduce.
Common mistakes and troubleshooting
- Symptom: the bill is far above the estimate. Cause: output or history under-counted. Fix: log usage fields from real responses and recompute.
- Symptom: caching saves less than expected. Cause: the prefix changes, is below the minimum length or expires between calls. Fix: put static content first and check the cache rules.
- Symptom: HTTP 429 errors with budget to spare. Cause: a per-minute limit or a tier spend cap. Fix: retry with backoff, smooth traffic, request a tier increase.
- Symptom: two quotes disagree for one model. Cause: different tiers (Standard, Batch, Fast) or context bands. Fix: label every rate with tier and band.
Security, privacy and cost considerations
- Keys and spend limits. Treat API keys as secrets, and set the account-level spend limit both providers document below your tier cap so a bug cannot run up a bill.
- Data handling. Read each provider's retention and training terms for the exact endpoint and plan you use; they can differ between standard, batch and enterprise arrangements.
- Regional endpoints. Data residency options carry documented uplifts on both providers.
Alternative approaches
If costs are dominated by a narrow, repetitive task, a smaller model or a non-LLM approach may be enough. If you need predictable spend rather than pay-per-token, compare subscription products that bundle usage. Token-counting tools become worthwhile once you have real prompts.
Final checklist
- Input, output and cached-prefix tokens estimated per request.
- Rates copied with tier, context band, currency and date for every model.
- Monthly cost computed at low, expected and high volume.
- Long-context thresholds and conversation history accounted for.
- Only documented discounts applied, with conditions noted.
- Spend and peak throughput checked against the starting tier.
- Quality tested on your own examples, not only price.
- A spend limit set in each provider console.
Related guides and tools
- OpenAI API and Anthropic Claude API catalog pages; all providers in LLM APIs and AI infrastructure.
- How to evaluate a software free plan for subscription products.
How we researched this
This guide is research-based. On 24 October 2026 an editor read the OpenAI pricing, rate limits, prompt caching and batch documentation and the Anthropic pricing, rate limits, batch processing and glossary pages, and recorded the figures quoted above. The worked example is invented arithmetic. No hands-on testing or API calls were made; see how we research.
Disclosure
SIDAN may earn commissions from some links elsewhere on the site. None of the links in this article are affiliate links, and our recommendations are not influenced by payment.