Strict structured outputs
Contract 2026-09-10.1, reviewed 10 September 2026. A bounded Chat Completions subset, supported by synthetic real-adapter tests—not live provider certification or complete OpenRouter compatibility.
Supported workflow
Send a nonstreaming, text-only request to POST /v1/chat/completions with your Routexor API key and connected provider key. Pin one of these exact model IDs:
routexor/gpt-4.1-miniroutexor/claude-haiku-4.5routexor/gemini-2.5-flash-lite
Routexor sends the schema using native OpenAI response_format, Claude output_config.format, or Gemini responseJsonSchema plus JSON MIME type. A successful strict answer is parsed and checked against the accepted schema before being returned.
Example request body
{
"model": "routexor/gpt-4.1-mini",
"messages": [
{
"role": "user",
"content": "Return a synthetic readiness result."
}
],
"max_tokens": 128,
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "readiness",
"strict": true,
"schema": {
"type": "object",
"properties": {
"ready": {
"type": "boolean"
},
"note": {
"type": [
"string",
"null"
]
}
},
"required": [
"ready",
"note"
],
"additionalProperties": false
}
}
}
}The same body shape works with each model above. This example does not execute a request. A real call uses your account and may incur provider charges.
Exact schema subset
The root must be an object. Supported types: object, array, string, number, integer, boolean and null. A type may be nullable using a two-item type array containing null. Integers must remain JavaScript-safe. String enums allow 1–32 unique strings (up to 128 characters each). Optional description text is limited to 512 characters.
Every object must list all properties as required and set additionalProperties to false. Arrays require one items schema. Other keywords—including references, definitions, unions such as anyOf, formats, regular expressions, defaults and numeric/string/array constraints—are rejected rather than weakened. Names are 1–64 letters, digits, underscores or hyphens. The json_schema wrapper accepts only name, strict: true and schema.
Limits: 8192 UTF-8 schema-wrapper bytes, 128 schema nodes, depth 8, 64 total object properties; 65536 output bytes and 4096 output nodes. Property names are 1–64 characters; reserved prototype keys are excluded.
Explicit exclusions
Streaming, tools/tool history, image/content-part inputs, assistant prefilling, automatic/fallback/profile/ensemble/shadow routing, reasoning/cache controls, Messages and Responses strict protocols are outside this slice. Text messages allow only role and content; one optional system message must be first and the final message must be user. Allowed request keys are model, messages, response_format, max_tokens or max_completion_tokens, temperature, top_p and stream: false. Set exactly one positive output-token cap, within the model limit and no greater than 65,536. Unknown fields stop before provider dispatch.
Errors and costs
Unsupported requests return HTTP 400 with a fixed strict_* error code. Provider refusals, token cutoffs and schema-invalid results return HTTP 502 with strict_output_refused, strict_output_incomplete or strict_output_invalid; oversized output returns strict_output_limit. Errors never echo schema fields, generated text or parser details. This slice does not automatically retry a paid schema failure.
Provider output can incur charges even when it is refused, incomplete or invalid. Reported usage is accounted for before output validation; missing/uncertain usage keeps a conservative reservation. Usage records describe the provider attempt, not proof that its output passed schema validation. Application-level correctness and real-provider behavior require separately authorized, capped canaries.