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

Example Usage

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

let value: CompletionLogprobs = {
  tokens: [
    "<value 1>",
    "<value 2>",
    "<value 3>",
  ],
  tokenLogprobs: [
    2988.44,
    7128.75,
    8377.63,
  ],
  topLogprobs: null,
  textOffset: [
    1144.74,
    3297.78,
  ],
};

Fields

FieldTypeRequiredDescription
tokensstring[]:heavy_check_mark:N/A
tokenLogprobsnumber[]:heavy_check_mark:N/A
topLogprobsRecord<string, *number*>[]:heavy_check_mark:N/A
textOffsetnumber[]:heavy_check_mark:N/A