ChatGenerationParams - TypeScript SDK
ChatGenerationParams method reference
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
Example Usage
1 import { ChatGenerationParams } from "@openrouter/sdk/models"; 2 3 let value: ChatGenerationParams = { 4 messages: [ 5 { 6 role: "system", 7 content: "<value>", 8 }, 9 ], 10 };
Fields
| Field | Type | Required | Description |
|---|---|---|---|
provider | models.ChatGenerationParamsProvider | ➖ | When multiple model providers are available, optionally indicate your routing preference. |
plugins | models.ChatGenerationParamsPluginUnion[] | ➖ | Plugins you want to enable for this request, including their settings. |
route | models.ChatGenerationParamsRoute | ➖ | Routing strategy for multiple models: “fallback” (default) uses secondary models as backups, “sort” sorts all endpoints together by routing criteria. |
user | string | ➖ | N/A |
sessionId | string | ➖ | A unique identifier for grouping related requests (e.g., a conversation or agent workflow) for observability. If provided in both the request body and the x-session-id header, the body value takes precedence. Maximum of 128 characters. |
messages | models.Message[] | ✔️ | N/A |
model | string | ➖ | N/A |
models | string[] | ➖ | N/A |
frequencyPenalty | number | ➖ | N/A |
logitBias | Record<string, *number*> | ➖ | N/A |
logprobs | boolean | ➖ | N/A |
topLogprobs | number | ➖ | N/A |
maxCompletionTokens | number | ➖ | N/A |
maxTokens | number | ➖ | N/A |
metadata | Record<string, *string*> | ➖ | N/A |
presencePenalty | number | ➖ | N/A |
reasoning | models.Reasoning | ➖ | N/A |
responseFormat | models.ChatGenerationParamsResponseFormatUnion | ➖ | N/A |
seed | number | ➖ | N/A |
stop | models.ChatGenerationParamsStop | ➖ | N/A |
stream | boolean | ➖ | N/A |
streamOptions | models.ChatStreamOptions | ➖ | N/A |
temperature | number | ➖ | N/A |
toolChoice | any | ➖ | N/A |
tools | models.ToolDefinitionJson[] | ➖ | N/A |
topP | number | ➖ | N/A |
debug | models.Debug | ➖ | N/A |