1.0.0-beta87 (latest) 1.0.0-beta86

    public sealed class UsageMetadata : IMessage<UsageMetadata>, IEquatable<UsageMetadata>, IDeepCloneable<UsageMetadata>, IBufferMessage, IMessage

Reference documentation and code samples for the Vertex AI v1beta1 API class UsageMetadata.

Usage metadata about the content generation request and response.
This message provides a detailed breakdown of token usage and other
relevant metrics.

## Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) \> UsageMetadata

## Implements

[IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage-1.html)[UsageMetadata](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.UsageMetadata), [IEquatable](https://learn.microsoft.com/dotnet/api/system.iequatable-1)[UsageMetadata](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.UsageMetadata), [IDeepCloneable](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IDeepCloneable-1.html)[UsageMetadata](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.UsageMetadata), [IBufferMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IBufferMessage.html), [IMessage](https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.IMessage.html)

## Inherited Members

[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Namespace

[Google.Cloud.AIPlatform.V1Beta1](https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1)

## Assembly

Google.Cloud.AIPlatform.V1Beta1.dll

## Constructors

### UsageMetadata()

    public UsageMetadata()

### UsageMetadata(UsageMetadata)

    public UsageMetadata(UsageMetadata other)

| **Parameter** ||
|---|---|
| **Name** | **Description** |
| `other` | `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.UsageMetadata` |

## Properties

### CacheTokensDetails

    public RepeatedField<ModalityTokenCount> CacheTokensDetails { get; }

Output only. A detailed breakdown of the token count for each modality in
the cached content.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.ModalityTokenCount` |   |

### CachedContentTokenCount

    public int CachedContentTokenCount { get; set; }

Output only. The number of tokens in the cached content that was used for
this request.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

### CandidatesTokenCount

    public int CandidatesTokenCount { get; set; }

The total number of tokens in the generated candidates.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

### CandidatesTokensDetails

    public RepeatedField<ModalityTokenCount> CandidatesTokensDetails { get; }

Output only. A detailed breakdown of the token count for each modality in
the generated candidates.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.ModalityTokenCount` |   |

### PromptTokenCount

    public int PromptTokenCount { get; set; }

The total number of tokens in the prompt. This includes any text, images,
or other media provided in the request. When `cached_content` is set,
this also includes the number of tokens in the cached content.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

### PromptTokensDetails

    public RepeatedField<ModalityTokenCount> PromptTokensDetails { get; }

Output only. A detailed breakdown of the token count for each modality in
the prompt.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.ModalityTokenCount` |   |

### ThoughtsTokenCount

    public int ThoughtsTokenCount { get; set; }

Output only. The number of tokens that were part of the model's generated
"thoughts" output, if applicable.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

### ToolUsePromptTokenCount

    public int ToolUsePromptTokenCount { get; set; }

Output only. The number of tokens in the results from tool executions,
which are provided back to the model as input, if applicable.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

### ToolUsePromptTokensDetails

    public RepeatedField<ModalityTokenCount> ToolUsePromptTokensDetails { get; }

Output only. A detailed breakdown by modality of the token counts from the
results of tool executions, which are provided back to the model as input.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://cloud.google.com/dotnet/docs/reference/Google.Protobuf/latest/Google.Protobuf.Collections.RepeatedField-1.htmlhttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.ModalityTokenCount` |   |

### TotalTokenCount

    public int TotalTokenCount { get; set; }

The total number of tokens for the entire request. This is the sum of
`prompt_token_count`, `candidates_token_count`,
`tool_use_prompt_token_count`, and `thoughts_token_count`.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://learn.microsoft.com/dotnet/api/system.int32` |   |

### TrafficType

    public UsageMetadata.Types.TrafficType TrafficType { get; set; }

Output only. The traffic type for this request.

| **Property Value** ||
|---|---|
| **Type** | **Description** |
| `https://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.UsageMetadatahttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.UsageMetadata.Typeshttps://docs.cloud.google.com/dotnet/docs/reference/Google.Cloud.AIPlatform.V1Beta1/latest/Google.Cloud.AIPlatform.V1Beta1.UsageMetadata.Types.TrafficType` |   |