> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://openrouter.ai/docs/llms.txt.
> For full documentation content, see https://openrouter.ai/docs/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://openrouter.ai/docs/_mcp/server.

# PromptTokensDetails - Python SDK

The Python SDK and docs are currently in beta.
Report issues on [GitHub](https://github.com/OpenRouterTeam/python-sdk/issues).

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.

## Fields

| Field          | Type             | Required             | Description                                 | Example |
| -------------- | ---------------- | -------------------- | ------------------------------------------- | ------- |
| `audio_tokens` | *Optional\[int]* | :heavy\_minus\_sign: | Number of audio tokens in the input         |         |
| `file_tokens`  | *Optional\[int]* | :heavy\_minus\_sign: | Number of file/document tokens in the input |         |
| `image_tokens` | *Optional\[int]* | :heavy\_minus\_sign: | Number of image tokens in the input         | 258     |
| `text_tokens`  | *Optional\[int]* | :heavy\_minus\_sign: | Number of text tokens in the input          | 8       |
| `video_tokens` | *Optional\[int]* | :heavy\_minus\_sign: | Number of video tokens in the input         |         |