TextResponseFormatJsonSchema interface

JSON Schema response format. Used to generate structured JSON responses. Learn more about Structured Outputs.

Extends

Properties

description

A description of what the response format is for, used by the model to determine how to respond in the format.

name

The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.

schema

The JSON Schema that defines the required structure of the model's output.

strict

Whether the model's generated output must strictly conform to the supplied JSON Schema.

type

The type of response format being defined. Always json_schema.

Property Details

description

A description of what the response format is for, used by the model to determine how to respond in the format.

description?: string

Property Value

string

name

The name of the response format. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.

name: string

Property Value

string

schema

The JSON Schema that defines the required structure of the model's output.

schema: Record<string, unknown>

Property Value

Record<string, unknown>

strict

Whether the model's generated output must strictly conform to the supplied JSON Schema.

strict?: boolean

Property Value

boolean

type

The type of response format being defined. Always json_schema.

type: "json_schema"

Property Value

"json_schema"