The TypeScript SDK and docs are currently in beta.
Report issues on GitHub.
Example Usage
import { ChatChoice } from "@openrouter/sdk/models";
let value: ChatChoice = {
finishReason: "stop",
index: 0,
message: {
role: "assistant",
},
};
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
finishReason | models.ChatFinishReasonEnum | :heavy_check_mark: | N/A | stop |
index | number | :heavy_check_mark: | Choice index | 0 |
logprobs | models.ChatTokenLogprobs | :heavy_minus_sign: | Log probabilities for the completion | {"content": [{"bytes": null,"logprob": -0.612345,"token": " Hello","top_logprobs": []}], “refusal”: null<br/>} |
message | models.ChatAssistantMessage | :heavy_check_mark: | Assistant message for requests and responses | {"content": "What is the capital of France?","role": "user"} |