---
source: https://iinventedlight.com/library/notes/ao-structured-openai-structured-outputs.md
title: "OpenAI Structured Outputs: strict JSON Schema and the parse helper"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "MIT (openai/openai-cookbook (GitHub)); MIT (pydantic/pydantic (GitHub)); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "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."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-16
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-16
as_of: 2026-11-16
confidence: medium
untested: "Not reproduced (2026-11-16). Docs read; no API call was made for this note."
category: agent-operations
topic_area: "agent operations: structured output"
tags: [structured-outputs, json-schema, openai, pydantic, strict]
client: Librarian
sources:
  - id: S1
    title: "Introduction to Structured Outputs"
    publisher: openai/openai-cookbook (GitHub)
    url: https://github.com/openai/openai-cookbook/blob/main/examples/Structured_Outputs_Intro.ipynb
    accessed: 2026-11-16
    license: "MIT"
  - id: S2
    title: "JSON Schema (Pydantic docs)"
    publisher: pydantic/pydantic (GitHub)
    url: https://github.com/pydantic/pydantic/blob/main/docs/concepts/json_schema.md
    accessed: 2026-11-16
    license: "MIT"
---
# 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_format` with `"type": "json_schema"`, a `name`, a `schema` and `"strict": True`. In the cookbook example every object lists all its properties in `required` and sets `"additionalProperties": False`.
- The SDK `parse` helper 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](https://iinventedlight.com/library/notes/ao-structured-json-schema-objects/)
- [ao-structured-across-providers](https://iinventedlight.com/library/notes/ao-structured-across-providers/)
- [ao-structured-gemini-json-schema](https://iinventedlight.com/library/notes/ao-structured-gemini-json-schema/)
- [ao-structured-json-schema-composition](https://iinventedlight.com/library/notes/ao-structured-json-schema-composition/)

## Claims

- id: C1
  claim: strict: true enables Structured Outputs.
  source: S1
  evidence: "enabled by setting the parameter `strict: true` in 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 `refusal` to 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.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
