Structured outputs
Carry one JSON Schema across OpenAI, Anthropic, Google, and Responses protocol routes.
BitRouter normalizes a JSON Schema request and renders it in the outbound provider protocol. Your client can keep its native request shape even when the selected upstream uses another one.
Request formats
| Inbound API | Schema field |
|---|---|
| OpenAI Chat Completions | response_format.json_schema |
| OpenAI Responses | text.format |
| Anthropic Messages | output_config.format |
| Google Generate Content | generationConfig.responseSchema |
BitRouter promotes these fields into one canonical response-format constraint, then renders the corresponding outbound field after routing.
Example
curl http://127.0.0.1:4356/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "openai:gpt-5",
"messages": [{"role": "user", "content": "Return the issue priority."}],
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "issue_priority",
"strict": true,
"schema": {
"type": "object",
"properties": {
"priority": {"type": "string", "enum": ["low", "medium", "high"]}
},
"required": ["priority"],
"additionalProperties": false
}
}
}
}'The same request may route to a Messages or Generate Content upstream without the caller rewriting the schema field.
Capability-aware routing
A schema request adds the structured_outputs capability requirement. Routes that explicitly advertise their capabilities must include it to remain eligible. The public model registry shows which model/provider pairs declare support.
If the selected outbound protocol cannot represent the response format, BitRouter fails the request instead of silently dropping the schema.
What BitRouter guarantees
BitRouter guarantees that it preserves and translates the constraint across supported wire protocols. The upstream model and provider remain responsible for producing schema-conforming output.
JSON Schema support differs by upstream. Use the subset accepted by every provider in a fallback chain, and test the exact models you deploy. A schema accepted by one provider can still be rejected by another before generation.
Protocol mapping
| Canonical field | Chat Completions | Responses | Messages | Generate Content |
|---|---|---|---|---|
| Name | json_schema.name | text.format.name | Not represented | Not represented |
| Description | json_schema.description | text.format.description | Not represented | Not represented |
| Strict | json_schema.strict | text.format.strict | Provider behavior | Provider behavior |
| Schema | json_schema.schema | text.format.schema | format.schema | responseSchema |
Fields a destination protocol cannot represent are not invented. Keep portable behavior in the schema itself.
How is this guide?