# X (Twitter) API Key Walkthrough

**Step 1 :Create a Twitter Developer Account and App**

* &#x20; Sign-in with agent X account

<figure><img src="/files/Cy6J4ci4FyVZfcpaoknN" alt=""><figcaption></figcaption></figure>

* Go to <https://developer.x.com/en>

<figure><img src="/files/fNhMPsMofgNZf9cQQKqC" alt=""><figcaption></figcaption></figure>

* Pick a tier

<figure><img src="/files/xpy1vzcuewvmTimRi0F7" alt=""><figcaption></figcaption></figure>

* Setup billing for paid tier, or skip with free tier

<figure><img src="/files/xRX6eEPrUhb2H4DyqBzc" alt=""><figcaption></figcaption></figure>

**Step 2: Get Twitter API Keys and Tokens**

* Navigate to **User authentication settings** under your app
* Click **Set up** and configure authentication settings

<figure><img src="/files/ErwJMAxSpOFMaMIlcMHS" alt=""><figcaption></figcaption></figure>

* Select **Read & Write Access** when configuring User Authentication

<figure><img src="/files/5xVmJgDB8To9H7K8aSTi" alt=""><figcaption></figcaption></figure>

* Provide following details and save them

<figure><img src="/files/P51KOVVxC5i6m9zXfQ8H" alt=""><figcaption></figcaption></figure>

* Inside your app, navigate to **Keys and tokens**

<figure><img src="/files/j4cZSlNw5DtTUFNhSKUD" alt=""><figcaption></figcaption></figure>

* Generate the following credentials

<figure><img src="/files/7muakZGt1MINWyra0Z0M" alt=""><figcaption></figcaption></figure>

**Step 3: Configure Twitter API in aigent.run**

* Open aigent.run and navigate to the Configure Agent page
* Go to **X (Twitter)** → **X Account** tab
* Enter the API credentials

<figure><img src="/files/sni1OPj93SXIeNv30fyK" alt=""><figcaption></figcaption></figure>

* Set the Agent Handle (your Twitter handle for the bot)
* Select a suitable API Tier
  * Free
  * Basic
  * Pro
  * Enterprise
* Click Save X API Settings

**Step 4: Verify Connection**

* Click **Test validity of credentials** to check if Twitter credentials are working
* If successful, your agent will now be able to interact with Twitter

<figure><img src="/files/oibHGsqk2OE1IgNsxxid" alt=""><figcaption></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aigent.run/ai-agent-terminal/social-agents/x-twitter-api-key-walkthrough.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
