Structured extraction schema token cost
When you use function calling or JSON-schema structured output, the schema itself is part of the prompt — it is re-sent on every request. A rich 50-field schema with descriptions can quietly add hundreds of input tokens to each call. Paste two schemas, set your daily volume, and this tool shows the per-request token overhead and the monthly cost difference.
How it works
The tool measures each schema’s character length and estimates tokens at the standard ~4 characters per token ratio that compact JSON tends to follow. It then multiplies the per-request overhead by your daily request count and your model’s input price (per million tokens) to project monthly spend for each schema:
schema_tokens ≈ schema_characters / 4
monthly_cost = schema_tokens / 1,000,000 × input_price × requests/day × 30
The difference between the two schemas is the money you save (or spend) purely by changing the shape of what you extract.
Tips and notes
- Strip long human-readable
descriptionstrings from production schemas — they are billed on every call but rarely improve extraction accuracy enough to justify the cost at high volume. - Prefer short, unambiguous field names over verbose ones;
dobcosts fewer tokens thandateOfBirthInISO8601Formatacross millions of requests. - If only a few requests need the rich 50-field schema, route those separately and keep the cheap 5-field schema as your default path.