OpenAI API Pricing: Token Rates and Cost Examples

Updated October 28, 2026

OpenAI API cost depends on the model, input and output usage, processing tier, context length, caching and tools. For current short-context standard text pricing, GPT-6.1 Sol is $2 input and $10 output per million tokens; GPT-6 Luna is $0.10 and $0.50. GPT-4.1 remains listed at $2 and $8, but its model documentation now marks it deprecated.

This guide separates current model budgeting from older-model reference prices. Rates were checked October 28, 2026 against OpenAI's documentation. All amounts are USD before tax, discounts or account-specific terms. Worked examples use explicit assumptions; they are not claims about measured production performance.

Our data: request, cache and application cost calculations

We calculate three monthly workloads plus request-level, context-band and cache-reuse examples. Every scenario states its assumed input and output usage so the cost can be recomputed. These are derived planning calculations, not observed customer bills. AI assisted research and drafting; PE Collective should review volatile rates and lifecycle status before a purchase or migration.

Current OpenAI text API prices

The table shows standard processing for short context, defined in the pricing documentation as at most 272,000 input tokens. Cached input is a separate category from ordinary input. Cache writes can also have a separate rate, explained below. Do not use this table for audio, generated images or other modalities without checking their billing categories.

ModelInput / 1MCached input / 1MOutput / 1M
GPT-6 Astra$10.00$1.00$50.00
GPT-6.1 Sol$2.00$0.10$10.00
GPT-6.1 Terra$1.00$0.05$5.00
GPT-6 Luna$0.10$0.01$0.50
GPT-6 Sol$2.00$0.20$10.00

Source: OpenAI's API pricing reference. A listed rate establishes the price category, not that every model is suitable for every task or enabled for every account. Check the model identifier and endpoint used by your application rather than pricing an approximate family name.

The identical ordinary input and output rates for Sol and Sol 6.1 do not make their cache accounting identical. Likewise, the lowest input rate does not always produce the lowest cost per successful task. Use the table to create a shortlist, then compare actual billed tokens and accepted results on the workload you intend to run.

GPT-4.1, Mini and Nano: prices, context and lifecycle

Many searches and existing integrations still refer to GPT-4.1. The following reference rates help interpret those budgets. Lifecycle status matters: the official pages currently mark GPT-4.1 and Mini deprecated, and Nano shut down. A price remaining in documentation is not a promise that a model remains available for new work.

ModelInput / 1MCached input / 1MOutput / 1MDocumented status
GPT-4.1$2.00$0.50$8.00Deprecated
GPT-4.1 Mini$0.40$0.10$1.60Deprecated
GPT-4.1 Nano$0.10$0.025$0.40Shut down; reference only

The GPT-4.1, GPT-4.1 Mini and Nano model pages list a 1,047,576-token context window and 32,768 maximum output tokens. Those limits describe different things: the context window accommodates the request and response, while the output limit caps generated output.

A one-million-token context window therefore does not allow a one-million-token answer. Leave room for the requested response as well as instructions, tool definitions and other input. When a document is close to the limit, use the endpoint's counting tools and model-specific constraints instead of assuming the document's word count proves it will fit.

What does GPT-4.1 cost for one request?

For an uncached request with 2,000 input tokens and 500 output tokens, the reference cost is $0.004 for input and $0.004 for output: $0.008 total. Ten thousand equivalent requests cost $80. This assumes no extra tools or retries and that the model remains usable in the relevant integration.

At Mini's reference rates, the same request costs $0.0008 for input plus $0.0008 for output, or $0.0016. Ten thousand requests cost $16. The fivefold price difference is arithmetic from the published rates; it does not establish that Mini and the full model have interchangeable accuracy.

If 1,500 of GPT-4.1's 2,000 input tokens qualify as cached reads, input becomes $0.00075 for cached tokens plus $0.001 for the remaining 500. Add $0.004 output for a $0.00575 total. The saving against the uncached $0.008 request is 28.125%, despite cached input itself being 75% cheaper.

Should an existing GPT-4.1 application migrate?

Plan a migration around the documented lifecycle and test the replacement before switching production traffic. Do not treat “deprecated” and “shut down” as synonyms: the latter requires an available replacement, while the former calls for checking the current schedule and account behavior. Follow OpenAI's deprecation documentation for the applicable model and endpoint.

Keep representative prompts, expected outputs and validation rules from the existing application. Test the proposed replacement with the same inputs, then compare correctness, formatting, tool selection, latency and billed usage. A newer model's lower nominal rate does not guarantee a lower bill if it generates longer responses or uses more reasoning tokens.

Avoid changing the model, prompt, retrieval configuration and output format simultaneously. Make each difference visible so a regression has a traceable cause. Preserve a supported rollback route while the old model is still available; once it shuts down, rollback must use another supported option rather than the unavailable endpoint.

Other familiar model prices

These standard text rates are useful for comparing an older budget or usage export. Check the specific model's current availability before selecting it. This is a reference list, not a recommendation to start new integrations on older model families.

ModelInput / 1MCached input / 1MOutput / 1M
GPT-5$1.25$0.125$10.00
GPT-5 Mini$0.25$0.025$2.00
GPT-5 Nano$0.05$0.005$0.40
GPT-4o$2.50$1.25$10.00
GPT-4o Mini$0.15$0.075$0.60
o3$2.00$0.50$8.00
o4-mini$1.10$0.275$4.40

OpenAI's pricing reference also distinguishes particular dated snapshots. Store the full identifier from your request and usage export. A family alias and an older dated endpoint can have different terms. Do not label a rate “grandfathered” unless the provider's terms establish that specific account arrangement.

How to calculate an OpenAI API bill

For ordinary text usage, split the bill into uncached input, cached input, cache writes and output. Multiply each token count by its applicable per-million rate, then divide by one million. Add separately priced tools, storage and other services after the token calculation.

token cost = (uncached input × input rate
            + cached input × cache-read rate
            + cache-write input × cache-write rate
            + billed output × output rate) / 1,000,000
application cost = token cost + tools + storage + other services

Each input token belongs in the applicable billing category. Do not place a cached token in both the uncached and cached columns. Likewise, a total cache-write rate is not an additional full input charge. Reconcile your categories against the endpoint's usage response before scaling the calculation to monthly volumes.

For current Sol, a 2,000-input, 500-output uncached request costs $0.004 plus $0.005, or $0.009. At 10,000 requests, that is $90. At one million requests, the same assumptions produce $9,000. These estimates exclude cache writes and tools; a seemingly tiny unit cost can become material at high volume.

To convert a price from per million to per thousand tokens, divide it by 1,000. Sol's $2 input rate becomes $0.002 per thousand, while its $10 output rate becomes $0.01 per thousand. To calculate a single token's price, divide the per-million rate by one million instead.

Why input and output need separate forecasts

Output is more expensive than input for the models in these tables, and different features produce different output lengths. A classifier returning a category uses a different mix from a writer producing a long report. A single blended rate can conceal that difference and distort the cost of each feature.

For example, ten million input and one million output tokens on Sol costs $30. Reversing that mix to one million input and ten million output costs $102. Both workloads contain eleven million total tokens. A budget based only on total tokens would miss a $72 difference.

Store input and output distributions separately, including typical and large requests. A handful of document-heavy or verbose calls may dominate the bill. Reducing those outliers can be more effective than switching every request to a less capable model.

Long-context pricing

Current flagship prices change above 272,000 input tokens. The long-context Sol rate is $4 input and $15 output per million, compared with $2 and $10 in the short-context band. Astra's corresponding long rates are $20 and $75. Consult the pricing reference for cached input, cache writes and other models in the long band.

A Sol request with 300,000 input tokens and 2,000 output tokens costs $1.20 plus $0.03, or $1.23, using long-context rates. Applying the short rates would give $0.62. The difference comes from selecting the correct band, not from a mistake in the multiplication.

Count the complete prompt when determining the band. Documents are only one part of the input; instructions, examples, prior conversation and tool definitions can push a request across the threshold. Check the final request rather than a document before preprocessing.

Calculate costs at the request level before aggregating. If nine short requests and one long request average below the threshold, applying the short rate to all ten would still be wrong. An average input length is useful for describing traffic, but not always sufficient for billing.

Retrieval can reduce prompt size by selecting relevant passages, while summarization can shorten repeated history. Both approaches introduce a quality tradeoff. Test questions that require information from distant parts of a document before deciding that a smaller prompt preserves the same result.

Prompt caching and cache-write charges

OpenAI's prompt-caching guide explains how repeated prefixes qualify for reuse. GPT-5.6 and later use cache-write rates as well as read rates. For current Sol, a 30-minute write is $2.50 per million tokens and a 12-hour write is $5; short-context reads are $0.10. These are total input-category rates, not fees added on top of ordinary input.

Suppose a stable 10,000-token prefix is written once with the 30-minute option and fully reused nine times. The first write costs $0.025. Nine reads cost $0.009. The total prefix cost is $0.034, compared with $0.20 for ten ordinary uncached copies. Unique input and all newly generated output remain additional.

Now suppose that same prefix is written for 12-hour reuse but never used again. Its write costs $0.05. A longer retention choice has added cost without producing read savings. The right setting depends on how often the material is reused and how much of the prefix remains unchanged.

Cache design belongs in the prompt structure. Put reusable instructions and documents before changing user content where practical. Keep tool definitions and their order stable. Changing an early part of the prefix can prevent reuse farther into the request even when most of the text looks identical.

Measure cache reads in usage data. A conversation continuing in the same session does not guarantee every prior token will be billed as a cached read. Different models, settings, breakpoints and expiration behavior can change reuse. Budget with an observed hit rate after a representative trial, not a theoretical maximum.

What a cache hit does not save

Caching does not make output free, remove tool charges or necessarily reduce the whole prompt to the cached rate. Consider a request where output already accounts for most of the bill. A substantial input discount can produce a modest total saving, as the GPT-4.1 example above illustrates.

It can also be more economical to send less context than to optimize a large cached prefix. Compare the bill and answer quality for both approaches. A shorter retrieval result may cost less even with a lower hit rate, while a long stable reference document may benefit from reuse.

When comparing models, include cache writes and retention in both estimates. Comparing one model's ordinary input price with another model's best-case cache-read price gives an apparent saving that may not survive the first uncached request.

Batch API pricing

The Batch API is designed for asynchronous work and documents a 50% discount with a 24-hour turnaround window. Check model and endpoint support. It is useful for evaluations, classification and other jobs that can wait; it does not provide the same interaction as a user waiting on a synchronous response.

At half the listed standard short-context rates, Sol input is $1 and output is $5 per million. A job containing 20 million uncached input and five million output tokens costs $20 plus $25, or $45. The equivalent standard token calculation is $90.

Build the job around individual request IDs. Match each returned result to its input, preserve failures, and retry only work that needs retrying. Re-running an entire successful batch because a small subset failed can erase part of the savings. Include validation and any follow-up calls in the final cost.

Batch has its own capacity constraints and completion behavior. A lower token price is useful only if the job finishes within your deadline. For a nightly pipeline, allow time to inspect failures before the next business process needs the output. If the deadline is strict, include a planned fallback and its cost.

Do not automatically apply the token discount to storage, tools or external services. Use the relevant published category for each component. Likewise, check the actual batch cache rates instead of stacking discounts from memory.

Reasoning tokens and output budgets

For reasoning models, the visible answer may be shorter than the output billed. OpenAI's reasoning documentation describes reasoning-token usage and output-budget behavior. Inspect the returned usage fields when estimating costs; counting only displayed words can understate consumption.

As an illustration, assume a request incurs 2,000 input tokens and 5,500 billed output tokens at Sol's standard short-context rates. Its cost is $0.004 plus $0.055, or $0.059. If only 500 of those output tokens appear in the final answer, estimating from that visible answer would incorrectly produce $0.009.

This example does not imply every reasoning request uses eleven times its visible output. The ratio depends on the task and settings. Measure it for your workload, and keep the distribution rather than relying on one request. Difficult edge cases may behave very differently from routine examples.

Set a sensible output budget and test completion quality. An extremely low cap can produce incomplete work and trigger another paid attempt. A large cap can allow unnecessarily long output. The economical setting is one that produces acceptable completion with limited retries, not simply the smallest number.

Where the model supports reasoning-effort controls, compare settings on the same task set. Lower effort can reduce cost or latency, but should earn its place through acceptable results. Reserve more expensive settings for cases where the extra work improves the outcome enough to justify it.

Tools, search and storage can exceed token costs

The pricing reference lists built-in tool categories separately. Current non-preview web search is $10 per thousand calls plus applicable search-content tokens. File-search tool calls are $2.50 per thousand, with storage charged separately. Hosted execution environments have their own session and size rules. Verify the exact tool variant used by the application.

For a simple example, 10,000 web-search calls incur $100 in call fees before search-content tokens and answer generation. If the surrounding application had a $90 text-token estimate, adding that search usage already raises the subtotal to $190. A “one-cent answer” based on text alone would leave out a substantial part of the workflow.

A multi-step agent may search several times for one user request. Count tool invocations per completed task, including repeated searches after an error or an unhelpful result. The number of user messages is not a reliable substitute for the number of billed tool calls.

Storage costs depend on how much billable data remains stored and for how long. An ingestion workflow that continually adds documents without a retention policy can accumulate charges even during periods with few queries. Track stored volume separately from monthly query traffic.

Distinguish an application's own function calls from OpenAI-hosted tools. A custom function may incur costs in your infrastructure or another vendor's API, even if it is not priced as an OpenAI built-in tool. Put those charges in the total application estimate so provider switching does not make them disappear from the spreadsheet.

Embedding prices and retrieval budgets

The standard embedding rates are $0.02 per million input tokens for text-embedding-3-small and $0.13 for text-embedding-3-large. Embeddings produce vectors rather than a separately priced generated-text answer. The vector database and retrieval infrastructure are separate costs.

Embedding ten million tokens therefore costs $0.20 with the small model or $1.30 with the large model at those rates. This is only the embedding call. Chunk overlap, repeated ingestion and changed documents can increase the token total; storage, indexing and query serving may cost much more.

Separate initial corpus ingestion from recurring query embeddings and updates. For example, a document collection might be embedded once, while every incoming search creates another embedding request. A daily full rebuild also has a different budget from incremental updates to changed documents.

Choose the embedding model with retrieval evaluation, not price alone. A cheaper embedding model that retrieves the wrong passages can cause more expensive generation calls to fail. See the embedding-model comparison for dimensions, deployment constraints and an evaluation approach.

Images, audio and fine-tuning need separate estimates

Do not apply a text-token price directly to an image, a minute of audio or a training run. Those products have different billing dimensions and model-specific rules. Use the relevant section of the official pricing reference and the exact endpoint configuration.

For image input, record the model, image dimensions and requested detail behavior. For generated images, record output size, quality and number of images. For audio, distinguish transcription, generated speech and live interaction, because their units and usage patterns differ.

A multimodal conversation can contain several charge categories in one user interaction. Estimate each component, then combine them. A useful budget record identifies which fields come from provider usage data and which come from application assumptions such as average call duration.

Fine-tuning introduces training cost and potentially different inference pricing. Include evaluation runs, repeat training after changes and the expected life of the resulting model. A training run that reduces prompt length may save inference cost, but that benefit has to exceed training and maintenance cost over the expected volume.

Free access, credits and ChatGPT subscriptions

A free chat interface, an API usage tier, promotional credits and a paid subscription are different arrangements. Do not assume a ChatGPT plan creates an unlimited backend API allowance, or that a “Free” usage-tier label means the listed monthly usage limit is a credit grant.

OpenAI's API quickstart describes supported access and billing routes. Account-specific credits or subscriber access may apply under their stated terms. Check the route your application uses, the available balance and the applicable eligibility rules before treating a workload as funded.

For a production estimate, calculate the paid usage cost even if an introductory allowance covers early testing. That reveals what happens after the allowance expires or traffic grows. A prototype that costs nothing during development can still require a meaningful operating budget at launch.

Avoid planning around a universal dollar amount of free signup credit unless the current account explicitly receives it. Promotions and eligibility can change. A usage limit governs permitted usage; a prepaid balance or grant determines how that usage is funded.

Rate limits, usage tiers and spending controls

Rate limits constrain throughput, while spending controls constrain money. OpenAI documents request and token limits by model and account tier in its rate-limit guide. A request can hit a token-per-minute limit while plenty of monthly budget remains.

Check the organization and project limits visible to the account that will serve production traffic. Do not copy a limit from a different model or someone else's account. Long-context requests and shared model-family limits can also affect capacity.

For a bursty application, estimate peak requests and tokens per minute as well as monthly totals. Ten thousand requests spread across a month pose a different throughput problem from ten thousand requests arriving at once. A queue may smooth the burst, but only if the resulting delay meets the product's needs.

Use bounded retries with backoff for retryable failures, and inspect the error category. Repeating an invalid request or an exhausted-budget request does not resolve the underlying problem. Retried attempts can also create duplicate work unless the application tracks which tasks have already completed.

OpenAI's spend-limit documentation distinguishes alerts from enforced limits. An alert informs someone; it is not automatically a stop. Configure the intended control, test the application's behavior when it is reached, and avoid presenting an alert threshold as a guaranteed maximum bill.

Three monthly budget examples

These examples assume standard short-context rates, ordinary uncached input, no cache writes, no tools and no retries. They make the arithmetic visible so you can substitute actual usage. They do not assert that the named models have identical quality on these tasks.

A small support feature

At 10,000 requests with 2,000 input and 500 output tokens each, total usage is 20 million input and five million output. Luna costs $4.50, Terra $45 and Sol $90. If the feature searches the web, retrieves stored documents or escalates failed answers, those components must be added.

Evaluate groundedness and correct escalation alongside the price. A low token bill is useful only if answers help users. Include examples where the knowledge base lacks the answer, because a system that invents an answer can appear successful while creating downstream support work.

A daily classification process

Assume 100,000 monthly items, each with 500 input and 20 output tokens. At Luna's rates, 50 million input tokens cost $5 and two million output tokens cost $1, for $6 total. Sol at the same token counts costs $120. Those totals scale linearly with volume under these assumptions.

If the classification can wait, compare supported batch processing. If the label triggers an expensive operational action, include an acceptance check or review path. A small model's dollar saving is not enough to justify silent misclassification in a consequential workflow.

A long-document analysis tool

Assume 1,000 requests, each with 100,000 input and 2,000 output tokens. Sol's short-context token cost is $200 input plus $20 output, or $220. Astra's corresponding total is $1,100. The inputs in this example remain below the long-context price threshold.

The original document may be reused across follow-up questions, making caching relevant. Alternatively, retrieval may reduce the amount sent each time. Compare those designs with questions requiring both local detail and relationships across the document; a cheaper architecture should still answer the questions the product promises to handle.

Building a budget that survives real traffic

Start with a table of features rather than one organization-wide average. A chat feature, document workflow and classification job each have their own request count, token mix, model and latency requirement. Keeping them separate makes cost changes explainable.

Record successful and unsuccessful attempts. Include retries after timeouts, validation calls, escalations and background work that users never see. Then divide total cost by completed, accepted tasks. This produces a more useful unit cost than dividing by every API response, including unusable ones.

Keep price assumptions separate from usage assumptions. Store the date, source and model identifier with each rate. When a provider updates a price, change that input without also changing the assumed request volume. This makes it possible to explain why the forecast moved.

Create a high-usage scenario as well as a typical one. Increase request volume, output length, retry rate and cache misses independently to see which factor matters most. An arbitrary contingency percentage can hide the actual driver; explicit scenarios show which controls deserve attention.

Reconcile the estimate with usage data by model and feature. If the bill is larger than expected, inspect reasoning usage, growing conversation history, cache writes, repeated tool calls and failed requests. Change the cause before reducing answer quality across the entire application.

GPT-4.1 Mini versus GPT-4o Mini: a reference cost comparison

For existing budgets, compare both sides of the token bill. At the reference rates above, GPT-4.1 Mini is $0.40 input and $1.60 output per million tokens. GPT-4o Mini is $0.15 input and $0.60 output. On a hypothetical uncached request with 2,000 input and 500 output tokens, those rates produce $0.0016 and $0.0006 respectively.

Across 10,000 identical requests, the estimates are $16 and $6. GPT-4.1 Mini's token bill is about 2.67 times the GPT-4o Mini bill for this workload, a $10 monthly difference. This comparison does not override lifecycle status, establish equal quality or recommend either older model for a new application. It helps explain a budget or usage export that still names them.

Measure the work that matters before treating the $10 as a saving. If changing models creates additional invalid fields, failed tool calls or human corrections, include those outcomes. Conversely, do not pay for a stronger model merely because its name sounds more capable if a supported cheaper candidate meets the requirement. The relevant result is accepted work at a known total cost.

Is GPT-5 five times the price of GPT-4.1?

No blanket multiplier follows from the published reference rates. GPT-5's ordinary input rate is $1.25 per million and output is $10; GPT-4.1's are $2 and $8. GPT-5 has the lower input rate and the higher output rate in this comparison. The workload determines which token total is lower.

For 2,000 input and 500 output tokens, GPT-5's reference calculation is $0.0025 + $0.005 = $0.0075, compared with GPT-4.1's $0.008. For 1,000 input and 2,000 output tokens, the calculations are $0.02125 and $0.018. These examples use ordinary input and billed output without caching, tools or additional reasoning beyond the stated output amount.

The arithmetic break-even occurs when the $0.75 per-million input saving equals the $2 per-million output increase. With input volume I and output volume O, that is 0.75 × I = 2 × O, or O / I = 0.375. Below that output-to-input ratio, the GPT-5 reference token total is lower; above it, GPT-4.1's is lower. Actual model output lengths need not match, so this is a fixed-workload comparison rather than a prediction of production spending.

What does a $50 or $5,000 token budget buy?

Using the illustrative Sol request already calculated above, each uncached 2,000-input, 500-output request costs $0.009 before tools and other charges. A $50 token budget therefore covers at most 5,555 complete requests at that shape: floor($50 / $0.009). A $5,000 budget covers 555,555. These are arithmetic capacities, not account quotas or promises that every request returns an acceptable answer.

If 20% of user tasks require a second identical attempt, the average becomes 1.2 requests per task. The expected token cost per task is then $0.0108. At that assumed retry mix, $50 supports roughly 4,629 tasks, and $5,000 roughly 462,962. In practice the retry requests may contain the failed output and more context, so measure them separately instead of assuming identical cost.

A dollar budget also says nothing about how quickly those tasks can finish. The application may hit a request or token rate limit before spending the balance. Keep the budget calculation alongside a throughput estimate and a stop/resume plan. A spending alert cannot guarantee that all in-flight requests stop at precisely the alert amount.

A complete input-category example

Consider a hypothetical short-context Sol usage record containing 1 million ordinary input tokens, 2 million tokens written with the 30-minute cache option, 5 million cache-read tokens and 0.8 million billed output tokens. Using the table above, the calculation is:

CategoryVolumeRate per millionCost
Ordinary input1 million$2.00$2.00
30-minute cache writes2 million$2.50$5.00
Cache reads5 million$0.10$0.50
Billed output0.8 million$10.00$8.00
Total model tokens8 million input; 0.8 million outputSeparate category rates$15.50

The 8 million total input tokens are partitioned into the three input categories. Charging all 8 million again at the ordinary input rate would double-count input. For an all-ordinary-input comparison with the same input and output totals, the cost would be 8 × $2 + 0.8 × $10 = $24. The example saves $8.50, or about 35.4% of that token total, under the stated cache assumptions.

This is a normalized accounting example, not an API response schema. Use the actual usage fields and definitions for your endpoint. The prompt-caching documentation explains the distinction between cache reads, writes and ordinary input. Preserve the original usage record so the category mapping can be checked later.

Put different application features in separate budget rows

A product can use more than one model without routing every request through every model. Suppose the monthly design includes the 10,000-answer Sol support feature at $90 and the 100,000-item Luna classification process at $6 from the examples above. Their combined model-token estimate is $96. Keeping them separate lets you explain which feature caused a cost increase.

If support volume doubles while classification remains unchanged, the estimate becomes $180 + $6 = $186. If classification volume doubles while support remains unchanged, it becomes $90 + $12 = $102. A single blended cost per “AI request” hides this difference because the features have different token shapes and model rates.

Add a tool row only when the feature calls that tool. For example, if 2,000 of the support tasks each make one currently priced $10-per-thousand web-search call, call fees add $20. Search-content tokens and any extra generation remain separate. Do not apply those call fees to classification tasks that never search.

Use the same feature identifiers in application logs and cost reporting. Record the model, task identifier, attempt number, token categories and tool counts without putting sensitive prompt contents into a general-purpose finance export. This makes cost reconciliation possible while retaining access controls over the source material.

Common spreadsheet errors to catch before launch

Check units first. A rate per million tokens and a usage figure measured in thousands need conversion before multiplication. Confirm that monetary credits are treated as a payment adjustment rather than a lower model rate. A credit can reduce the amount due for a period without changing the cost of the next request after the credit is exhausted.

Next, check double-counting. Cached tokens should not appear in both ordinary and cached input totals. Reasoning tokens reported within billed output should not be added a second time. A tool's returned content may produce model input charges in addition to its call fee; those are different charges, not accidental duplicates.

Finally, check omitted work. Background evaluations, retries, failed attempts, generated alternatives and validation calls can consume resources without appearing as successful user tasks. A forecast based only on accepted final answers will miss that activity. Keep the raw accounting view and the cost-per-accepted-task view side by side so the denominator stays clear.

OpenAI versus Anthropic: compare the same token workload

A provider comparison needs a named model pair and a fixed request shape. OpenAI and Anthropic each offer models at several price levels. Comparing one company's smallest model with another company's most expensive model answers a price question about those endpoints, not a general question about which company costs less.

The following calculation uses 10,000 requests with 2,000 input and 500 billed output tokens each: 20 million input and 5 million output tokens in total. It assumes standard uncached text processing, no tools and no retries. The OpenAI rates come from the pricing reference above; Claude rates come from Anthropic's pricing documentation, checked October 28, 2026.

ModelInput / output per millionMonthly token calculation
GPT-6 Luna$0.10 / $0.5020 × $0.10 + 5 × $0.50 = $4.50
Claude Haiku 5.5, prompts up to 100,000 tokens$0.10 / $0.5020 × $0.10 + 5 × $0.50 = $4.50
GPT-6.1 Sol, short context$2 / $1020 × $2 + 5 × $10 = $90
Claude Sonnet 5.5$2 / $1020 × $2 + 5 × $10 = $90
Claude Opus 5.5$4 / $2020 × $4 + 5 × $20 = $180

Equal list-price calculations do not imply equal output quality, latency or production bills. A model may return longer answers, require a different prompt or need fewer correction attempts. Record the observed usage for the same accepted tasks before selecting a provider. Keep these fixed-token calculations as a reference that isolates the rate difference.

Context bands also differ. The Haiku row applies to prompts up to 100,000 tokens; its documented rates above that threshold are $0.50 input and $2.50 output per million. Sol's short-context threshold in this guide is 272,000 input tokens. Do not carry the equal-cost conclusion into a long-document workload without recalculating each model's applicable band.

How much can optimization save without changing the task?

A blanket claim that every application can cut its OpenAI bill by 60% is not a useful forecast. The saving depends on where the current application spends money. Start with one measured workload and change one assumption at a time. The $90 Sol scenario above provides a simple reference: $40 input plus $50 output.

If all 20 million input tokens in that scenario qualified as cache reads at $0.10 per million, the token estimate would become $2 input plus $50 output, or $52. That is a $38 reduction, approximately 42.2% of the original bill. This deliberately idealized comparison excludes cache creation and misses. It shows why an input discount alone cannot promise a 60% reduction when output already represents more than half of the starting cost.

Now keep the input uncached but reduce billed output from 500 to 300 tokens per request. The output total becomes 3 million tokens, making the estimate $40 + $30 = $70. That saves $20, approximately 22.2%. It is useful only if the shorter result still completes the task. Removing required explanations or fields to improve this spreadsheet can increase correction work elsewhere.

Combining those two illustrative changes gives $2 cached input plus $30 output, or $32 before cache-write costs and misses. The reduction from $90 is $58, approximately 64.4%. This is a conditional calculation, not a measured result or a promised saving. Validate cache behavior and answer acceptance separately before using it in a forecast.

Model substitution is another independent decision. Luna prices the original token shape at $4.50, but that does not establish that it can replace Sol for the application. Run the saved tasks, include failures and count accepted results. If the cheaper route requires a second model on some tasks, add both attempts instead of pricing only the final answer.

Forecast the cost of a complete conversation

A chat feature can have a low first-turn cost and a much larger session cost because later requests include prior conversation. Create a turn-by-turn estimate from the exact context your application sends. Include system instructions, retrieved passages, tool responses and earlier messages where they are supplied again. Do not multiply the first turn's input by the number of turns unless the inputs stay that size.

For a hypothetical three-turn Sol session, suppose input totals are 2,000, 3,000 and 4,000 tokens, with 500 billed output tokens per turn. Uncached input totals 9,000 tokens and costs $0.018. Output totals 1,500 and costs $0.015. The session costs $0.033 before tools and retries. At 10,000 such sessions, the token estimate is $330.

Pricing all three turns as copies of the first would instead produce 6,000 input tokens and 1,500 output tokens, or $0.027 per session and $270 for the month. The $60 difference comes entirely from the additional context. These token counts are illustrative; capture actual usage by turn to find the pattern in your product.

If the application summarizes earlier conversation, price the summary call and test whether important facts survive. If it retrieves fewer passages, evaluate answer grounding. If it reuses a stable prompt prefix, measure eligible cache reads and misses. Each optimization changes part of the system, so keep a quality check beside the cost calculation rather than assuming fewer tokens always means a better application.

A release check for the pricing estimate

Before increasing traffic, take one completed session and trace every billed operation back to its task identifier. Confirm the model version, context band, input categories, billed output, tool calls and retry attempts. Compare the resulting sum with the application's estimate. Resolve a mismatch on this small case before multiplying it by a monthly traffic forecast.

Keep the reference session, rate source and calculation with the release record. When a prompt, model or retrieval configuration changes, rerun that example and the quality evaluation. This makes a price update reviewable: the next person can see whether the change came from a vendor rate, a longer conversation or additional work performed by the application.

What should a pricing update record contain?

Keep the previous rate, replacement rate, affected model and processing tier, source URL, and effective date where the provider specifies one. Distinguish the date you checked the documentation from the date a price took effect. A new editorial timestamp does not establish that the provider changed its prices that day.

For a billing window that spans a confirmed price change, split usage at the applicable boundary before calculating the total. Preserve the old calculation for historical invoices and use the new rate for the forward forecast. Do not rewrite prior estimates as though today's price had applied throughout the month.

Choosing the lowest-cost model that meets the task

Build a small evaluation set with ordinary cases and known difficult cases. Define what counts as acceptable before looking at model outputs. For extraction, compare required fields; for support, verify grounding; for code, run relevant tests and inspect the change.

Try a lower-cost candidate alongside the current model. Measure billed usage, latency and accepted results. If the candidate meets the threshold, expand gradually. If it fails only on a recognizable subset, routing may make sense, provided the detector and fallback are included in the cost.

For a two-stage workflow, every escalated task pays for the initial attempt plus the fallback. Add any model-based classifier or validator too. A routing budget that prices only the final successful call understates spending and may make a complicated architecture look cheaper than it is.

For provider comparisons, use the LLM API pricing comparison. For deployment and service selection, see the AI API provider guide. Keep the model, rate category and workload assumptions attached to every estimate so the decision can be revisited when prices or requirements change.

AI coding tools move fast

Weekly data on which tools developers are adopting, pricing changes, and new releases worth knowing about.

Illustrated portrait of Rome Thorndike

Rome Thorndike

Rome Thorndike is the CEO & Founder of Provyx, which provides GTM intelligence and data validation for healthcare companies, including EngagedMD and BTL Industries. He writes The AI News Digest for over 3,000 subscribers and has worked in Azure AI/ML enterprise sales and AI-company customer delivery.

Connect on LinkedIn