Post to X from OpenClaw
If you run an account on X, your Operator.io agent can handle the draft, review, schedule, and publish loop: you describe what you want to say, it writes the post in your voice, shows you the draft, and publishes on your approval or on a standing schedule you set once. The setup has more steps than most integrations here because X charges for API access and requires a user authorized token to post, so it is worth doing carefully once and then letting the loop run.
What you get
The X skill gives OpenClaw three actions on your account:
- Post to your account through the Create Post endpoint.
- Delete a post.
- Check which account it is connected to, which matters the first time you wire up a token and want to confirm it is posting as you.
Those three actions cover a full autoposting workflow. In the draft loop, you give the agent a rough idea or a link to something you wrote, it turns that into a finished post within X's character limit, and sends the draft to you in Telegram or Discord before anything goes live. In the review loop, you edit the wording, ask for alternatives, or reject it and start over.
In the schedule loop, you tell the agent your posting times once and it queues polished versions through a cron job, checking in with the draft before each one publishes until you trust the routine enough to let them go automatically. In the publish loop, the agent calls the API with your approved text and confirms the post ID back to you in chat.
One limit up front: this skill posts text only. Attaching images or video is not part of it, so if a post needs a graphic, either post that one by hand or run it through Zernio, which handles media across platforms. Composio is another route: you connect X and your other social accounts through a link rather than wiring up a token yourself.
X API access and cost
As of early 2026, X moved its API to pay per use billing. There is no free tier for new developers, and the old Basic and Pro monthly plans are closed to new signups. You buy credits in the Developer Console and each API call deducts from that balance in real time. The console shows usage per endpoint and deduplicates repeated reads of the same resource within a 24 hour window.
Each write is metered, and the rate depends on what the post carries:
| Action | Approximate cost |
|---|---|
| Post without a link | $0.015 |
| Post containing a URL | $0.20 |
| Post read | $0.005 per resource |
The URL post runs roughly thirteen times the plain one, which is how X prices automated link distribution apart from ordinary posting. Post reads are capped at two million a month on pay per use before Enterprise access is required. Rates can change, so check the pricing page in your console before you wire this up.
At those rates, a daily text post without links runs about $0.45 a month. Adding a link to every post pushes that to about $6 a month. Telling the agent to keep links out of routine posts and save them for the ones you publish manually is the simplest way to keep costs down.
Posting requires a user authorized token. An app only bearer token can read public data but cannot publish on your behalf, so the steps below set up OAuth 2.0 with the tweet.write scope through the authorization code flow.
Step 1: Create a project and app
Apply for a developer account at developer.x.com and create a project with an app inside it. In the app's settings, turn on OAuth 2.0 and request the tweet.read, tweet.write, users.read, and offline.access scopes. The offline access scope lets the token refresh without you reauthorizing every few hours. Add credits to your account in the Developer Console so writes can go through.
Step 2: Generate a user access token
Run the OAuth 2.0 authorization code flow for your app to authorize your own account. The flow redirects you to X's login page, you approve the app's permissions, and X returns a user access token tied to your account with the write scope. The X API introduction and the OAuth 2.0 authorization code documentation cover the endpoints and redirect URI setup. The token you want is the user access token, not the app's bearer token, which cannot post.
Step 3: Add the token to Operator
In your Operator dashboard, open Environment and add a variable named X_ACCESS_TOKEN with your user access token as the value. It is encrypted and shown once. The X skill is already on OpenClaw and picks the token up by name, so once it is saved the agent can post.
Step 4: Run a draft and publish loop
Connect Telegram or Discord on the channels page if you have not, then start handing it posts:
Draft a post about the feature we shipped today and show it to me before you post anything.
Here are three rough ideas. Turn each into a post in my voice and post one every morning at 9am this week.
The first example runs a single draft and publish cycle: the agent writes, you review, and it posts only after you say yes. The second sets up a schedule loop: the agent drafts three posts, shows you each one before its slot, and publishes on the mornings you named.
The review step earns its place while you build trust because a post is live to everyone the moment the API call returns, and deleting it afterward does not pull it back from the people who already saw it or grabbed a screenshot. The token holds the tweet.write scope on its own, so a scheduled job or a stray line in your channel can reach the account with no person in the loop unless you keep one there.
The schedule loop is where that judgment belongs. Keep the draft check on anything that names customers, pricing, competitors, or numbers you have not announced, and let only the routine updates publish on their own once the voice is consistent. If you share the channel the agent listens on, the same thinking covers who can set a post in motion, since the API treats a post as a post no matter who asked for it.
Character limits and formatting
Standard posts on X allow up to 280 characters for most accounts. The agent drafts within that limit and can split longer ideas into a thread if you ask, though each post in a thread is a separate API write at the per post rate. Hashtags and mentions count toward the character total the same way they do when you compose in the X app.
The text skill does not upload media. If you need an image with a post, draft the text through the agent and attach the image yourself in the X app, or use Zernio or Composio for a media capable route.
Good to know
Keep an eye on your credit balance in the Developer Console, since a busy posting schedule adds up and a post with a link adds up faster. When posts fail, the two usual causes are a token without the tweet.write scope and an empty credit balance. X also rejects an identical post sent twice in quick succession, so if a scheduled repeat silently does not appear, a duplicate is usually why.
If the token ever leaks or you just want the agent to stop posting, revoke it. Regenerate or delete it in the Developer Console, or remove the app under your X account's connected apps, and the next attempt fails instead of going out. Because the user token is what carries the standing schedule through the offline access scope, that one move also ends the automation rather than leaving a cron job posting on its own.
If you only want OpenClaw to draft posts for you to publish by hand, skip the token entirely and have it write drafts in chat. You lose the schedule and publish automation, but you pay nothing to the API and you still get the drafting help.
Frequently asked questions
Does the X API still have a free tier in 2026?
+
X moved to pay per use billing in early 2026, with no free tier for new developers and legacy Basic and Pro monthly plans closed to new signups. You buy credits in the Developer Console and each write is metered. A plain post costs about $0.015 per request and a post containing a URL costs about $0.20. Check the pricing page before you wire it up, and tell the agent to keep links out of routine posts if cost matters.
What token do I need for the agent to post to X?
+
A user authorized OAuth 2.0 access token, not an app only bearer token, which can read but cannot publish. Create a project and app at developer.x.com, turn on OAuth 2.0, request the tweet.read, tweet.write, users.read, and offline.access scopes, then run the authorization code flow to get a user access token tied to your account. Add it to Operator's Environment as X_ACCESS_TOKEN.
Can the agent post images or video to X?
+
Why did my X post fail?
+
The two usual causes are a token without the tweet.write scope and an empty credit balance, and both show up in the Developer Console. X also rejects an identical post sent twice in quick succession, so if a scheduled repeat silently does not appear, a duplicate is usually why. If you only want the agent to draft posts for you to publish by hand, skip the token and have it write drafts only.
Keep reading
Run your social accounts with Zernio
Connect Zernio and your Operator agent can draft, schedule, and publish across Instagram, TikTok, X, LinkedIn, and more from a single key.
May 26, 2026Connect Pipedream to your agent and reach the apps you use
Link your own Pipedream account to Operator and your agent reaches Gmail, Slack, Notion, and the rest of your apps through one managed connection, with the OAuth sign in and token refresh handled for you.
May 31, 2026How to set up OpenClaw on Discord, step by step
Create a bot in the Discord Developer Portal, turn on the Message Content Intent, invite it with the right scopes, drop the token and application ID into your config, then approve the DM pairing code, including the intent toggle that leaves most bots online but silent.
May 31, 2026