> ## Documentation Index
> Fetch the complete documentation index at: https://openrouter-d02e98a0-mintlify-5b6e02fd.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# ChatUsage - Go SDK

> ChatUsage type definition

<Warning>
  The Go SDK and docs are currently in beta.
  Report issues on [GitHub](https://github.com/OpenRouterTeam/go-sdk/issues).
</Warning>

Token usage statistics

## Fields

| Field                     | Type                                                                                                                                   | Required             | Description                                                         | Example                                                                                                                    |
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------------------- | -------------------- | ------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| `CompletionTokens`        | `int64`                                                                                                                                | :heavy\_check\_mark: | Number of tokens in the completion                                  |                                                                                                                            |
| `CompletionTokensDetails` | optionalnullable.OptionalNullable\[[components.CompletionTokensDetails](/client-sdks/go/api-reference/models/completiontokensdetails)] | :heavy\_minus\_sign: | Detailed completion token usage                                     |                                                                                                                            |
| `Cost`                    | optionalnullable.OptionalNullable\[`float64`]                                                                                          | :heavy\_minus\_sign: | Cost of the completion                                              |                                                                                                                            |
| `CostDetails`             | optionalnullable.OptionalNullable\[[components.CostDetails](/client-sdks/go/api-reference/models/costdetails)]                         | :heavy\_minus\_sign: | Breakdown of upstream inference costs                               | `{"upstream_inference_completions_cost": 0.0004,"upstream_inference_cost": null,"upstream_inference_prompt_cost": 0.0008}` |
| `IsByok`                  | `*bool`                                                                                                                                | :heavy\_minus\_sign: | Whether a request was made using a Bring Your Own Key configuration |                                                                                                                            |
| `PromptTokens`            | `int64`                                                                                                                                | :heavy\_check\_mark: | Number of tokens in the prompt                                      |                                                                                                                            |
| `PromptTokensDetails`     | optionalnullable.OptionalNullable\[[components.PromptTokensDetails](/client-sdks/go/api-reference/models/prompttokensdetails)]         | :heavy\_minus\_sign: | Detailed prompt token usage                                         |                                                                                                                            |
| `TotalTokens`             | `int64`                                                                                                                                | :heavy\_check\_mark: | Total number of tokens                                              |                                                                                                                            |
