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

Client for usage operations

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.

## Constructors

### constructor

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

Creates a new usage client instance

#### Parameters

| Name     | Type                                                  | Description                    |
| :------- | :---------------------------------------------------- | :----------------------------- |
| `client` | [`Client`](/xdks/typescript/reference/classes/Client) | The main X API client instance |

#### Returns

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

#### Defined in

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

## Methods

### get

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

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

#### Parameters

| Name      | Type                                                       |
| :-------- | :--------------------------------------------------------- |
| `options` | `GetOptions` & \{ `requestOptions`: \{ `raw`: `true`  }  } |

#### Returns

`Promise`\<`Response`>

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

#### Defined in

[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)>

#### Parameters

| Name       | Type         |
| :--------- | :----------- |
| `options?` | `GetOptions` |

#### Returns

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

#### Defined in

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