> ## Documentation Index
> Fetch the complete documentation index at: https://docs.x.com/llms.txt
> Use this file to discover all available pages before exploring further.

# UsageClient

> Methods for X API v2 Usage endpoints.

Access **Usage** endpoints via `client.Usage` (`UsageClient`).

## Methods

| Method | Endpoint | Behavior | Summary |
| :- | :- | :- | :- |
| [`GetAsync`](#getasync) | `GET /2/usage/tweets` | Standard | Get Usage |
| [`GetCreditsAsync`](#getcreditsasync) | `GET /2/usage/credits` | Standard | Get Usage Credits |

## `GetAsync`

GET `/2/usage/tweets`

**Get Usage**

Retrieves usage statistics for Posts over a specified number of days.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    BearerToken = Environment.GetEnvironmentVariable("X_BEARER_TOKEN"),
});

var response = await client.Usage.GetAsync();
Console.WriteLine(response);
```

### Parameters

**Optional parameters (UsageClient.GetOptions — 2)**

**options.Days** `int`

`days` (query parameter).

**options.UsageFields** `List\<string\>`

A comma separated list of Usage fields to display.

**Returns:** `Task<GetUsageResponse>`

***

## `GetCreditsAsync`

GET `/2/usage/credits`

**Get Usage Credits**

Returns the payer's developer-platform credit balance in USD. total\_balance is max(0, prepaid\_balance + free\_balance); prepaid\_balance may be negative.

```csharp theme={null}
using System;
using Xdk;

using var client = new XClient(new XClientOptions
{
    BearerToken = Environment.GetEnvironmentVariable("X_BEARER_TOKEN"),
});

var response = await client.Usage.GetCreditsAsync();
Console.WriteLine(response);
```

**Returns:** `Task<GetUsageCreditsResponse>`

***
