No cache
$0.0340
All 12,000 input tokens are billed at the regular input rate. Use this as the baseline.
Estimate one API request from OpenAI, Claude, Grok, or Gemini usage JSON.
A full response can identify the model. If you paste only usage, select the exact model.
POST /v1/responses in your API client or application logs. With streaming, take the response object inside response.completed.usage object and select the model that made the request. Keep the cache read and write details.Desktop app. To check your ChatGPT plan usage, open Settings or the Codex usage dashboard. For a chat in the app, there is no documented export of the single-request API JSON this calculator accepts.
Terminal (Codex CLI). To see token counts for a new run:
codex exec --json --sandbox read-only "Reply with OK" > codex-run.jsonl.codex-run.jsonl and find the line with "type":"turn.completed". Its usage object holds the reported counts.The CLI counts can cover several API calls. To calculate a price here, paste one original Responses API reply from your API client or logs.
Codex plan and usage help Codex CLI JSON events (official source)POST /v1/messages. If you use streaming, take the final message assembled by your SDK.usage object. Keep cache_creation if present so the calculator can price 5-minute and 1-hour cache writes separately.For a new CLI run, use claude -p "Your prompt" --output-format stream-json --verbose. Find a completed assistant event and copy its inner message object with model and usage. The Agent SDK exposes the same object on assistant messages.
Paste one message at a time. For a whole run, use the totals in the CLI result or your billing dashboard.
Claude Code JSON output guide Agent SDK assistant messagePOST /v1/responses for a plain text request to xAI.usage object. Keep input_tokens_details so the estimate includes the cached input discount./usage shows credit usage in an interactive session. For a new scripted run, grok -p "Your prompt" --output-format json returns a run result. To use this calculator, copy a single xAI Responses API reply from your own API logs.
generateContent request.usageMetadata object. Keep the cached input and thinking token counts when present.For a new run, gemini -p "Your prompt" --output-format json includes token statistics under stats. Those can cover several requests and models. For this calculator, use the original usageMetadata from a single generateContent reply.
For other agent apps, look for a single provider response in your request logs. The estimate uses public API token rates.
Try a sample replaces the editor contents and calculates an example for the selected model.
Your estimate will appear here.
—USD
Checked . See OpenAI API pricing for updates.
Standard API token charges only. Why your invoice may differ.
Each example uses 12,000 input and 1,000 output tokens on GPT-6.2 Sol at Standard rates. Trying an example replaces the calculator input.
$0.0340
All 12,000 input tokens are billed at the regular input rate. Use this as the baseline.
$0.0131
Reading 11,000 tokens from the cache saves $0.0209 compared with the baseline.
$0.0399
4,000 cache reads and 7,000 cache writes across two durations cost $0.0059 more on this request.
Use the final API response so the calculator can read the model and token counts together. For a standalone usage object, choose the model yourself.
Check the no-cache estimate first. A cache write can cost more up front. Use the break-even estimate to see how many comparable cache hits would cover the extra write cost.
Paste a final Responses API object. input_tokens includes cache reads, and output_tokens includes reasoning.
Paste a Messages response. Cache reads and the 5-minute and 1-hour writes are separate from input_tokens.
Paste a generateContent response. The estimate adds thoughtsTokenCount to candidate output.
Paste usage or usageMetadata and select the exact model. A complete response can select it for you.
Each token count is multiplied by its rate per million and divided by one million. The estimate adds uncached input, cache reads, any supported cache writes, and output. The no-cache estimate prices all the same input at the regular rate.
The threshold depends on the model. For example, the GPT-6 models listed here switch above 272,000 input tokens and Grok switches at 200,000. The rate card shows the prices applied to the full request.
The estimate uses the listed first-party rates for standard paid text requests. It does not include free-tier usage, Batch or Fast pricing, regional surcharges, tool fees, explicit Gemini cache storage, taxes, or discounts.
Request JSON is processed in your browser. If you copy a report link, it includes the model, token counts and pricing used for the estimate. Anyone you share the link with can see these details.
Optional Google Analytics measures visits and tool usage. It receives the selected model, the type of estimate input, and fixed error categories. A fixed marker can show that you opened the editor from our OpenAI guide. If enabled, Google Analytics may use cookies. See how Google uses this data. You can change your choice below.