POST /v1/responses
Calculate OpenAI API cost from usage JSON
Find the uncached input count when input_tokens_details.cached_tokens is present. Follow the $0.0131 GPT-6.2 Sol example.
Start with the API that produced your response. Each guide shows which fields to copy and how cached tokens affect the estimate.
POST /v1/responses
Find the uncached input count when input_tokens_details.cached_tokens is present. Follow the $0.0131 GPT-6.2 Sol example.
POST /v1/messages
Price cache reads and 5-minute and 1-hour writes from a Messages response. Follow the $0.0359 Claude Sonnet 5.5 example.
generateContent
Find the prompt, cache reads, and thinking tokens in a single Gemini API response.
Copy the response's usage or usageMetadata object and select the exact model, or paste the whole response to detect the model automatically. A standalone object keeps prompts and generated text out of the editor.