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

Example Usage

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

let value: ChatTokenLogprob = {
  bytes: null,
  logprob: -0.612345,
  token: " Hello",
  topLogprobs: [
    {
      bytes: null,
      logprob: -0.612345,
      token: " Hello",
    },
  ],
};

Fields

FieldTypeRequiredDescription
bytesnumber[]:heavy_check_mark:UTF-8 bytes of the token
logprobnumber:heavy_check_mark:Log probability of the token
tokenstring:heavy_check_mark:The token
topLogprobsmodels.ChatTokenLogprobTopLogprob[]:heavy_check_mark:Top alternative tokens with probabilities