# Your X API keys

# Your X API keys

The agent runs on the four keys of an X developer app you own. Deploying checks only that each field is filled in.

## The four keys

Each agent runs on the keys you enter. There are no shared keys.

#### Getting the keys on X

1. Open developer.x.com → Projects & Apps and open your app.
2. Set the app's permissions to **Read and write**.
3. Open **Keys and tokens**.
4. Copy the API key and the API key secret.
5. Generate the access token and secret, then copy both.

#### The fields on the card

| Setting | Value |
| --- | --- |
| API Key (Consumer Key) | The app's API key |
| API Key Secret (Consumer Secret) | The app's API key secret |
| Access token | The access token generated after setting Read and write |
| Access token secret | The secret that belongs to the access token |

> **Warning**
>
> Use an X developer app that is used for nothing else. The agent replaces every filtered-stream rule on that app with its own.

## Where you enter them

| Where | Label | When |
| --- | --- | --- |
| Onboarding, after payment | **Connect your X account** card, button **Deploy X Agent** | First deploy |
| Management → Profile | **Set up X agent** | The agent shows **Setup required** |
| Management → Profile | **Retry provisioning** | The deploy failed |
| Whitelist and Metrics tabs | **Re-enter keys** | The agent is offline because a key is missing |

The deploy button stays disabled until all four fields are filled. Spaces around a key are removed.

## What is checked

At deploy, the only check is that each of the four fields is filled. The keys are not tested with X.

A deploy with wrong keys still finishes. The agent then cannot connect to X and shows **Idle**.

**Re-enter keys** also checks the format. Each key must be 8 to 256 characters with no spaces. A key that fails shows an error in the dialog.

## Replacing keys

**Re-enter keys** appears only when a key is missing. It does not appear for keys that are filled in, including wrong or revoked ones.

To replace keys that are filled in, open a ticket in the Support tab. The Support tab shows with the switch set to Twitter.

- [Support](/group-access/access-reference#support)
- [The offline banner](/x-agents/xagent-dashboard#the-offline-banner)

## X API billing

X bills you directly for X API usage. The Metrics tab shows an estimate only.

- [The Metrics tab](/x-agents/xagent-dashboard#the-metrics-tab)
