Structured Outputs
Ask compatible models to return JSON or schema-constrained output.
Supported patterns
| Parameter | Type | Required | Description |
|---|---|---|---|
| response_format | Chat | optional | Use JSON object or JSON schema formats on compatible OpenAI-style models. |
| text.format | Responses | optional | Use Responses text format controls for compatible models. |
| output_config | Claude | optional | Use Claude-compatible output controls only when the upstream supports them. |
| responseMimeType / responseSchema | Gemini | optional | Use Gemini native schema controls for Gemini-compatible models. |
JSON schema example
Pass a json_schema in response_format to force the reply to match your shape. Set strict: true so the model adheres exactly to the schema.
{
"model": "openai/gpt-5.2",
"messages": [{"role": "user", "content": "Extract the user: Jane, 31, Berlin"}],
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "user",
"strict": true,
"schema": {
"type": "object",
"properties": {
"name": {"type": "string"},
"age": {"type": "integer"},
"city": {"type": "string"}
},
"required": ["name", "age", "city"],
"additionalProperties": false
}
}
}
}Model-dependent features
OneRouter keeps protocol compatibility and forwards model-specific parameters where supported. Features such as tool calling, structured output, reasoning, prompt caching, web search, image input, audio input, video generation, and provider-specific options depend on the selected model and upstream provider. Check the model detail page before relying on a feature in production.