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

# GeneralClient

> Methods for X API v2 General endpoints.

Access **General** endpoints via `client.general()` (`GeneralClient`).

## Methods

| Method | Endpoint | Behavior | Summary |
| :- | :- | :- | :- |
| [`getOpenApiSpec`](#getopenapispec) | `GET /2/openapi.json` | Standard | Get OpenAPI Spec |

## `getOpenApiSpec`

GET `/2/openapi.json`

**Get OpenAPI Spec**

Retrieves the full OpenAPI Specification in JSON format. (See [https://github.com/OAI/OpenAPI-Specification/blob/master/README.md](https://github.com/OAI/OpenAPI-Specification/blob/master/README.md))

```java theme={null}
import com.x.xdk.XClient;

XClient client = XClient.builder()
    .bearerToken(System.getenv("X_BEARER_TOKEN"))
    .build();

var response = client.general().getOpenApiSpec();
System.out.println(response);
```

**Returns:** `Map<String, Object>`

***
