CompletionChoice - TypeScript SDK

CompletionChoice type definition

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

Example Usage

1import { CompletionChoice } from "@openrouter/sdk/models";
2
3let value: CompletionChoice = {
4 text: "<value>",
5 index: 7493.1,
6 logprobs: {
7 tokens: [
8 "<value 1>",
9 ],
10 tokenLogprobs: [
11 7640.5,
12 1771.28,
13 ],
14 topLogprobs: [],
15 textOffset: [
16 3937.38,
17 9605.77,
18 ],
19 },
20 finishReason: "length",
21};

Fields

FieldTypeRequiredDescription
textstring✔️N/A
indexnumber✔️N/A
logprobsmodels.CompletionLogprobs✔️N/A
finishReasonmodels.CompletionFinishReason✔️N/A