OpenAI Structured Outputs: strict JSON Schema and the parse helper
Answer: Structured Outputs can be enabled by setting strict: true with either a defined response format or function definitions. Unlike JSON mode, Structured Outputs constrains the shape of the JSON, not only its validity.
Two ways to pass the schema
response_formatwith"type": "json_schema", aname, aschemaand"strict": True. In the cookbook example every object lists all its properties inrequiredand sets"additionalProperties": False.- The SDK
parsehelper takes your own Pydantic model instead of a hand-written JSON schema; the cookbook recommends this method if possible. The result is on.parsed.
Refusals
A refusal does not follow the schema, so the API has a refusal field to indicate when the model refused to answer.
Pydantic side
BaseModel.model_json_schema returns a jsonable dict of a model's schema; Pydantic's generated schemas are compliant with JSON Schema Draft 2020-12.
See also
- ao-structured-json-schema-objects
- ao-structured-across-providers
- ao-structured-gemini-json-schema
- ao-structured-json-schema-composition
Claims
- id: C1 claim: strict: true enables Structured Outputs. source: S1 evidence: "enabled by setting the parameter
strict: truein an API call"
- id: C2 claim: It constrains shape, not only validity. source: S1 evidence: "constrains the shape of the JSON, not only its validity"
- id: C3 claim: Refusals use a refusal field. source: S1 evidence: "the API has a new field
refusalto indicate when the model refused"
- id: C4 claim: Pydantic schemas follow Draft 2020-12. source: S2 evidence: "JSON Schema Draft 2020-12"
Sources
- [S1] Introduction to Structured Outputs. openai/openai-cookbook (GitHub). https://github.com/openai/openai-cookbook/blob/main/examples/Structured_Outputs_Intro.ipynb . License: MIT. Accessed 2026-11-16.
- [S2] JSON Schema (Pydantic docs). pydantic/pydantic (GitHub). https://github.com/pydantic/pydantic/blob/main/docs/concepts/json_schema.md . License: MIT. Accessed 2026-11-16.
License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: openai/openai-cookbook (GitHub), Introduction to Structured Outputs, MIT (https://raw.githubusercontent.com/openai/openai-cookbook/main/LICENSE). Copyright (c) 2025 OpenAI; pydantic/pydantic (GitHub), JSON Schema (Pydantic docs), MIT (https://raw.githubusercontent.com/pydantic/pydantic/main/LICENSE). Copyright (c) 2017 to present Pydantic Services Inc. and individual contributors. Text was condensed and changed from the originals.
License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: openai/openai-cookbook (GitHub), Introduction to Structured Outputs, MIT (https://raw.githubusercontent.com/openai/openai-cookbook/main/LICENSE). Copyright (c) 2025 OpenAI; pydantic/pydantic (GitHub), JSON Schema (Pydantic docs), MIT (https://raw.githubusercontent.com/pydantic/pydantic/main/LICENSE). Copyright (c) 2017 to present Pydantic Services Inc. and individual contributors.
Cite this
iinventedlight. 2026. "OpenAI Structured Outputs: strict JSON Schema and the parse helper." iinventedlight Library, iil:note:287j0czt, version of 2026-11-16. https://iinventedlight.com/library/notes/ao-structured-openai-structured-outputs/. License: CC-BY-4.0.
@misc{iil_note_287j0czt,
author = {{iinventedlight}},
title = {{OpenAI Structured Outputs: strict JSON Schema and the parse helper}},
howpublished = {iinventedlight Library},
year = {2026},
date = {2026-11-16},
url = {https://iinventedlight.com/library/notes/ao-structured-openai-structured-outputs/},
note = {Permanent ID iil:note:287j0czt. License: CC-BY-4.0.},
}
Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).
For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/ao-structured-openai-structured-outputs.md.