Supported draft version
Model Inference validatesoutput_format_schema against JSON Schema Draft 2019-09 on
the server side after each inference call. Draft 2020-12 features commonly used for
structured output definition are also supported.
Schema requirements
A few constraints apply to everyoutput_format_schema:
- The top-level schema must have
type: "object". - For forced-tool-use models — currently
Claude Sonnet 5.0 and Claude Opus 4.7 / 4.8 — the top-level object must set
additionalProperties: false. The forced-tool path rejects a schema that omits it or sets it totrue. - The server validates the model’s response against your schema; a violation fails the inference job with a typed error rather than returning invalid data.
Basic types
String
Number
Integer
Boolean
Null
Object type
Define structured objects with named properties:Required properties
Use therequired array to specify mandatory fields:
Additional properties
Control whether extra properties are allowed:Array type
Simple arrays
Array constraints
Arrays of objects
Enum constraint
Restrict values to a predefined set:Numeric constraints
Example:
String constraints
Example:
Array constraints
Example:
Descriptions
Add descriptions to help the model understand field purpose:Nested structures
Nested objects
Common patterns
Classification result
Entity extraction
Summary with key points
CRON expression result
TypeScript mapping
Related content
Using Structured Output
Practical guide to schema definition
Model Inference API
Complete API reference
Structured Output Concepts
Why structured output matters
Running Inference
Submit inference requests

