Skip to main content
The TypeScript SDK and docs are currently in beta. Report issues on GitHub.
Streaming completion choice chunk

Example Usage

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

let value: ChatStreamChoice = {
  delta: {},
  finishReason: null,
  index: 0,
};

Fields

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