OpenAI Introduces 100% Accurate Structured Output for JSON Schemas

OpenAI launches a new structured output feature for its API that guarantees model responses perfectly match developer-provided JSON schemas. The update accompanies a new model version and significant price cuts for API access.

OpenAI introduces a groundbreaking structured output feature for its API that guarantees model responses perfectly match developer-provided JSON schemas. Unlike previous iterations that only increased the likelihood of valid JSON, this new capability ensures 100% structural accuracy. The update applies to the newly released gpt-4o-2024-08-06 and gpt-4o-mini models, providing developers with highly reliable data formatting for their applications.

The performance improvement is dramatic, as the new model achieves a perfect 100% score in complex JSON schema evaluations compared to a score of less than 40% for the older gpt-4-0613 model. Developers access this feature through two primary methods: by enabling it within function call definitions or by using a new json_schema option in the response_format parameter. These options give developers flexible tools to constrain model outputs to exact predefined patterns.

Alongside this technical leap, OpenAI reduces the cost of using the new model by cutting input prices in half and reducing output prices by a third. The structured output feature also strictly adheres to existing security policies, ensuring the model continues to reject unsafe requests even when constrained by a schema. This combination of guaranteed accuracy, lower costs, and maintained security makes the API significantly more efficient for real-world application development.

Read More at the original source →