If you're searching for "how to connect Twitter / X to OpenClaw", the real question is usually not just whether the connection is possible. It's how to make Twitter / X usable inside an OpenClaw workflow with the right model, the right context, and the right level of control.
That's the practical framing.
OpenClaw gives you the orchestration layer: connectors, skills, tools, prompts, approvals, and the ability to run workflows where your team already works. Twitter / X provides the domain context. The integration becomes valuable when those two pieces are connected cleanly.
X API Access in 2026: What Actually Changed (Read This Before You Build)
Most "connect Twitter to OpenClaw" guides were written against the 2023-2025 API, when you picked a subscription tier called Free, Basic or Pro and paid a monthly fee. That model is gone. X moved the API to pay-per-usage credits: you buy credits upfront in the Developer Console and every request deducts from the balance, priced per resource returned rather than per call.

This matters for an OpenClaw integration specifically, because OpenClaw is agentic: it doesn't make one call, it makes a chain of calls while reasoning. A question like "how is our launch being received" turns into a search, a set of user lookups, and maybe a bookmark write. Under subscription pricing that sequence was free at the margin. Under pay-per-usage it has a price, and the bill scales with how many posts you touch, not with how many questions your team asks.
The three numbers worth internalising before you start:
| Unit | Cost | What it means in practice |
|---|---|---|
| Post: Read | $0.005 per post | A 100-post search response costs $0.50 |
| User: Read | $0.010 per user | Resolving authors/expansions doubles the bill |
| Post: Create | $0.015 per post, $0.20 with a URL | A link post costs ~13x a plain post |
| Owned Reads (your own data) | $0.001 per resource | Your own mentions/timeline at 1/5 the read price |
The $0.20 "Post: Create (with URL)" line is the one that surprises people. Most marketing posts contain a link. Ten link posts a day is $2/day in writes alone, before any reads.
The Hosted X MCP Server — And The Bridge It Requires
X ships a first-party hosted MCP server at https://api.x.com/mcp (Streamable HTTP, protocol 2025-06-18). This is real and official, and it's a genuine shortcut: it exposes 200+ X API endpoints as tools covering search, users, bookmarks, news and trends, and Articles.
It does not work like most hosted MCP servers, and this is the failure everyone hits:
X does not support dynamic client registration, and api.x.com/mcp does not advertise MCP OAuth discovery. So you cannot just paste the URL into your client and click "Connect". Instead you run a small local bridge — xurl mcp — which owns your X app's identity, does the one-time OAuth 2.0 PKCE login, and injects a fresh Bearer token on every call.
// ~/.openclaw/settings.json — bridge route (user context, required for writes)
{
mcpServers: {
xapi: {
command: "npx",
args: ["-y", "@xdevplatform/xurl", "mcp", "https://api.x.com/mcp"],
env: {
CLIENT_ID: "YOUR_X_APP_CLIENT_ID",
CLIENT_SECRET: "YOUR_X_APP_CLIENT_SECRET",
},
},
},
}
// App-only route (read-only, no user context, no refresh)
{
mcpServers: {
xapi: {
url: "https://api.x.com/mcp",
headers: { Authorization: "Bearer YOUR_APP_ONLY_BEARER_TOKEN" },
},
},
}
The two routes are not interchangeable. The app-only Bearer route is simpler and cheaper to operate, but every call is attributed to the application, not to a user — so it works for searches and lookups and fails on anything user-scoped: bookmarks, Articles, and any timeline read of "me". The bridge is required for writes.
Three prerequisites that are easy to miss:
- Register
http://localhost:8080/callbackas a redirect URI on the X app. Miss it and the browser login dies with a redirect error. - Set
startup_timeout_secto at least 300. The first-run login opens a browser and the MCP handshake is held until you finish it. Clients default to ten or thirty seconds and time out on a step the user is still performing. - Headless servers need
xurl auth oauth2 --headlessfirst. If OpenClaw runs on an EC2 box with no display, nothing will open a browser. Authenticate out-of-band with the paste-a-code flow, then the bridge reuses the cached token in~/.xurl.
A fourth, subtler one: the OAuth login authorises whichever X account is logged in when the browser opens — not necessarily the account that owns the app. If you're connecting a brand or bot account, switch accounts in the browser first, or pass -u <handle>.
Rate Limits: Three Different Ceilings, Not One
Pay-per-usage changed the billing, not the rate limits, and the limits are per-endpoint, per-window, and split between app-level and user-level.

| Endpoint | Per app | Per user | Notes |
|---|---|---|---|
/2/tweets/search/recent |
450 / 15 min | 300 / 15 min | 10 default, 100 max results; 512-char query |
/2/tweets/search/all |
1/sec, 300 / 15 min | 1/sec | 10 default, 500 max results; 1024-char query |
/2/users/:id/tweets |
10,000 / 15 min | 900 / 15 min | — |
/2/users/:id/mentions |
450 / 15 min | 300 / 15 min | — |
POST /2/tweets |
10,000 / 24 hrs | 100 / 15 min | — |
/2/users/search |
300 / 15 min | 900 / 15 min | — |
/2/tweets/search/stream |
50 / 15 min | — | 1 connection, 1,000 rules |
Two traps hide in that table:
search/allis 1 request per second per user. Bulk backfilling through the full archive will hit that ceiling immediately and the agent will see429s in the middle of a multi-step task, which reads to the user as "the integration is broken".- The default result count is 10, not the maximum. An agent that asks for "recent posts about us" without setting
max_resultsgets ten posts and confidently reports on them. Explicitly instruct the agent to request 100 (recent) or 500 (full archive), and to page withnext_tokenwhen the count equals the max.
Every response carries x-rate-limit-limit, x-rate-limit-remaining and x-rate-limit-reset (a Unix timestamp). Have the skill file tell the agent to read x-rate-limit-reset and wait until that timestamp rather than retrying with a fixed sleep.
What OpenClaw Can and Cannot Do With X
| Capability | Available? | Notes |
|---|---|---|
| Full-archive post search | ✅ | The most valuable surface for social listening |
| Recent search + post counts | ✅ | Cheaper than full archive for "what happened today" |
| User lookup, timelines, mentions | ✅ | Owned Reads pricing applies to your own account |
| Bookmarks (list/add/remove) | ✅ Bridge only | App-only Bearer cannot act as a user |
| News stories and trends by WOEID | ✅ | Trends costs $0.010/request |
| Create and publish Articles | ✅ Bridge only | Draft creation and publish are separate tools |
| Post as a user | ✅ | $0.015, or $0.20 if the post contains a URL |
| Read DMs / X Chat | ⚠️ Separate API | X Chat has its own encrypted XDK surface |
| Follow/unfollow, like at scale | ✅ Technically | Still subject to X's automation rules on the account |
| Scrape without paying | ❌ | Unofficial scrapers break constantly and risk account action |
The DM row is the one people assume wrongly. X Chat (encrypted DMs) has a separate API and a separate encryption SDK, and it is not part of the api.x.com/mcp tool set. If your workflow is "answer customer DMs", the X MCP server is not the tool — plan for the Chat API or a different channel.
Five Workflows Worth Building
1. Daily mention triage in Slack
"Search the last 24 hours of posts mentioning @ourbrand. Group them by sentiment, flag any from accounts with more than 10k followers, and draft a reply for each negative one. Do not post — show me the drafts."
Use /2/users/:id/mentions (Owned Read pricing, $0.001/resource), not a full-archive search. The mention timeline is the cheapest complete view of your own conversation.
2. Launch reception report with de-duplicated cost control
"Search full-archive for 'productname' posted in the last 48 hours, max 500 results per page. Report total post count, top 10 posts by engagement, and the dominant themes. Use the post counts endpoint first to size the conversation before pulling posts."
Ordering matters: /2/tweets/counts/all costs $0.010 per request and tells you the volume before you spend $0.005 per post reading it. A launch with 8,000 posts would cost $40 to read in full — the count endpoint is how you decide to sample instead.
3. Competitor positioning pull
"Pull the last 200 posts from @competitor, excluding replies and reposts. Summarise their messaging themes this month and compare to the themes in our own last 200 posts."
Note the exclusions: without -is:reply -is:retweet in the query you're paying for reposts of other people's content and summarising noise. Query syntax belongs in the skill file, not in every prompt.
4. Trend-to-content pipeline
"Get trends for WOEID 23424977 (United States). Find the three trends most relevant to B2B SaaS, then search recent posts for each and tell me whether there's a conversation we could credibly join this week."
Trends cost $0.010 per request, so this is a cheap daily job. It pairs well with a scheduled OpenClaw task rather than an interactive ask.
5. Bookmark intake for a research queue
"Take the links in my last 20 bookmarks, fetch each page summary, and add them to the research queue with a one-line note on why I saved it."
This is a bridge-only workflow — bookmarks are user-scoped. It's also a good example of a task where the agent's value is in the loop, not any single call.
Pitfalls Specific to X
- Old tier advice is actively wrong. If a guide tells you to "upgrade to the $5,000/month Pro tier", it is describing a product X no longer sells. Pay-per-usage replaced subscriptions; budget by resource, not by tier.
- The $0.20 URL post. Link posts cost 13x a plain post. A content calendar that publishes five link posts a day costs about $30/month in writes alone, and that's before anyone reads anything.
- App-only Bearer silently can't write. Config looks correct, tools list fine, and then bookmark and Article tools return authorisation errors. No user context is the cause, not a broken token.
startup_timeout_secdefaults below the login. The bridge waits for a human, the client gives up in 10-30 seconds, and the error looks like a network failure.localhost:8080/callbackmust be registered. Unregistered redirect = a browser error page that says nothing useful about the missing setting.- The OAuth login binds to the browser's logged-in account. Connecting a brand account while logged into a personal account authorises the wrong identity, and everything "works" against the wrong data.
- Default
max_resultsis 10. Silent truncation that reads as a complete answer. Set it explicitly, and check whether the result count hit the cap before trusting a summary. search/allis rate limited to 1 request per second per user. Long backfills get throttled mid-task; batch with pauses and readx-rate-limit-reset.- Reposts and replies are included unless excluded. Roughly half of a naive query's cost can be other people's reposts. Put
-is:retweetand-is:replyin the skill file's query templates. - Expansions multiply the bill.
expansions=author_idanduser.fieldsturn a post read into a post read plus user reads at $0.010 each. Useful, but not free. - X Chat is not in the MCP tool set. DM workflows need the separate Chat API and its encryption SDK.
- Headless servers can't complete the browser login. Run
xurl auth oauth2 --headlessonce, then the bridge reuses~/.xurl. client-not-enrolledafter a successful login means the app isn't in the Pay-per-use + Production environment in the developer portal. Nothing about the MCP config is wrong.
When Not to Build This
If the job is "watch our mentions and tell us what matters", the proxy-and-skill build is real work: OAuth, token refresh, a cost cap, a query library, and ongoing maintenance against an API that has changed pricing model twice in three years.
Cody ships the Twitter / X integration already connected, so the mentions, conversations, and account signals land in Slack without anyone owning a bridge process. If you want the self-hosted route — full control over queries and spend — the MCP bridge above is the honest, official path, and everything else on this page is what makes it stable.
Related: Connect Twitter / X to ChatGPT, OpenClaw for Twitter / X, the Twitter / X MCP server, and if you're doing the same work on the other network, how to connect LinkedIn to OpenClaw.
What “Connect Twitter / X to OpenClaw” Actually Means
In practice, connecting Twitter / X to OpenClaw usually involves four layers:
- Authentication so OpenClaw can securely access Twitter / X
- Tooling or proxy endpoints that expose the right Twitter / X actions and data
- Skills/instructions that tell OpenClaw how to reason over Twitter / X context
- Model selection so the assistant uses the right LLM for the job
That last piece matters more than most people expect.
Which Models Can You Use?
OpenClaw is model-flexible, so a Twitter / X integration does not need to be tied to a single provider. Depending on your setup, teams commonly want to use:
- OpenAI models for broad reasoning, structured extraction, and tool use
- Anthropic models for writing, analysis, and long-context work
- Google models for multimodal and large-context workflows
- Other model backends if your OpenClaw environment exposes them
Model names and availability change frequently, so check your OpenClaw model catalogue rather than copying a version from a guide. The practical point is that you can connect Twitter / X once, then choose a supported model for each workflow.
For example:
- Use Claude for nuanced summarisation or drafting
- Use OpenAI for structured extraction, tool-heavy workflows, or general-purpose copiloting
- Use Gemini when multimodal or very large context windows matter
A Good Integration Pattern for Twitter / X
A strong Twitter / X + OpenClaw setup usually looks like this:
- OpenClaw receives a request in chat or from an automation
- It calls the right Twitter / X endpoint or proxy
- The selected model reasons over the returned context
- OpenClaw returns an answer, draft, classification, or action
- High-risk actions stay behind approvals or structured guardrails
That is what makes the setup operational rather than just experimental.
Step-by-Step: Connect Twitter / X to OpenClaw
Step 1: Create a Twitter Developer Account and Project
Go to developer.twitter.com and apply for a developer account. Once approved, create a Project and an App within it. You'll receive an API Key, API Secret, Access Token, and Access Token Secret. These credentials are what your integration will use.
Step 2: Choose Your API Tier — This Is the Hard Part
Twitter/X restructured its API pricing significantly in 2023 and the free tier is extremely limited — 1,500 tweets posted per month, read access to your own account only. For any meaningful use:
- Basic tier (~$100/mo): 10,000 posts/month, limited read access
- Pro tier (~$5,000/mo): Full v2 API access, filtering streams, higher rate limits
If you want to monitor mentions, search tweets, or track competitors, you need at least the Basic tier. Full social listening requires Pro or Enterprise. Factor this cost into your decision.
Step 3: Build the OpenClaw Skill and API Proxy
Similar to other integrations, you'll need a small proxy service that stores your Twitter API credentials and exposes simple endpoints OpenClaw can call. Then write a skill file at ~/.openclaw/skills/twitter.md explaining what data is available. For read operations, use the Twitter v2 API endpoints — they're generally well-documented and stable.
Model-Specific Workflow Ideas
Twitter / X + OpenAI
Use this when you want a strong general-purpose setup for extraction, classification, action planning, and tool-driven workflows around Twitter / X.
Twitter / X + Claude
Use this when you want better writing quality, clearer summaries, stronger nuance, and reliable long-context reasoning over Twitter / X data.
Twitter / X + Gemini
Use this when the workflow benefits from large context windows, multimodal inputs, or Google-native ecosystem alignment.
Common Mistakes
Most teams do not fail because the model is bad. They fail because:
- the Twitter / X connection is too thin
- the model lacks the right live context
- prompts are vague
- no structured outputs are enforced
- permissions and approvals are skipped
- one model is forced to do every job, even when another would be a better fit
The best setup is usually one integration layer, multiple model options, and clear guardrails.
Challenges and Caveats
The Free Tier Is Nearly Useless for This Use Case
Twitter/X's free API access no longer includes meaningful read access. If you're hoping to connect OpenClaw to monitor mentions or search tweets without paying, you'll be disappointed. Budget for at least the Basic tier.
Rate Limits Bite Frequently
Even on paid tiers, Twitter's rate limits are aggressive. Searches are limited per 15-minute window. If your OpenClaw integration is responding to many Slack queries about Twitter, you may hit limits during busy periods.
API Changes Have Been Frequent and Disruptive
Since the ownership change in 2022, Twitter/X has made numerous API changes with limited notice. Integrations that worked in 2022 may require significant updates today. Plan for ongoing maintenance.
Want Twitter / X Connected to OpenClaw Without Building the Whole Stack Yourself?
Cody includes Twitter / X integration out of the box. Connect it once, then ask about mentions, replies, keyword conversations, post engagement, and audience signals directly from Slack, without managing API tiers or building your own proxy service.
Related OpenClaw Guides
- How to Connect LinkedIn to OpenClaw
- How to Connect Google Analytics to OpenClaw
- How to Connect HubSpot to OpenClaw
Looking for a more workflow-first angle? See: Twitter / X AI Automation and Twitter / X AI Assistant.
More Twitter / X Resources
- Cody AI Assistant for Twitter / X — Cody's dedicated Twitter / X integration features and benefits