PromptTokensDetails - TypeScript SDK

PromptTokensDetails type definition

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

Per-modality token breakdown. Only present when the input contains 2+ modalities (e.g. text + image) and the upstream provider returns modality-level usage data. Only non-zero modality counts are included.

Example Usage

1import { PromptTokensDetails } from "@openrouter/sdk/models/operations";
2
3let value: PromptTokensDetails = {};

Fields

FieldTypeRequiredDescriptionExample
audioTokensnumberNumber of audio tokens in the input
fileTokensnumberNumber of file/document tokens in the input
imageTokensnumberNumber of image tokens in the input258
textTokensnumberNumber of text tokens in the input8
videoTokensnumberNumber of video tokens in the input