response_format: {"type": "json_object"}— model returns valid JSONresponse_format: {"type": "json_schema", "json_schema": {...}}— model output conforms to your schema
Example (json_schema, OpenAI)
Cross-provider support
response_format is supported wherever the upstream model can honor
it. For Gemini, OrcaRouter’s translation layer maps it to
responseMimeType + responseSchema. For OpenAI / Grok / DeepSeek
(all OpenAI-compatible upstreams), the field reaches the upstream in
its native shape. Anthropic doesn’t expose a response_format
equivalent, so use Anthropic’s tool_use pattern when you need
schema-constrained output there.
| Provider | json_object | json_schema | Notes |
|---|---|---|---|
| OpenAI | ✅ | ✅ | OpenAI’s native field shape |
| Grok (xAI) | ✅ | ✅ | xAI is OpenAI-compatible |
| DeepSeek | ✅ | ⚠️ | Check DeepSeek’s per-model support |
| Gemini | ✅ | ✅ | Translated to responseMimeType + responseSchema |
| Anthropic | ❌ | ❌ | Use tool_use pattern instead |
See also
- Advanced / Tool calling — Anthropic schema-constrained workaround
- API Reference / Chat — full schema with try-it
