Skip to main content
Structured Outputs ensure that models follow your supplied JSON schema. Portkey supports this for Anthropic models using a unified response_format interface. Define object schemas using Pydantic (Python) or Zod (JavaScript) to extract structured information from unstructured text. This approach provides type hinting and automatic validation.

2. Using Raw JSON Schema

For cross-language compatibility or dynamic schemas, pass a standard JSON schema directly.
For more, refer to Anthropic’s detailed documentation on Structured Outputs here.
Last modified on April 2, 2026