OpenAI adds structured outputs to the API
OpenAI said the new gpt-4o-2024-08-06 model scored 100% on its schema-following evaluation, against under 40% for gpt-4-0613 without the feature.
- Models & capabilities
- Minor
OpenAI added Structured Outputs to its API, a feature that constrained a model’s token generation so its response matched a developer-supplied JSON Schema exactly, rather than merely resembling one. Earlier “JSON mode” and function-calling features had encouraged well-formed output without guaranteeing it; malformed or incomplete JSON was a recurring failure mode for developers building on top of the API, forcing many to write brittle parsing and retry logic.
OpenAI said its updated gpt-4o-2024-08-06 model, using constrained decoding to restrict generation to only tokens valid under the given schema, scored 100% on an internal complex-schema-following evaluation, compared with under 40% for the earlier gpt-4-0613 without the feature. The capability was made available across the Chat Completions, Assistants and Batch APIs, and could be applied to function-calling definitions via a “strict” flag.
The change addressed a practical rather than a headline-capability problem: reliability of machine-readable output was one of the more common complaints from developers building agents and structured-data pipelines on top of large language models, and guaranteed schema conformance removed a class of errors that had previously required application-level workarounds.