Guilds AI / Blog

,

OpenAI API Cost: Token Pricing and Cost Calculator Guide

Laptop with an illustrative OpenAI API cost calculator and icons for token pricing, caching and monthly spending.

OpenAI API costs depend on the model, the number of input and output tokens, cache usage and additional services. For standard short-context requests, GPT-6.2 Sol costs $2 per million ordinary input tokens and $10 per million output tokens, while GPT-6.2 Astra costs $8 and $40 respectively. GPT-6 Luna offers a lower-cost option at $0.10 for input and $0.50 for output. These rates were checked against OpenAI’s documentation on December 4, 2026. A ChatGPT subscription and API billing are separate, although eligible subscribers can claim API credits. For the distinction between API billing and coding-agent subscription access, see our Cline vs Codex comparison. If you use Codex while signed into ChatGPT rather than with an API key, see our Codex Plus vs Pro guide for subscription allowances. For signed-in agentic workflows rather than direct API billing, see our ChatGPT Work vs Codex guide. For the distinction between Google’s prototyping allowance and production API costs, see our Google AI Studio vs ChatGPT guide. For a cross-provider rate comparison and worked monthly estimates, see our guide to how much AI tokens cost.

How much does the OpenAI API cost?

The table shows selected models at Standard rates for requests within the short-context pricing band. Prices are in US dollars per million tokens, before applicable taxes, tool fees and processing adjustments. Check the exact model identifier before applying these rates.

ModelOrdinary inputCached input30-minute cache writeOutput
GPT-6.2 Astra$8.00$0.40$10.00$40.00
GPT-6.2 Sol$2.00$0.10$2.50$10.00
GPT-6.1 Sol$2.00$0.10$2.50$10.00
GPT-6 Luna$0.10$0.01$0.125$0.50

The GPT-6.2 Astra and Sol documentation specifies a higher rate for requests with more than 272,000 input tokens: input and cache rates double, and output rates increase by 50% for the full request. A request just above the threshold can therefore cost considerably more than one just below it. GPT-6 Luna also documents this pricing threshold.

The best-value model is the least costly one that reliably completes your task. Compare alternatives using the same inputs and acceptance criteria; our OpenAI API alternatives guide covers other model providers.

How token billing works

A token is a unit of model input or output, not necessarily a word or character. Prompts, system instructions, retrieved documents and previous conversation context can all contribute to input usage. Generated text and billable reasoning contribute to output usage.

Cache reads represent reused input billed at the model’s cached-input rate. Cache writes can be billed separately from ordinary input for models that support explicit cache retention pricing. When estimating spend from API usage fields, separate these categories rather than charging cached or written tokens twice. Consult the specific endpoint’s usage-field documentation.

A short visible answer can still incur substantial output charges if the model uses reasoning tokens. For a real application, capture usage from each response, including billed output, rather than estimating cost from the displayed response alone.

OpenAI API cost calculator examples

To calculate a request’s model-token cost, multiply each mutually exclusive token category by its applicable price per million, sum the results, then divide by one million. Add any tool, storage or other usage fees. The formula below separates ordinary input, cached input, cache writes and output.

If one task takes several requests, use the AI Agent Cost Calculator to include retries and tool fees in your monthly estimate.

Model cost = (ordinary input × input rate + cache reads × read rate + cache writes × write rate + output × output rate) ÷ 1,000,000. If cache writes use different retention periods, calculate each write category at its own rate.

For example, a GPT-6.2 Sol request with 2,000 ordinary input tokens and 500 billed output tokens costs $0.009: $0.004 for input and $0.005 for output. Ten thousand identical requests cost $90. The equivalent Astra model-token cost is $360. The difference is a price comparison, not a claim about response quality.

Model2,000 input + 500 output10,000 identical requests
GPT-6.2 Astra$0.036$360.00
GPT-6.2 Sol$0.009$90.00
GPT-6 Luna$0.00045$4.50

For a spreadsheet calculator, enter request count in B2, ordinary input tokens per request in B3, cached input in B4, cache writes in B5, billed output in B6, and the corresponding prices per million in C3 through C6. Use the formula =B2*SUMPRODUCT(B3:B6,C3:C6)/1000000. Keep tool fees and fixed charges in separate cells. Do not apply short-context prices to requests that enter the long-context band.

Consider a long-context Sol request with 300,000 ordinary input tokens and 2,000 output tokens. Under the documented higher pricing band, input is $4 per million and output is $15 per million. The request costs $1.23 before tools, rather than $0.62 at short-context rates. Calculate the band for each request rather than using only monthly aggregate token totals.

Caching, Batch and processing tiers

Prompt caching can reduce repeated input costs, especially when a large portion of the prompt remains unchanged. OpenAI documents lower read rates and cache-write costs for supported models. GPT-6.2 Sol, for example, has a $2.50 per million 30-minute cache-write rate and a $5 per million 12-hour write rate at Standard short-context pricing.

Suppose 20 Sol requests share a 10,000-token prefix and each has 1,000 ordinary input tokens plus 500 billed output tokens. Without caching, their model cost is $0.54. If the first prefix is charged as a 30-minute cache write and the other 19 requests read the cached prefix, the cost is $0.184: $0.025 for the write, $0.019 for the reads, $0.04 for remaining input and $0.10 for output. This illustrative scenario assumes successful reuse within the cache lifetime; actual cache behavior varies.

Processing optionHow it affects selected GPT-6.2 models
StandardBaseline prices
Batch50% of Standard token rates for eligible asynchronous work
Fast2× Standard rates
Ultrafast3× Standard through February 28, 2027; 6× starting March 1, 2027, Pacific time
Eligible background requests30% below Standard for a 2-hour window; 40% below for an 8-hour window

The official pricing page also lists Flex on selected older models while its beta is being wound down. Do not assume it is available on newly released models. Regional processing for applicable models released on or after March 5, 2026 adds a 10% uplift. Check the exact deployment and service tier before combining estimates; not every feature or modifier is compatible.

OpenAI embedding cost and additional fees

Embedding requests are billed by input tokens. OpenAI’s embedding guide gives examples equivalent to approximately $0.02 per million tokens for text-embedding-3-small and $0.13 per million for text-embedding-3-large. Indexing 50,000 document chunks averaging 400 tokens each consumes 20 million tokens, costing approximately $0.40 or $2.60 respectively. Vector storage and retrieval infrastructure are separate costs; re-embedding updated documents also adds usage.

Built-in tools can add fees even when the model-token estimate is correct. The current API pricing page lists the following examples.

ServiceListed fee
Web search$10 per 1,000 calls, plus applicable search-content tokens
Responses API file search calls$2.50 per 1,000 calls
File search storage$0.10 per GB per day; first GB free
Hosted container (1 GB)$0.03 per 20-minute session; eligible sessions may use per-minute billing with a minimum

For example, 10,000 standard web searches add $100 in call fees before model usage and applicable search-content tokens. An agent that searches several times per user request can therefore cost more than a simple one-response application. Image generation, audio and other modalities have separate prices and billing units; use their specific rates.

OpenAI API credits and subscription billing

API access is not the same as buying a ChatGPT plan. OpenAI currently documents a credit benefit for eligible Pro and Business subscribers that must be claimed by an owner and linked to an eligible API organization. Monthly Pro grants correspond to the eligible $100, $200 and $500 tiers; Business Standard and Premium grants are based on paid seats and subject to a workspace cap. Check eligibility, expiration and the actual allowance before budgeting.

The grant pays eligible usage on the linked API organization. It does not increase ChatGPT message limits or signed-in Codex limits, and unused credits expire under the grant’s terms. If credits run out, purchased credits can cover further usage when available; otherwise requests may fail. Auto-recharge settings can add paid credits, so configure them deliberately.

For help setting up an organization and credentials, see our OpenAI API platform guide. If you are using the Playground, our ChatGPT vs OpenAI Playground comparison explains the billing distinction.

How to control API spending

Budget from a representative sample of your actual requests. Record the model, processing tier, token categories, tools used and whether the response passed your acceptance checks. Measure cost per successful task, not just average cost per request. A cheap response that triggers repeated attempts or manual correction may cost more overall.

Use smaller models where they meet the quality requirement; limit unnecessary context and output length; reuse stable prompt prefixes when appropriate; use asynchronous processing for nonurgent jobs; cap tool loops and retries; and separate application projects so that usage can be attributed accurately.

Application-side quotas should protect against unexpectedly expensive requests. Set limits per user or workflow and stop new requests when your own enforced budget is reached. Provider dashboard budget alerts may not act as hard spending caps. Reconcile your estimates against the actual usage and billing records, and update your price table when models or billing rules change. Our AI evals guide explains how to preserve task quality while optimizing model costs.

Frequently asked questions

How much does one million OpenAI tokens cost? It depends on the model and token category. GPT-6.2 Sol Standard short-context ordinary input is $2 per million, while billed output is $10 per million. Cached input and writes have separate rates.

Is the OpenAI API free? It is generally usage-based. Eligible credits can cover some usage, but a free ChatGPT account or a regular subscription does not automatically supply unlimited API access.

How do I calculate the cost of a chatbot? Estimate the input, cached input, write and output tokens for each turn, including repeated context and tool calls. Multiply by the expected volume and add fees for any other services.

Do reasoning tokens cost money? Yes, where a model uses billable reasoning tokens, these form part of its output usage. Use the reported token counts instead of the visible answer length.

Can I cap my monthly API bill? Use project monitoring and applicable billing controls, together with enforced application-side budgets and rate limits. Verify the actual behavior of any provider spending control before depending on it.