Fundamentals
JSON Mode
Quick Answer
A model behavior setting that constrains outputs to valid JSON format.
JSON mode forces the model to output only valid JSON. This eliminates the need to parse and validate model output—the model guarantees valid JSON syntax. JSON mode is invaluable for applications requiring structured data: agents, function calling systems, and data extraction. It typically works by constraining the token selection during generation to only produce valid JSON. Not all models support JSON mode, and implementation details vary. Combine JSON mode with detailed schema descriptions to control both structure and content. This feature significantly reduces parsing errors and malformed output.
Last verified: 2026-04-08