> ## 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

> Reference for the UsageClient class in the X API TypeScript SDK. Methods, parameters, and return types for the X API v2 usage endpoints.

Cliente para operaciones de usage

This client provides methods for interacting with the usage endpoints
of the X API. It handles authentication, request formatting, and response
parsing for all usage related operations.

## Constructores

### constructor

• **new UsageClient**(`client`): [`UsageClient`](/xdks/typescript/reference/classes/UsageClient)

Creates a new usage client instance

#### Parámetros

| Nombre   | Tipo                                                  | Descripción                    |
| :------- | :---------------------------------------------------- | :----------------------------- |
| `client` | [`Client`](/xdks/typescript/reference/classes/Client) | The main X API client instance |

#### Devuelve

[`UsageClient`](/xdks/typescript/reference/classes/UsageClient)

#### Definido en

[usage/client.ts:68](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/usage/client.ts#L68)

## Métodos

### get

▸ **get**(`options`): `Promise`\<`Response`>

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

#### Parámetros

| Nombre    | Tipo                                                       |
| :-------- | :--------------------------------------------------------- |
| `options` | `GetOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } |

#### Devuelve

`Promise`\<`Response`>

Promise resolving to the API response, or raw Response if requestOptions.raw is true

#### Definido en

[usage/client.ts:109](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/usage/client.ts#L109)

▸ **get**(`options?`): `Promise`\<[`Get2UsageTweetsResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2UsageTweetsResponse)>

#### Parámetros

| Nombre     | Tipo         |
| :--------- | :----------- |
| `options?` | `GetOptions` |

#### Devuelve

`Promise`\<[`Get2UsageTweetsResponse`](/xdks/typescript/reference/interfaces/Schemas.Get2UsageTweetsResponse)>

#### Definido en

[usage/client.ts:118](https://github.com/xdevplatform/xdk-typescript/blob/81aacb165e0802e188f608bdf462b60fc4e713a2/src/usage/client.ts#L118)
