
OpenClaw Twitter Setup: The Complete Guide for 2026
OpenClaw has crossed 200,000 GitHub stars. It's the most popular open-source AI agent framework right now, and for good reason -- it actually works. You give it a task, it figures out the steps, and it executes.
One of the most requested skills? Posting to Twitter.
People want their OpenClaw agent to write tweets, schedule content for the week, publish threads, and manage their X presence without manual intervention. The problem is that connecting an AI agent to Twitter directly is expensive ($100/month for the API) and a security headache (you're handing your agent full access to your X account).
This guide walks through two ways to set up OpenClaw with Twitter using OpenTweet as a bridge. Your agent gets a simple REST API. It never sees your Twitter credentials. Setup takes about 3 minutes.
Prerequisites
Before starting, you need:
- OpenClaw installed on your machine. If you haven't set it up yet, follow the official docs.
- An OpenTweet account. Sign up here -- free 7-day trial, then $5.99/month.
- Your X/Twitter account connected to OpenTweet. This happens during onboarding with a one-click OAuth flow. Takes 30 seconds.
- An OpenTweet API key. Go to Settings > API > Generate New Key. The key starts with
ot_and is shown only once, so copy it somewhere safe.
That's everything. You don't need a Twitter developer account, Twitter API keys, or OAuth configuration.
Method 1: ClawHub Skill (Fastest)
ClawHub is OpenClaw's skill marketplace. The OpenTweet skill is published there, and installing it takes one command.
Step 1: Install the Skill
clawhub install opentweet-x-poster
This downloads the skill definition into your OpenClaw skills directory (~/.openclaw/skills/). The skill tells OpenClaw what API endpoints are available, how to authenticate, and what workflows to follow.
Step 2: Set Your API Key
Option A -- environment variable (recommended):
export OPENTWEET_API_KEY="ot_your_key_here"
Add this to your ~/.zshrc or ~/.bashrc so it persists across sessions:
echo 'export OPENTWEET_API_KEY="ot_your_key_here"' >> ~/.zshrc
source ~/.zshrc
Option B -- OpenClaw config file:
Add the key to ~/.openclaw/openclaw.json:
{
"secrets": {
"OPENTWEET_API_KEY": "ot_your_key_here"
}
}
Step 3: Verify It Works
openclaw "check my OpenTweet connection status"
Your agent will call GET /api/v1/me and report back something like:
Connected to OpenTweet successfully.
- Subscription: Active
- Daily post limit: 100
- Remaining today: 97
- Total posts created: 42
If you see this, you're done. Your agent can now post to Twitter.
Step 4: Start Posting
Try these commands to see it in action:
# Post a single tweet
openclaw "post a tweet about how AI agents are changing developer workflows"
# Schedule tweets for the week
openclaw "schedule 5 tweets about startup lessons for this week, mornings and afternoons"
# Create a thread
openclaw "create a twitter thread breaking down the pros and cons of remote work, 4-5 tweets"
# Bulk schedule content
openclaw "create 10 scheduled tweets about javascript tips, spread over the next 2 weeks"
Your agent handles the API calls, scheduling logic, and content creation. You just describe what you want.
Method 2: Manual SKILL.md Setup
If you don't use ClawHub or prefer to set things up manually, you can create the skill definition yourself.
Step 1: Create the Skill Directory
mkdir -p ~/.openclaw/skills/opentweet-poster
Step 2: Create the SKILL.md File
Create ~/.openclaw/skills/opentweet-poster/SKILL.md with the following content:
---
name: x-poster
description: Post to X (Twitter) using the OpenTweet API.
version: 1.0.0
homepage: https://opentweet.io
user-invocable: true
metadata: {"openclaw":{"requires":{"env":["OPENTWEET_API_KEY"]},"primaryEnv":"OPENTWEET_API_KEY"}}
---
# OpenTweet X Poster
Post to X (Twitter) using the OpenTweet REST API. All requests go to
`https://opentweet.io` with the user's API key.
## Authentication
Every request needs this header:
\`\`\`
Authorization: Bearer $OPENTWEET_API_KEY
Content-Type: application/json
\`\`\`
## Before You Start
ALWAYS verify the connection first:
\`\`\`
GET https://opentweet.io/api/v1/me
\`\`\`
## Available Actions
### Create a tweet
\`\`\`
POST https://opentweet.io/api/v1/posts
Body: { "text": "Your tweet text" }
\`\`\`
Add `"scheduled_date": "2026-03-01T10:00:00Z"` to schedule it.
### Create a thread
\`\`\`
POST https://opentweet.io/api/v1/posts
Body: {
"text": "First tweet",
"is_thread": true,
"thread_tweets": ["Second tweet", "Third tweet"]
}
\`\`\`
### Bulk create (up to 50 posts)
\`\`\`
POST https://opentweet.io/api/v1/posts
Body: { "posts": [{ "text": "Tweet 1" }, { "text": "Tweet 2" }] }
\`\`\`
### Schedule, publish, list, update, delete
\`\`\`
POST /api/v1/posts/{id}/schedule — schedule a post
POST /api/v1/posts/{id}/publish — publish immediately
GET /api/v1/posts?status=scheduled — list posts
PUT /api/v1/posts/{id} — update a draft
DELETE /api/v1/posts/{id} — delete a post
\`\`\`
## Rules
- ALWAYS call GET /api/v1/me before posting to check limits
- Tweet max: 280 characters per tweet
- Bulk limit: 50 posts per request
- Rate limit: 60 req/min, 1,000/day
- Dates must be ISO 8601 and in the future
You can also pull the full version from the OpenTweet GitHub repo or read the complete docs at opentweet.io/api/v1/docs.
Step 3: Set Your API Key
Same as Method 1 -- either an environment variable or OpenClaw config file:
export OPENTWEET_API_KEY="ot_your_key_here"
Step 4: Restart OpenClaw
OpenClaw loads skills on startup. Restart it, and the OpenTweet skill will be available.
# Verify the skill loaded
openclaw "what skills do you have?"
You should see x-poster or opentweet-poster in the list.
Configuration Options
Environment Variables
| Variable | Required | Description |
|---|---|---|
OPENTWEET_API_KEY |
Yes | Your API key (starts with ot_) |
That's the only required variable. The API base URL (https://opentweet.io/api/v1) is hardcoded in the skill definition.
OpenClaw Config File
If you prefer not to use environment variables, add the key to ~/.openclaw/openclaw.json:
{
"secrets": {
"OPENTWEET_API_KEY": "ot_your_key_here"
}
}
Multiple X Accounts
If you manage several X accounts, you can:
- Create a separate OpenTweet account for each X account
- Generate an API key for each
- Run separate OpenClaw instances with different
OPENTWEET_API_KEYvalues
Or switch keys between tasks:
OPENTWEET_API_KEY="ot_account_1_key" openclaw "post a tweet from account 1"
OPENTWEET_API_KEY="ot_account_2_key" openclaw "post a tweet from account 2"
What Your Agent Can Do (All 8 API Endpoints)
Here's every action your OpenClaw agent can take through the OpenTweet API:
1. Verify Connection (GET /api/v1/me)
Checks that the API key is valid, your subscription is active, and you have posting capacity. Your agent should always call this first.
Returns: authentication status, subscription details, daily limits, and post counts.
2. Create Posts (POST /api/v1/posts)
Create one or more tweets. Supports three modes:
- Single tweet:
{"text": "Hello world"} - Thread:
{"text": "First tweet", "is_thread": true, "thread_tweets": ["Second", "Third"]} - Bulk:
{"posts": [{"text": "Tweet 1"}, {"text": "Tweet 2"}]}-- up to 50 per request
Add "scheduled_date" to any post to schedule it for a future time.
3. List Posts (GET /api/v1/posts)
Filter by status: scheduled, posted, draft, or failed. Supports pagination with page and limit parameters.
4. Get a Post (GET /api/v1/posts/:id)
Retrieve full details for a specific post, including text, status, scheduled date, and thread data.
5. Update a Post (PUT /api/v1/posts/:id)
Edit the text of a draft or scheduled post. Cannot update posts that have already been published to X.
6. Delete a Post (DELETE /api/v1/posts/:id)
Remove a post from your queue. Works on drafts, scheduled posts, and failed posts.
7. Schedule a Post (POST /api/v1/posts/:id/schedule)
Set or change the scheduled time for a post. Date must be ISO 8601 format and in the future.
8. Publish Immediately (POST /api/v1/posts/:id/publish)
Send a post to X right now. No request body needed. The post goes live within seconds.
Real-World Examples
Example 1: Daily Content Machine
Tell your agent to create a week of content in one go:
openclaw "Create 7 tweets about building SaaS products as a solo developer.
Mix practical tips, personal insights, and hot takes. Schedule them for
next week, one per day at 9am EST."
Your agent will:
- Call
GET /api/v1/meto check limits - Generate 7 tweets with varied content
- Call
POST /api/v1/postswith a bulk payload, each with ascheduled_date - Report back with confirmation
Example 2: Thread from a Blog Post
openclaw "Turn this blog post into a Twitter thread: https://myblog.com/post.
Keep it to 5-6 tweets. Make the first tweet a strong hook."
Your agent reads the blog, creates a thread structure, and calls the API with is_thread: true.
Example 3: Draft-First Workflow
If you want to review before anything goes live:
openclaw "Create 3 tweet drafts about our new pricing page. Don't schedule
or publish them -- I want to review first."
Your agent creates posts without a scheduled_date, leaving them as drafts. You review in the OpenTweet dashboard, edit if needed, and schedule manually.
Troubleshooting
Error: 401 Unauthorized
What it means: Your API key is invalid or missing.
Fix:
- Double-check the key starts with
ot_ - Make sure it's set as an environment variable:
echo $OPENTWEET_API_KEY - If you generated a new key, the old one is revoked. Update your config.
- Regenerate the key from Settings > API if needed
Error: 403 Forbidden
What it means: Your subscription isn't active. Scheduling and publishing require an active subscription (free trial or paid).
Fix:
- Log into opentweet.io and check your subscription status in Settings
- If your trial expired, subscribe ($5.99/month)
- Creating drafts works without a subscription, but scheduling/publishing does not
Error: 429 Too Many Requests
What it means: You've hit a rate limit. Either 60 requests/minute or 1,000 requests/day.
Fix:
- Wait a minute and retry (for per-minute limits)
- Check
GET /api/v1/meto seelimits.remaining_posts_today - If your agent is in a loop, add delay logic between API calls
- For bulk content, use the bulk endpoint (
postsarray) instead of individual calls
Error: 400 Bad Request
What it means: The request body is malformed. Common causes:
scheduled_dateis in the past- Tweet text exceeds 280 characters
- Bulk request has more than 50 posts
- Missing
textfield
Fix: Check the error message in the response body. It usually tells you exactly what's wrong.
Connection Refused / Timeout
What it means: Your agent can't reach the OpenTweet API.
Fix:
- Verify you can reach the API:
curl https://opentweet.io/api/v1/me -H "Authorization: Bearer ot_your_key" - Check your firewall or proxy settings
- If OpenTweet is experiencing downtime, check status.opentweet.io
Agent Says "I don't know how to post to Twitter"
What it means: The skill isn't loaded.
Fix:
- Run
clawhub listto check installed skills - If using manual setup, verify
~/.openclaw/skills/opentweet-poster/SKILL.mdexists - Restart OpenClaw after installing or modifying skills
Security Best Practices
Your OpenClaw agent interacts with your Twitter account through an intermediary. That's already more secure than giving it direct Twitter API access. But here are a few extra precautions:
1. Use a Dedicated API Key
Generate a separate API key specifically for your OpenClaw agent. Name it something clear like "OpenClaw Production Agent" so you know what it's for.
2. Revoke Keys You're Not Using
If you generated a test key and forgot about it, revoke it. Go to Settings > API and delete any keys that aren't actively in use.
3. Use the Draft-First Workflow
For sensitive accounts, configure your agent to create posts as drafts first:
openclaw "Create tweets as drafts only. Never publish directly."
You review everything in the OpenTweet dashboard before it goes live. This adds a human review step to your autonomous posting pipeline.
4. Monitor Your Agent's Activity
Check the OpenTweet dashboard periodically. The post list shows everything your agent created, scheduled, and published. If something looks off, you can delete posts and revoke the API key.
5. Don't Hardcode Keys in Code
Use environment variables or OpenClaw's config-based secrets. Never commit API keys to version control.
# Good
export OPENTWEET_API_KEY="ot_your_key_here"
# Bad -- key is in your shell history and possibly in a script
openclaw --env OPENTWEET_API_KEY=ot_your_key_here "post a tweet"
6. Understand the Access Scope
Your OpenTweet API key can only:
- Create, schedule, update, and delete posts
- Publish posts to X
- View your posting history
- Check account limits
It cannot access your X password, OAuth tokens, DMs, followers, analytics, or profile settings. If the key is compromised, the worst case is someone posts tweets on your behalf -- which you can stop instantly by revoking the key.
A Note on Legacy Names: Clawdbot and Moltbot
If you found this page searching for Clawdbot twitter setup or Moltbot twitter integration -- you're in the right place. OpenClaw was originally called Clawdbot, then briefly Moltbot, before settling on OpenClaw.
Everything in this guide applies regardless of which name you know it by. The project, the skills system, and ClawHub all work the same way. Some older tutorials and forum posts still reference Clawdbot or Moltbot, but it's all the same framework.
If you're running an older version under the Clawdbot or Moltbot name, the skill installation is identical:
# Works on any version
clawhub install opentweet-x-poster
export OPENTWEET_API_KEY="ot_your_key_here"
What About the Twitter API Directly?
You might wonder: can't I skip OpenTweet and have OpenClaw use the Twitter API directly?
You can. But it means:
- Applying for a Twitter developer account
- Paying $100/month for the Basic API tier (Free tier has very tight limits)
- Managing four OAuth credentials in your agent's environment
- Building rate limit handling, token refresh, and error recovery
- Giving your agent full access to your entire X account
For some use cases -- like reading your timeline, monitoring mentions, or managing followers -- you need the Twitter API directly. But if your agent's job is posting content, there's no reason to pay 17x more and deal with 10x the complexity.
For a deeper comparison of all the approaches, check out our guide on how to make your AI agent post to Twitter.
Get Started
Here's the 3-minute setup:
- Sign up for OpenTweet (free 7-day trial)
- Connect your X account during onboarding
- Go to Settings > API > Generate New Key
- Install the skill:
clawhub install opentweet-x-poster - Set your key:
export OPENTWEET_API_KEY="ot_your_key_here" - Test it:
openclaw "check my OpenTweet connection"
Your OpenClaw agent can now create tweets, schedule content, publish threads, and manage your entire X posting pipeline. All for $5.99/month.
Start your free trial at OpenTweet -- give your OpenClaw agent a voice on X. 7-day free trial, $5.99/month after. Full API access, no Twitter keys needed.
Start Scheduling Your X Posts Today
Join hundreds of creators using OpenTweet to stay consistent, save time, and grow their audience.