API
Structured outputs
Request JSON Schema and validate again at the application boundary
Routes that declare structured-output support accept a JSON Schema request through response_format. Octoryn preserves the contract when the selected provider supports it; it does not turn unvalidated model output into a trusted object.
Send a JSON Schema
Give the schema a stable name, set strict mode where supported and keep it small enough for every eligible fallback.
response_format: {
type: "json_schema",
json_schema: {
name: "risk_summary", strict: true,
schema: { type: "object", properties: { risk: { type: "string" } }, required: ["risk"], additionalProperties: false }
}
}Require capability across the route
A policy route may use structured outputs only when its primary and permitted fallbacks can preserve the requested schema semantics. Otherwise select a narrower route or fail explicitly.
Validate before use
Parse and validate the result with the same schema in your application. Reject extra properties, enforce business authorization and never use model output as a credential or database query without controls.
