ChatTokenLogprob - TypeScript SDK

ChatTokenLogprob type definition

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

Token log probability information

Example Usage

1import { ChatTokenLogprob } from "@openrouter/sdk/models";
2
3let value: ChatTokenLogprob = {
4 bytes: null,
5 logprob: -0.612345,
6 token: " Hello",
7 topLogprobs: [
8 {
9 bytes: null,
10 logprob: -0.612345,
11 token: " Hello",
12 },
13 ],
14};

Fields

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