Structured Output Overhead Calculator
Inputs
| Number of Fields | 8 |
|---|---|
| Tokens per Field | 8 |
| Number of Calls | 1,000 |
| Output Price (per 1M tokens) | 3 $ |
| Wrapper Tokens | 4 |
Structured Output Overhead Calculator
Estimate the extra output tokens and cost of asking an LLM to return JSON matching a schema — the field names, type markers, and punctuation that surround the actual values.
Inputs
Schema
Volume and Pricing
Wrapper Tokens
Results
Enter a value to see results.
Details
Structured output overhead
Structured output overhead is the share of an LLM response made up of formatting rather than content. When a model is asked to return JSON conforming to a schema, it must emit every key name, quotation mark, colon, comma, and brace in addition to the actual values. Those structural tokens are generated and billed exactly like any other output token, so a response carrying a few short values can spend a large fraction of its tokens on scaffolding. This calculator isolates that fixed overhead and the recurring cost it produces across a call volume.
Where the overhead comes from
Each field in the returned object contributes a quoted key, a colon separating
key from value, and a comma before the next field. A field named
shipping_status tokenizes into several pieces before any value is written. On
top of the per-field cost, every response carries fixed framing — the opening
and closing braces of the object and any schema scaffolding the provider
injects — counted once regardless of how many fields follow. Because this
framing and the per-field structure do not depend on the values, the overhead is
constant for a given schema and scales linearly with the number of calls.
The formula
With fields at tokens of scaffolding each and wrapper tokens, the per-call overhead is
tcall=f⋅tf+twAcross calls the total structural token count and its cost at an output price per million tokens are
TC=tcall⋅n=106TpThe division by converts the per-million price quote into a per-token rate. Structured output is generated by the model, so the overhead is billed at the output rate, which is typically the higher of the two published prices.
Worked example
Consider an extraction task returning a 12-field record, where each field costs about 9 tokens of scaffolding and the object framing adds 5 wrapper tokens. The per-call overhead is
tcall=12×9+5=113 tokensRun across 40,000 calls at an output price of $15 per million tokens, the structural cost is
TC=113×40000=4,520,000 tokens=1064520000×15=$67.80That $67.80 buys no information — it pays only for the braces, keys, and commas that wrap the extracted values. At this volume, shortening key names or dropping unused fields translates directly into a recurring saving.
Notes and variations
The per-field figure is an average; long, descriptive key names cost more than terse ones, and nested objects add their own intermediate braces and keys. The model also emits the values themselves, which this calculator excludes — it measures only the structural floor a schema imposes. Where the same task can be served by a more compact representation, that floor drops accordingly.
Application
Structured output overhead lands on the output side of the bill. The input-side counterpart — the tool definitions sent with each function-calling request — is handled by the Function Calling Token Overhead Calculator. To price the underlying per-call token usage from which these overheads are drawn, see the Token Cost Calculator.
Frequently Asked Questions (FAQ)
What is structured output?
Structured output is a mode in which the model is constrained to return data in a fixed shape — most often JSON conforming to a supplied schema — instead of free-form prose. It is used when a program will parse the response directly, such as extracting fields from a document or returning a typed record.
The structure is convenient for the consuming code but is itself made of tokens: every key name, quotation mark, colon, comma, and brace is generated and billed alongside the values.
How can I reduce schema overhead?
Shorter key names cost fewer tokens, so a compact field name trims the per-field figure across every call. Returning only the fields a downstream step actually uses avoids paying for data nothing reads. Flattening deeply nested objects removes intermediate braces and keys. Because the overhead is fixed per response, it matters most for high-volume, small-payload calls where the structure can rival the content in size.
Does JSON mode cost the same as function calling?
Both impose token overhead, but in different places. JSON or structured-output mode adds tokens to the response — the object the model writes back. Function calling additionally sends the tool definitions in the input on each call, so its overhead lands largely on the input side. The function-calling overhead calculator covers that input-side cost; this calculator covers the output-side cost of the returned object.
Disclaimer
Token figures are estimates that depend on the model’s tokenizer, the exact key names, and how the schema nests. Published prices change over time and may exclude caching or batch discounts. Verify current rates and exact token counts with your provider before relying on a figure for billing.