OpenAI Usage Stats Parser

Extract and cost-estimate token usage from an OpenAI API response.

Ad placeholder (leaderboard)

Parse OpenAI token usage and estimate cost

The OpenAI Usage Stats Parser reads the usage object from any OpenAI API response and lays out the token counts you actually care about — prompt, completion, cached input, and reasoning tokens — alongside an estimated cost for the call. No API key is needed because you are parsing a response you already have.

How it works

The tool parses your pasted JSON and looks for a usage object using both the chat-completions field names (prompt_tokens, completion_tokens) and the responses-API names (input_tokens, output_tokens). It also reads prompt_tokens_details.cached_tokens and completion_tokens_details.reasoning_tokens when present. Cost is computed from published list prices for the model you select, billing cached input at the discounted rate and the rest at the standard input price.

Tips and notes

Cached tokens are billed at a fraction of the normal input price, so a high cached count on repeated system prompts is a good sign your prompt caching is working. Reasoning tokens (on o-series and reasoning models) are billed as output tokens — watch them, because they can dominate cost on hard problems. If the parser reports no usage object, confirm you pasted the full response and not just the message content.

Ad placeholder (rectangle)