> 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 AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://openrouter.ai/docs/_mcp/server.

# CreateEmbeddingsUsage - Python SDK

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

Token usage statistics

## Fields

| Field                   | Type                                                                               | Required             | Description                                                                                                                                                                                                   | Example                                                                                                                    |
| ----------------------- | ---------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `cost`                  | *Optional\[float]*                                                                 | :heavy\_minus\_sign: | Cost of the request in credits                                                                                                                                                                                | 0.0001                                                                                                                     |
| `cost_details`          | [OptionalNullable\[operations.CostDetails\]](../operations/costdetails.md)         | :heavy\_minus\_sign: | Breakdown of upstream inference costs                                                                                                                                                                         | `{"upstream_inference_completions_cost": 0.0004,"upstream_inference_cost": null,"upstream_inference_prompt_cost": 0.0008}` |
| `is_byok`               | *Optional\[bool]*                                                                  | :heavy\_minus\_sign: | Whether a request was made using a Bring Your Own Key configuration                                                                                                                                           |                                                                                                                            |
| `prompt_tokens`         | *int*                                                                              | :heavy\_check\_mark: | Number of tokens in the input                                                                                                                                                                                 | 8                                                                                                                          |
| `prompt_tokens_details` | [Optional\[operations.PromptTokensDetails\]](../operations/prompttokensdetails.md) | :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. |                                                                                                                            |
| `total_tokens`          | *int*                                                                              | :heavy\_check\_mark: | Total number of tokens used                                                                                                                                                                                   | 8                                                                                                                          |