Skip to main content
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

import { PromptTokensDetails } from "@openrouter/sdk/models/operations";

let value: PromptTokensDetails = {};

Fields

FieldTypeRequiredDescriptionExample
audioTokensnumber:heavy_minus_sign:Number of audio tokens in the input
fileTokensnumber:heavy_minus_sign:Number of file/document tokens in the input
imageTokensnumber:heavy_minus_sign:Number of image tokens in the input258
textTokensnumber:heavy_minus_sign:Number of text tokens in the input8
videoTokensnumber:heavy_minus_sign:Number of video tokens in the input