Skip to main content
JSON mode is useful when you need to programmatically parse model responses without handling free-form text. Enabling JSON mode instructs the model to return the response in a valid JSON format, which makes it easier to consume the output in downstream code. However, the response’s schema isn’t guaranteed to be consistent or to follow a particular structure. For consistent, structured JSON responses, we recommend structured output when possible. To enable JSON mode, specify it as the response_format in the request: