ChatStreamChoice - TypeScript SDK

ChatStreamChoice type definition

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

Streaming completion choice chunk

Example Usage

1import { ChatStreamChoice } from "@openrouter/sdk/models";
2
3let value: ChatStreamChoice = {
4 delta: {},
5 finishReason: null,
6 index: 0,
7};

Fields

FieldTypeRequiredDescriptionExample
deltamodels.ChatStreamDelta✔️Delta changes in streaming response{"content": "Hello","role": "assistant"}
finishReasonmodels.ChatFinishReasonEnum✔️N/Astop
indexnumber✔️Choice index0
logprobsmodels.ChatTokenLogprobsLog probabilities for the completion{"content": [{"bytes": null,"logprob": -0.612345,"token": " Hello","top_logprobs": []}
],
“refusal”: null<br />}