Skip to main content
Select a model with structured-output support. The three protocols use different field shapes: Chat and Responses also accept their native json_object format. Include an instruction explaining the intended JSON content.
The model and backend determine supported schema constraints. Validate returned data in your application before using it. Output limits, interruptions, tool calls, and refusals can prevent a complete JSON result. Accumulate streaming text before parsing JSON; individual deltas are usually not complete JSON documents.