OpenAI has announced two significant updates to its API offerings: the introduction of Structured Outputs and a substantial price reduction for its latest GPT-4 version.
Structured Outputs: Ensuring Schema Compliance
OpenAI has launched Structured Outputs, one of the most requested features for its API. This feature ensures that model outputs precisely match developer-supplied JSON Schemas, addressing a long-standing challenge since the introduction of function calling.
Developers can implement Structured Outputs in two ways:
- For function calling: Set
strict: true
within the function definition. - As a
response_format
option: Supply ajson_schema
with a full schema definition and setstrict: true
.
Structured Outputs with function calling is supported across all function-calling-capable models, including GPT-4 and GPT-3.5-turbo variants.
Significant Price Reduction
The latest GPT-4 version (gpt-4o-2024-08-06) comes with substantial cost savings for developers:
- 50% reduction in input token pricing
- 33% reduction in output token pricing
Compared to the previous version, these price cuts make advanced AI capabilities more accessible to a broader range of developers and applications.
OpenAI encourages developers to explore these new features and looks forward to seeing the innovative applications that will emerge from these enhancements.