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

Example Usage

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

let value: CompletionChoice = {
  text: "<value>",
  index: 7493.1,
  logprobs: {
    tokens: [
      "<value 1>",
    ],
    tokenLogprobs: [
      7640.5,
      1771.28,
    ],
    topLogprobs: [],
    textOffset: [
      3937.38,
      9605.77,
    ],
  },
  finishReason: "length",
};

Fields

FieldTypeRequiredDescription
textstring:heavy_check_mark:N/A
indexnumber:heavy_check_mark:N/A
logprobsmodels.CompletionLogprobs:heavy_check_mark:N/A
finishReasonmodels.CompletionFinishReason:heavy_check_mark:N/A
nativeFinishReasonstring:heavy_minus_sign:N/A
reasoningstring:heavy_minus_sign:N/A