JSON Schema support and limitations
Azure OpenAI structured outputs support the same subset of the JSON Schema as OpenAI.Supported types
- String
- Number
- Boolean
- Integer
- Object
- Array
- Enum
- anyOf
Root objects can’t be the
anyOf type.All fields must be required
Include all fields or function parameters as required. In the following example, bothlocation and unit appear under "required": ["location", "unit"].
null. In this example, this approach is represented by the line "type": ["string", "null"],.
Nesting depth
A schema can have up to 100 object properties total, with up to five levels of nesting.Always set additionalProperties: false in objects
This property controls if an object can have other key value pairs that weren’t defined in the JSON Schema. To use structured outputs, set this value to false.
Key ordering
Structured outputs follow the same order as the provided schema. To change the output order, modify the order of the schema that you send as part of your inference request.Unsupported type-specific keywords
Nested schemas using anyOf must adhere to the overall JSON Schema subset
Example supportedanyOf schema:
Definitions are supported
Supported example:Recursive schemas are supported
Example using# for root recursion:
Currently, structured outputs aren’t supported with:
- Bring your own data scenarios.
- Assistants or Foundry Agents Service.
gpt-4o-audio-previewandgpt-4o-mini-audio-previewversion:2024-12-17.
Supported models
gpt-5.1-codexversion:2025-11-13gpt-5.1-codex miniversion:2025-11-13gpt-5.1version:2025-11-13gpt-5.1-chatversion:2025-11-13gpt-5-proversion2025-10-06gpt-5-codexversion2025-09-11gpt-5version2025-08-07gpt-5-miniversion2025-08-07gpt-5-nanoversion2025-08-07codex-miniversion2025-05-16o3-proversion2025-06-10o3-miniversion2025-01-31o1version:2024-12-17gpt-4o-miniversion:2024-07-18gpt-4oversion:2024-08-06gpt-4oversion:2024-11-20gpt-4.1version2025-04-14gpt-4.1-nanoversion2025-04-14gpt-4.1-miniversion:2025-04-14o4-miniversion:2025-04-16o3version:2025-04-16
API support
API version2024-08-01-preview is the first version that supports structured outputs. The latest preview APIs and the latest GA API, v1, also support structured outputs.