OpenAI Structured Outputs Guide: JSON Schema and Pydantic
OpenAI Structured Outputs guarantees that the model’s response matches a JSON schema you define — not just valid JSON, but schema-valid JSON with exactly the fields and types you specified. Before structured outputs, developers used JSON mode (syntactically valid JSON but without schema enforcement) or function calling workarounds that produced inconsistent results. Structured outputs with … Read more