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

# API Reference

> Client and method reference for the Java XDK (com.x:xdk v0.1.2).

Client setup and method reference for `com.x:xdk` `v0.1.2`.

> [card] [Maven Central](https://central.sonatype.com/artifact/com.x/xdk)
>
> `com.x:xdk` `v0.1.2` · Java 17+

> [card] [GitHub](https://github.com/xdevplatform/xdk-java)
>
> Source code and issues.

## Installation

```kotlin theme={null}
implementation("com.x:xdk:0.1.2")
```

## `XClient` Initialization

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

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

**bearerToken(String)** `XClient.Builder`

Configures an OAuth 2.0 Bearer Token for app-only requests.

**accessToken(String)** `XClient.Builder`

Configures an OAuth 2.0 user-context access token.

**oauth2(OAuth2Pkce)** `XClient.Builder`

Attaches an `OAuth2Pkce` manager for automatic token refresh.

**oauth1(OAuth1)** `XClient.Builder`

Attaches an `OAuth1` HMAC-SHA1 signer for OAuth 1.0a user-context requests.

**baseUrl(String)** `XClient.Builder` (default: [https://api.x.com](https://api.x.com))

Overrides the X API base URL.

## Clients

| Resource | Accessor | Client Class | Operations |
| :- | :- | :- | -: |
| [Account](https://docs.x.com/xdks/java/reference/clients/account.md) | `client.account()` | `AccountClient` | 2 |
| [Account Activity](https://docs.x.com/xdks/java/reference/clients/account-activity.md) | `client.accountActivity()` | `AccountActivityClient` | 5 |
| [Activity](https://docs.x.com/xdks/java/reference/clients/activity.md) | `client.activity()` | `ActivityClient` | 5 |
| [Articles](https://docs.x.com/xdks/java/reference/clients/articles.md) | `client.articles()` | `ArticlesClient` | 2 |
| [Bots](https://docs.x.com/xdks/java/reference/clients/bots.md) | `client.bots()` | `BotsClient` | 6 |
| [Broadcasts](https://docs.x.com/xdks/java/reference/clients/broadcasts.md) | `client.broadcasts()` | `BroadcastsClient` | 41 |
| [Calls](https://docs.x.com/xdks/java/reference/clients/calls.md) | `client.calls()` | `CallsClient` | 10 |
| [Chat](https://docs.x.com/xdks/java/reference/clients/chat.md) | `client.chat()` | `ChatClient` | 45 |
| [Communities](https://docs.x.com/xdks/java/reference/clients/communities.md) | `client.communities()` | `CommunitiesClient` | 2 |
| [Community Notes](https://docs.x.com/xdks/java/reference/clients/community-notes.md) | `client.communityNotes()` | `CommunityNotesClient` | 5 |
| [Compliance](https://docs.x.com/xdks/java/reference/clients/compliance.md) | `client.compliance()` | `ComplianceClient` | 6 |
| [Connections](https://docs.x.com/xdks/java/reference/clients/connections.md) | `client.connections()` | `ConnectionsClient` | 4 |
| [Direct Messages](https://docs.x.com/xdks/java/reference/clients/direct-messages.md) | `client.directMessages()` | `DirectMessagesClient` | 9 |
| [General](https://docs.x.com/xdks/java/reference/clients/general.md) | `client.general()` | `GeneralClient` | 1 |
| [Lists](https://docs.x.com/xdks/java/reference/clients/lists.md) | `client.lists()` | `ListsClient` | 9 |
| [Media](https://docs.x.com/xdks/java/reference/clients/media.md) | `client.media()` | `MediaClient` | 19 |
| [News](https://docs.x.com/xdks/java/reference/clients/news.md) | `client.news()` | `NewsClient` | 2 |
| [Posts](https://docs.x.com/xdks/java/reference/clients/posts.md) | `client.posts()` | `PostsClient` | 17 |
| [Spaces](https://docs.x.com/xdks/java/reference/clients/spaces.md) | `client.spaces()` | `SpacesClient` | 6 |
| [Stream](https://docs.x.com/xdks/java/reference/clients/stream.md) | `client.stream()` | `StreamClient` | 18 |
| [Trends](https://docs.x.com/xdks/java/reference/clients/trends.md) | `client.trends()` | `TrendsClient` | 3 |
| [Usage](https://docs.x.com/xdks/java/reference/clients/usage.md) | `client.usage()` | `UsageClient` | 2 |
| [Users](https://docs.x.com/xdks/java/reference/clients/users.md) | `client.users()` | `UsersClient` | 46 |
| [Webhooks](https://docs.x.com/xdks/java/reference/clients/webhooks.md) | `client.webhooks()` | `WebhooksClient` | 8 |
