Skip to main content
JSON mode depends on the selected model. Use the Models API to find models with json_mode: true.
Use JSON mode when you need strict, machine-readable responses. Set response_format to {"type": "json_object"} to have the model return valid JSON.
Keep prompts short and explicit about required keys. Lower temperatures reduce the chance of malformed JSON.