ChatJsonSchemaConfig - TypeScript SDK

ChatJsonSchemaConfig type definition

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

JSON Schema configuration object

Example Usage

1import { ChatJsonSchemaConfig } from "@openrouter/sdk/models";
2
3let value: ChatJsonSchemaConfig = {
4 name: "math_response",
5};

Fields

FieldTypeRequiredDescriptionExample
descriptionstringSchema description for the modelA mathematical response
namestring✔️Schema name (a-z, A-Z, 0-9, underscores, dashes, max 64 chars)math_response
schemaRecord<string, *any*>JSON Schema object{"properties": {"answer": {"type": "number"}
},
“required”: [
“answer”
],
“type”: “object”
}
strictbooleanEnable strict schema adherencefalse