OpenAI model guide

OpenAI Models & Token Cost Calculator

Compare the GPT-5.6 family, estimate one request or a full month of traffic, and see exactly which part of a prompt reaches your bill.

In short: pick a model, run the free calculator below to price your requests, then use the usage guide and routing tips further down to keep that estimate accurate as your traffic grows.

Count Tokens Locally

The short version

Sol is for your hardest reasoning and coding work. Terra is the balanced, everyday default. Luna is the budget option for simple, repeatable jobs at volume. Run the same test set against all three before picking one — the cheapest model on paper is only a good deal if it still gets the job done reliably.

Choosing within the GPT-5.6 family

Same large context window, three very different budgets.

GPT-5.6 Terra

Balanced production default

1.05M / 128K context / output

Input $2.00 · Output $12.00 per 1M tokens

GPT-5.6 Sol

Hard reasoning & coding

1.05M / 128K context / output

Input $4.00 · Output $20.00 per 1M tokens

GPT-6 Astra

Newest flagship, rolling out

1.05M / 128K context / output

Input $10.00 · Output $50.00 per 1M tokens

Estimate OpenAI API cost

Enter a request pattern, or start from an example workload below.

This OpenAI token calculator doubles as a GPT token cost calculator and monthly API cost estimator — switch currencies, share a saved estimate, or let the recommendation engine suggest a model based on your numbers.

Currency:

Prices convert live in your chosen currency (approximate FX). The share button copies a link that reopens this exact estimate for anyone you send it to.

How this is calculated: (input tokens × input rate) + (cached tokens × cache rate) + (output tokens × output rate), divided by 1,000,000. For GPT-5.6 Sol right now: (1,200 × $4) + (600 × $0.4) + (350 × $20), ÷ 1,000,000 = $0.0120 per request.

Which model fits this workload?

Using Terra as a baseline for this request pattern: switching simple, repeatable requests to Luna would cut this workload's monthly cost by about 90% — worth testing if your task doesn't need Terra's extra reasoning. Escalating to Sol instead would add roughly 79% to the bill — only worth it if Terra's answers are genuinely falling short on quality.

Lowest monthly estimate
$10.08
GPT-5.6 Luna
Highest monthly estimate
$1,485
GPT-5.5 Pro
Per request $0.0990
Input
$30.00
Cache
—
Output
$180.00
Context1.05M / 128K
Per month$1,485
Per request $0.0990
Input
$30.00
Cache
—
Output
$180.00
Context1.05M / 128K
Per month$1,485
Per request $0.0600
Input
$15.00
Cache
—
Output
$120.00
Context1.05M / 128K
Per month$900.00
Per request $0.0420
Input
$12.50
Cache
$1.250
Output
$75.00
Context1.05M / 128K
Per month$630.00
Per request $0.0301
Input
$10.00
Cache
$1.000
Output
$50.00
Context1.05M / 128K
Per month$451.50
Per request $0.0168
Input
$5.00
Cache
$0.500
Output
$30.00
Context1.05M / 128K
Per month$252.00
Per request $0.0120
Input
$4.00
Cache
$0.400
Output
$20.00
Context1.05M / 128K
Per month$180.60
Per request $0.0084
Input
$2.50
Cache
$0.250
Output
$15.00
Context1.05M / 128K
Per month$126.00
Per request $0.0067
Input
$2.00
Cache
$0.200
Output
$12.00
Context1.05M / 128K
Per month$100.80
Per request $0.0051
Input
$1.25
Cache
$0.130
Output
$10.00
Context1.05M / 128K
Per month$76.17
Per request $0.0025
Input
$0.75
Cache
$0.075
Output
$4.50
Context400K / 128K
Per month$37.80
Per request $0.0007
Input
$0.20
Cache
$0.020
Output
$1.25
Context400K / 128K
Per month$10.34
Per request $0.0007
Input
$0.20
Cache
$0.020
Output
$1.20
Context1.05M / 128K
Per month$10.08

How to actually use this calculator

A pricing table only tells you the rate per million tokens. It doesn't tell you what your app will cost this month, or which model still gets the job done once you switch to the cheaper one. That's the gap this tool closes — here's exactly when to reach for it and how to get a number you can actually trust.

When to reach for this calculator

  • Before you ship an AI feature. Estimate monthly cost at your expected traffic before it's live, not after the first invoice surprises you.
  • When choosing between Sol, Terra, and Luna. See the actual dollar gap for your workload instead of guessing from the rate card alone.
  • When a product manager or client asks "what will this cost at scale?" Change the monthly-requests field and get a defensible number in seconds — the share link makes it easy to hand over.
  • When you're deciding whether caching is worth building. Move tokens from the input field into the cached field and watch the monthly estimate drop.
  • When you're budgeting OpenAI against Claude, Gemini, or DeepSeek. Run the same request pattern through this page's sibling guides and compare the monthly totals side by side.

Getting a number you can trust, step by step

1

Start from a preset, not a guess

Click Support reply, Coding review, or Document extraction above the calculator to load realistic token counts, then tweak them to match your actual prompt and response lengths.

2

Read the per-request and monthly numbers together

A per-request cost that looks tiny can still add up to a real monthly bill once you multiply it by your expected volume — always check both figures before deciding a model is "cheap enough."

3

Let the recommendation box do the comparison

The panel above the table converts the Luna/Sol difference into a percentage of your Terra baseline, so you're comparing against your own workload instead of a generic example.

4

Share the estimate instead of re-explaining it

The "Share this estimate" button encodes your exact inputs into a link. Send it to a teammate, a client, or your future self — it reopens with the same numbers already filled in.

5

Re-check it once real traffic exists

A pre-launch estimate is a forecast. Once your feature is live, pull real numbers from the API response (see below) and plug those back into the calculator to correct your monthly projection.

Checking your estimate against real API usage

This calculator is a planning tool — the number that actually determines your bill is the usage object OpenAI returns with every API response. Once your feature is live, pull that field and compare it to what you assumed here.

# one-time setup
pip install openai python-dotenv

# in your app
from openai import OpenAI
client = OpenAI()  # reads OPENAI_API_KEY from your environment

response = client.chat.completions.create(
    model="your-model-name",
    messages=[{"role": "user", "content": "Hello"}],
)

print(response.usage)
# -> prompt_tokens, cached_tokens, completion_tokens, total_tokens

Feed those real prompt_tokens, cached_tokens, and completion_tokens figures back into the input, cached, and output fields above — that turns this from a rough forecast into an estimate grounded in your own traffic.

Codex pricing: subscription plan vs. API tokens

This is the single most common mix-up people searching for "Codex pricing" run into, because OpenAI sells Codex access two different ways:

Codex inside a ChatGPT planBundled into ChatGPT Plus, Pro, Business, or Enterprise as a flat monthly subscription with its own usage limits — no separate per-token bill, and not something this calculator estimates.
Codex through the APICalling GPT-5-Codex directly from your own code, billed per token like any other model in the table above — this is what the calculator on this page prices.

If you're a developer wiring Codex into your own coding agent or CI pipeline, use the calculator above. If you're an individual using the Codex CLI or IDE extension under a personal ChatGPT plan, check your subscription's usage limits instead — the current plan tiers and included usage are listed on OpenAI's official pricing page linked at the bottom of this guide.

Running these models through Azure OpenAI instead of OpenAI's own API? Rates are set separately by Microsoft and don't always match the numbers above — treat this calculator as your OpenAI-direct baseline, then confirm the Azure rate for your region and deployment before budgeting an Azure-hosted rollout.

What goes into an OpenAI request

Most people estimate cost by looking at the message they typed. That's usually the smallest piece of what actually gets billed. An API request is built up in layers, mostly invisible to the person using the app, and every layer costs something. Understanding those layers — not just the pricing table — is what actually lets you predict a bill before it arrives.

Normal input

Any new text the model hasn't seen cached — the user's message, freshly retrieved documents, or anything that changes request to request.

Example: a support bot pulls 3 fresh help-center articles for every new question. Those articles count as normal input every single time, even though the question itself is short.

The trap: people estimate cost from the user's visible message and forget everything the app quietly attaches behind the scenes.

Cached input

A stable prefix — like a long system prompt or few-shot examples — that stays identical across requests can qualify for a cheaper cached rate.

Example: a coding assistant sends the same 2,000-token style guide as a system prompt on every call. If that prefix doesn't change, repeat calls can bill it at the cached rate instead of the full input rate.

The trap: caching needs an exact, unchanged prefix. Adding a timestamp or a small variable at the start of your system prompt can silently break the match and put you back on full-price input.

Generated output

What the model writes back. This is usually priced higher than input, so a longer or less-constrained response costs more than a longer prompt would.

Example: asking for a one-paragraph summary instead of a full rewritten document can cut output cost dramatically, even if the input stays the same size.

The trap: output is the most expensive token type per unit, but it's also the easiest to control — a tighter format instruction often saves more money than trimming the prompt.

Long context and extras

Some models switch to a higher rate once a request crosses a long-context threshold (often measured in the hundreds of thousands of tokens). Separately, features like tool calls, web search, image or audio input, and cache writes are billed on top of plain text and aren't included in a simple text estimate.

Example: a request that's normally $0.08 can jump past a long-context threshold if you attach a 300-page document, and the whole request — not just the extra pages — may re-price at the higher tier.

The trap: a text-only calculator (including this one) won't show these charges. Treat it as your floor, not your ceiling, once tools or large attachments are involved.

Walking through one real request

Say you're running a customer-support chatbot. A user types: "Can I get a refund on order #4471?" — eleven words. Here's everything that actually goes into the request the model receives:

System prompt (cached)Instructions telling the model how to behave, your tone, and what it can and can't promise — roughly 1,500 tokens, unchanged across every request.
Conversation history (normal input)The last few messages in this chat, so the model has context — grows as the conversation continues.
Retrieved refund policy (normal input)Your app looks up the relevant policy section and attaches it so the model answers accurately instead of guessing — another few hundred tokens.
The user's actual message (normal input)The eleven words the person typed. In this whole request, it's a small fraction of the total.
The model's answer (output)A short, policy-accurate reply — priced at the higher output rate.

The eleven-word question is almost free on its own. The system prompt, conversation history, and retrieved policy text are what actually determine the bill — and they're invisible to the user and easy for a developer to forget when estimating cost from "how long is the prompt."

Common mistakes that quietly inflate a bill

  • • Estimating cost from the user's message only, ignoring system prompts and retrieved context
  • • Letting conversation history grow unbounded instead of trimming or summarizing older turns
  • • Adding a timestamp or session ID at the start of a cached prompt, which breaks the cache match
  • • Leaving output length unconstrained when a short, structured answer would do
  • • Testing on a small sample and forecasting monthly cost without accounting for your heaviest users

Other OpenAI models worth knowing

Beyond the general-purpose Sol / Terra / Luna lineup, a few purpose-built variants fit specific jobs.

GPT-5-Codex

Built for coding agents, not chat

Regular chat models answer one question at a time. Codex is tuned for the opposite: it's meant to sit inside a coding agent (think Cursor or a CI pipeline) that reads your repository, plans a multi-file change, runs commands, checks the output, and fixes its own mistakes — all in one continuous session.

When to use itUse it when you're building or wiring up an autonomous coding workflow, not for a simple one-off 'explain this function' question — a cheaper general model handles that fine.
Watch out forBecause an agent session can call the model dozens of times in a row (read a file, write a file, run a test, read the error, try again), the token count for one 'task' can be far higher than it looks from the outside. Budget per completed task, not per individual call.

GPT-5 Pro

Maximum depth, no shortcuts

This is the model OpenAI points to when a task genuinely needs the most careful, thorough reasoning available — the kind of problem where a wrong answer is expensive and a slower, more expensive model is worth it.

When to use itUse it sparingly, for the small slice of requests where Sol's answers aren't good enough and the cost of a mistake outweighs the token bill.
Watch out forThere's no cached-input discount on this model at all, so every token — even a system prompt you send unchanged 1,000 times — is billed at the full input rate. That absence of caching is easy to miss when you're comparing rate cards.

GPT-5.6 Cyber

Built for regulated, security-sensitive work

A variant aimed at teams in security, compliance, or other regulated environments where the model needs to run under stricter data-handling and audit requirements than the standard consumer-facing models.

When to use itOnly worth the premium if your organization actually needs those compliance guarantees — for everyday product features, a standard model in the same family is functionally similar at a fraction of the price.
Watch out forThe rate card is roughly 2.5x GPT-5.6 Sol for input and output. That premium is for the compliance layer, not extra reasoning ability — don't reach for it expecting a smarter model.

A practical routing pattern

How to actually decide which model handles which request.

1

Start with Terra

Build a small set of real examples from your own use case and see how it performs — this becomes your quality baseline.

2

Test Luna on the easy cases

Re-run the simple, repeatable requests (classification, short extraction) on Luna. If the results hold up, route those there permanently.

3

Escalate to Sol selectively

Only send the requests that genuinely need deeper reasoning to Sol — not everything, just the cases where Terra's answers fall short.

4

Measure the whole request, not just the prompt

Your forecast should include system instructions, retrieved context, and expected output length — not only the text box the user sees.

OpenAI token calculator FAQ