Structured output contracts define the precise data schema (e.g. integer fields, enum lists, and string limits) using schemas like Pydantic or JSON Schema.
Constrained decoders block the generation of tokens that violate this schema, guaranteeing 100% parse success rates for production integrations.
class ClientDetails(BaseModel): name: str = Field(description='Full legal name') age: int = Field(gt=0, description='Age in years') status: Literal['active', 'inactive'] = Field(description='Current subscription status')
Claude supports structured outputs natively using tool definitions and JSON mode instructions.