Calculate OpenAI API Cost from Usage JSON
A Standard GPT-6.2 Sol request with 12,000 input tokens, including 11,000 cached tokens, and 1,000 output tokens costs an estimated $0.0131. The same usage without caching costs $0.0340.
Responses API usage example
cached_tokens is already included in input_tokens. Subtract the cached count to get the 1,000 uncached input tokens. This example has no cache writes.
{
"model": "gpt-6.2-sol",
"usage": {
"input_tokens": 12000,
"input_tokens_details": {
"cached_tokens": 11000
},
"output_tokens": 1000
}
}
Estimated request cost
$0.0131USD
GPT-6.2 Sol · Standard · Short context
- Uncached input $0.0020 1,000 tokens × $2 / 1M
- Cache read $0.0011 11,000 tokens × $0.10 / 1M
- Output $0.0100 1,000 tokens × $10 / 1M
This example uses the calculator’s API rate snapshot. See OpenAI’s GPT-6.2 Sol prices and the OpenAI Responses usage fields.
Why did 701 more input tokens cost less?
Two GPT-6.2 Sol calls in one Codex session ran about 11 seconds apart on November 18, 2026. The second call reused nearly all its input. Its API estimate fell from $0.3467 to $0.0204, a 94.1% drop.
The reports use the November 20, 2026 snapshot of Standard short-context rates. Per million tokens, uncached input was $2, cache reads $0.10 and output $10. Both calls had zero cache writes. These are estimates for the recorded tokens. The user’s actual payment and subscription bill are unknown. OpenAI’s published API rates
First call · 2.1% of input cached
Of 176,442 input tokens, 3,712 hit the cache and 172,730 took the regular input rate. The call produced 84 output tokens.
$0.3467 = (172,730 × $2 + 3,712 × $0.10 + 84 × $10) / 1M, rounded.
With the same input and output but zero cache hits, the estimate would be $0.3537.
Check the first callSecond call · 99.5% of input cached
Of 177,143 input tokens, 176,256 hit the cache. Only 887 took the regular input rate. The call produced 97 output tokens.
$0.0204 = (887 × $2 + 176,256 × $0.10 + 97 × $10) / 1M, rounded.
With the same input and output but zero cache hits, the estimate would be $0.3553.
Check the second callTo rerun either estimate, open its report, expand Usage JSON and select Copy JSON. Choose Go to calculator, paste the JSON and select Calculate. To test zero cache hits yourself, set cached_tokens to 0 and keep input_tokens and output_tokens unchanged.
How to check your own request
- Copy the final
POST /v1/responsesJSON. When streaming, copy theresponseobject inside theresponse.completedevent. - Open the calculator and paste your usage JSON. A full response carries the model ID. If you copy only
usage, choose the exact model yourself. - Keep the input and output details. For requests with cache writes, the extra charges depend on the written token counts and retention periods. Review the applied rates and the no-cache comparison in the result.
The calculator can work from a usage object without the prompt or generated text. Your pasted JSON is processed in your browser.
Deciding between Sol and Astra? Compare GPT-6.2 pricing using the same request.
Why your invoice can differ
This estimate covers text token charges for one Standard request against the direct OpenAI API. The example uses short-context rates. Batch, Fast, long-context requests, tool charges, taxes, credits and private discounts can change the amount owed. For a historical request, check the rates in effect when it ran.