ChatFormatJsonSchemaConfig - TypeScript SDK

ChatFormatJsonSchemaConfig type definition

The TypeScript SDK and docs are currently in beta. Report issues on GitHub.

JSON Schema response format for structured outputs

Example Usage

1import { ChatFormatJsonSchemaConfig } from "@openrouter/sdk/models";
2
3let value: ChatFormatJsonSchemaConfig = {
4 jsonSchema: {
5 name: "math_response",
6 },
7 type: "json_schema",
8};

Fields

FieldTypeRequiredDescriptionExample
jsonSchemamodels.ChatJsonSchemaConfig✔️JSON Schema configuration object{"description": "A mathematical response","name": "math_response","schema": {"properties": {"answer": {"type": "number"}
},
“required”: [
“answer”
],
“type”: “object”
},
“strict”: true<br />}
type”json_schema”✔️N/A