Skip to main content
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
JSON Schema configuration object

Example Usage

import { ChatJsonSchemaConfig } from "@openrouter/sdk/models";

let value: ChatJsonSchemaConfig = {
  name: "math_response",
};

Fields

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