The TypeScript SDK and docs are currently in beta.
Report issues on GitHub.
Example Usage
import { ChatStreamChoice } from "@openrouter/sdk/models";
let value: ChatStreamChoice = {
delta: {},
finishReason: null,
index: 0,
};
Fields
| Field | Type | Required | Description | Example |
|---|---|---|---|---|
delta | models.ChatStreamDelta | :heavy_check_mark: | Delta changes in streaming response | {"content": "Hello","role": "assistant"} |
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/>} |