Interface: AnthropicOutputFormat
@providerprotocol/ai / anthropic / AnthropicOutputFormat
Interface: AnthropicOutputFormat
Section titled “Interface: AnthropicOutputFormat”Defined in: src/providers/anthropic/types.ts:257
Native structured output format configuration.
When provided, Claude’s response will be constrained to match the
specified JSON schema. Requires the beta header structured-outputs-2025-11-13.
Example
Section titled “Example”const outputFormat: AnthropicOutputFormat = { type: 'json_schema', schema: { type: 'object', properties: { name: { type: 'string' }, age: { type: 'integer' }, }, required: ['name', 'age'], additionalProperties: false, },};Properties
Section titled “Properties”schema
Section titled “schema”schema:
object
Defined in: src/providers/anthropic/types.ts:261
JSON Schema defining the expected response structure.
additionalProperties?
Section titled “additionalProperties?”
optionaladditionalProperties:false
Must be false for structured outputs.
properties
Section titled “properties”properties:
Record<string,unknown>
Property definitions for each field.
required?
Section titled “required?”
optionalrequired:string[]
List of required property names.
type:
"object"
Schema type (always ‘object’ for structured outputs).
type:
"json_schema"
Defined in: src/providers/anthropic/types.ts:259
Output format type - currently only ‘json_schema’ is supported.