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

Example Usage

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

let value: CreateEmbeddingsUsage = {
  promptTokens: 8,
  totalTokens: 8,
};

Fields

FieldTypeRequiredDescriptionExample
costnumber:heavy_minus_sign:Cost of the request in credits0.0001
promptTokensnumber:heavy_check_mark:Number of tokens in the input8
promptTokensDetailsoperations.PromptTokensDetails:heavy_minus_sign: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.
totalTokensnumber:heavy_check_mark:Total number of tokens used8