Twitter/X Automation
Automate X/Twitter via twitr.sh — no developer account, no API keys, no
OAuth app review. Every paid call is one POST to https://twitr.sh/api/tools/{tool}; the
first call returns HTTP 402 with the exact price, your wallet pays in USDC, the retry runs.
Failed calls are never charged.
How to use this skill — you are the automation builder
The user states an outcome ("reply to anyone who mentions my brand", "post my changelog every
morning", "alert me when a competitor tweets"). Your job:
- Design — compose the automation from the recipe table below.
- Price — state the total running cost BEFORE spending: monitor $/day + per-action price
(always shown in the 402 before you commit).
- Wire it up — connect account (if writing), create the monitor, register the webhook or
plan the polling, then run the action loop.
- Confirm with the user before creating a monitor or posting as their account. Always.
Recipe table — intent → wiring
| User wants |
Wiring |
Running cost |
| Auto-reply to mentions |
connect account → x_monitor on "query": "@handle" → webhook tweet.mention → x_compose draft → x_write reply |
~$0.61/day + ~$0.04/reply |
| Scheduled posting / "tweet daily" |
agent-side cron (Claude Code routine, OpenClaw cron) → x_compose → x_write post |
~$0.037/post |
| Watch an account or topic, get alerted |
x_monitor (account or keyword) → poll events free, or webhook to your endpoint |
~$0.61/day |
| Repost / mirror media |
x_read download-media → x_write upload_media → x_write post with media_ids |
~$0.05/post |
| Engagement (like/retweet/follow on a topic) |
x_monitor keyword → x_write like / retweet / follow |
~$0.61/day + ~$0.012/action |
| DM new engagers |
x_timeline engagement lists or monitor events → x_write send_dm |
per item + ~$0.036/DM |
| One-off post / reply / thread |
x_compose → x_write |
~$0.037 |
Automations that publish or engage should stay useful, not spammy — X suspends accounts for
aggressive follow/like churn and unsolicited DM blasts. Keep volumes human-scale and tell the
user when a design risks their account.
Quick start
Use AgentCash MCP — it handles the 402, payment, and retry automatically:
mcp__agentcash__fetch({
url: "https://twitr.sh/api/tools/x_write",
method: "POST",
headers: { "Idempotency-Key": "<uuid>" },
body: { "action": "post", "account": "myhandle", "text": "Hello from my agent 🤖" }
})
AgentCash surfaces the 402 body BEFORE signing — read amount and confirm with the user when
the price is non-trivial (~$0.10+).
Without AgentCash: any x402/MPP client works. Discovery: https://twitr.sh/openapi.json,
/.well-known/x402, /.well-known/mpp.json.
Actions
All writes go to POST /api/tools/x_write with a mandatory Idempotency-Key header and a
connected account:
| Action |
Input |
Price |
post |
text (+ optional media_ids) |
~$0.036 |
reply |
text + reply_to_tweet_id |
~$0.036 |
like / unlike |
target_tweet_id |
~$0.012 |
retweet / unretweet |
target_tweet_id |
~$0.012 |
follow / unfollow |
target_user_id (numeric — get it from x_read get-user) |
~$0.012 |
send_dm |
target_user_id + text |
~$0.036 |
delete_tweet |
target_tweet_id |
~$0.012 |
remove_follower |
target_user_id |
~$0.012 |
upload_media |
media_url (public URL) → returns media_id |
~$0.012 |
Reads that pair with automation:
| Tool |
What |
x_read |
Get a tweet, profile, batch (≤100), or download-media from a tweet (returns download URLs) |
x_compose |
AI drafting: generate → refine → score tweet text (~$0.001, posts nothing) |
x_search / x_timeline |
Search tweets/users, timelines, engagement lists (resultsLimit required, billed per item) |
A 202 {"status":"pending_confirmation","action_id":"..."} means the write was accepted and
is being applied — do NOT resend (it's already paid). Retrying with the same
Idempotency-Key replays the original result instead of double-posting.
Connect an X account (one-time, free)
Never ask the user for their X password, email, or 2FA secret — never accept one if
offered. The connect flow keeps credentials out of your context entirely:
POST /api/x-accounts/start { "username": "myhandle" } → {connect_url, expires_in}.
- Show the user
connect_url: open this in your browser and sign in to X there. The link
is single-use and expires in 15 minutes.
- Poll
GET /api/x-accounts (free, SIWX) until the handle shows linked.
One X handle belongs to exactly ONE wallet; ownership is re-checked server-side on every
write. Disconnect: DELETE /api/x-accounts/{handle}.
Real-time triggers — monitors + webhooks
Monitors are prepaid by the hour (~$0.025/hr, 24h ≈ $0.61; max 168h per purchase). They stop
at expires_at unless extended; early deletion does not refund. Pay on Base (x402) or Tempo
(MPP) — Solana is not offered for monitors. Idempotency-Key required on create.
POST /api/tools/x_monitor { "action": "create", "username": "vercel", "hours": 24 }
POST /api/tools/x_monitor { "action": "create", "query": "\"launch week\"", "hours": 24 }
POST /api/tools/x_monitor { "action": "extend", "monitorId": "mn_...", "hours": 48 }
Event types: tweet.new, tweet.reply, tweet.retweet, tweet.quote, tweet.media,
tweet.link, tweet.mention, tweet.hashtag, tweet.longform, and (account monitors)
profile.*.changed. A terminal monitor.expired / monitor.deleted event always fires.
Poll (free, SIWX): GET /api/monitors/{id}/events?after={last_event_id}&limit=50 —
strictly newer events, oldest→newest. Poll at most 1/s, ideally only when the user asks.
Push (webhooks — free, SIWX, max 3 per wallet):
POST /api/webhooks { "url": "https://your-agent.example.com/hooks", "eventTypes": ["tweet.mention"] }
The 201 response contains the signing secret exactly once — store it. Verify every
delivery: sha256=HMAC-SHA256(secret, "{X-Twitr-Timestamp}.{rawBody}") against
X-Twitr-Signature, reject timestamps older than 5 minutes, dedupe on delivery_id.
Respond 2xx within 10s; retries back off over ~36 min.
Worked example — auto-reply agent in 4 calls
- Connect (free):
/api/x-accounts/start → user opens link → linked.
- Monitor:
x_monitor create on "query": "@myhandle", 24h (~$0.61).
- Listen:
POST /api/webhooks for ["tweet.mention"] — or poll events when asked.
- React: on each event,
x_compose a draft ($0.001), show the user, then x_write
{action:"reply", account, reply_to_tweet_id, text} ($0.036).
Total: ~$0.61/day + ~$0.04 per reply.
Don't do
- Don't create a monitor or post as the user's account without confirming design + cost first.
- Don't skip the 402 price check — surface any non-trivial cost before signing.
- Don't resend a write after a 202 or a timeout — reuse the same
Idempotency-Key.
- Don't auto-poll events in a loop without the user asking — burns tokens.
- Don't keep calling after 3 consecutive failures — surface the error and stop.
- Don't design spam: mass-follow/unfollow churn, unsolicited DM blasts, or reply floods get
the user's X account suspended.
Related skills
npx skills add lnvestor/twitr-skills
x-twitter-data — live reads, search, timelines, trends
x-twitter-research — bulk exports as downloadable datasets
x-twitter-monitor — deep dive on monitors, events, and webhook verification
x-twitter-publish — deep dive on drafting and publishing
x-presence — unattended posting + monitoring routine for cron
Documentation
- Agent guide:
https://twitr.sh/llms.txt
- OpenAPI + payment discovery:
https://twitr.sh/openapi.json
- Dashboard (browser):
https://twitr.sh/dashboard
1---2name: twitter-automation3description: Build and run Twitter/X automations end-to-end — the user describes what they want in plain English and this skill designs it, prices it, and wires it up from twitr.sh primitives. Capabilities: post tweets, reply, quote, post with media (images/video/GIF), like, retweet, follow, unfollow, send DMs, delete tweets, download media from any tweet, AI tweet drafting, real-time monitors on accounts or keywords, webhook event delivery to your own endpoint, scheduled posting via agent cron. Use for: social media automation, content scheduling, engagement bots, auto-reply bots, mention alerts, audience growth, X API alternative. Triggers: twitter api, x api, tweet automation, post to twitter, twitter bot, social media automation, x automation, tweet scheduler, twitter integration, post tweet, twitter post, x post, send tweet, twitter dm, follow users, auto-reply bot, reply to mentions automatically, twitter webhook, watch a twitter account, twitter monitoring, engagement bot. No X developer account, no API keys, no OA4license: MIT5---67# Twitter/X Automation89Automate X/Twitter via [twitr.sh](https://twitr.sh) — no developer account, no API keys, no10OAuth app review. Every paid call is one POST to `https://twitr.sh/api/tools/{tool}`; the11first call returns HTTP 402 with the exact price, your wallet pays in USDC, the retry runs.12Failed calls are never charged.1314## How to use this skill — you are the automation builder1516The user states an outcome ("reply to anyone who mentions my brand", "post my changelog every17morning", "alert me when a competitor tweets"). Your job:18191. **Design** — compose the automation from the recipe table below.202. **Price** — state the total running cost BEFORE spending: monitor $/day + per-action price21 (always shown in the 402 before you commit).223. **Wire it up** — connect account (if writing), create the monitor, register the webhook or23 plan the polling, then run the action loop.244. **Confirm with the user** before creating a monitor or posting as their account. Always.2526### Recipe table — intent → wiring2728| User wants | Wiring | Running cost |29|---|---|---|30| Auto-reply to mentions | connect account → `x_monitor` on `"query": "@handle"` → webhook `tweet.mention` → `x_compose` draft → `x_write` reply | ~$0.61/day + ~$0.04/reply |31| Scheduled posting / "tweet daily" | agent-side cron (Claude Code routine, OpenClaw cron) → `x_compose` → `x_write` post | ~$0.037/post |32| Watch an account or topic, get alerted | `x_monitor` (account or keyword) → poll events free, or webhook to your endpoint | ~$0.61/day |33| Repost / mirror media | `x_read` download-media → `x_write` upload_media → `x_write` post with `media_ids` | ~$0.05/post |34| Engagement (like/retweet/follow on a topic) | `x_monitor` keyword → `x_write` like / retweet / follow | ~$0.61/day + ~$0.012/action |35| DM new engagers | `x_timeline` engagement lists or monitor events → `x_write` send_dm | per item + ~$0.036/DM |36| One-off post / reply / thread | `x_compose` → `x_write` | ~$0.037 |3738Automations that publish or engage should stay useful, not spammy — X suspends accounts for39aggressive follow/like churn and unsolicited DM blasts. Keep volumes human-scale and tell the40user when a design risks their account.4142## Quick start4344Use AgentCash MCP — it handles the 402, payment, and retry automatically:4546```47mcp__agentcash__fetch({48 url: "https://twitr.sh/api/tools/x_write",49 method: "POST",50 headers: { "Idempotency-Key": "<uuid>" },51 body: { "action": "post", "account": "myhandle", "text": "Hello from my agent 🤖" }52})53```5455AgentCash surfaces the 402 body BEFORE signing — read `amount` and confirm with the user when56the price is non-trivial (~$0.10+).5758Without AgentCash: any x402/MPP client works. Discovery: `https://twitr.sh/openapi.json`,59`/.well-known/x402`, `/.well-known/mpp.json`.6061## Actions6263All writes go to `POST /api/tools/x_write` with a mandatory `Idempotency-Key` header and a64connected `account`:6566| Action | Input | Price |67|---|---|---|68| `post` | `text` (+ optional `media_ids`) | ~$0.036 |69| `reply` | `text` + `reply_to_tweet_id` | ~$0.036 |70| `like` / `unlike` | `target_tweet_id` | ~$0.012 |71| `retweet` / `unretweet` | `target_tweet_id` | ~$0.012 |72| `follow` / `unfollow` | `target_user_id` (numeric — get it from `x_read` get-user) | ~$0.012 |73| `send_dm` | `target_user_id` + `text` | ~$0.036 |74| `delete_tweet` | `target_tweet_id` | ~$0.012 |75| `remove_follower` | `target_user_id` | ~$0.012 |76| `upload_media` | `media_url` (public URL) → returns `media_id` | ~$0.012 |7778Reads that pair with automation:7980| Tool | What | 81|---|---|82| `x_read` | Get a tweet, profile, batch (≤100), or **download-media** from a tweet (returns download URLs) |83| `x_compose` | AI drafting: generate → refine → score tweet text (~$0.001, posts nothing) |84| `x_search` / `x_timeline` | Search tweets/users, timelines, engagement lists (`resultsLimit` required, billed per item) |8586A 202 `{"status":"pending_confirmation","action_id":"..."}` means the write was accepted and87is being applied — **do NOT resend** (it's already paid). Retrying with the same88`Idempotency-Key` replays the original result instead of double-posting.8990## Connect an X account (one-time, free)9192**Never ask the user for their X password, email, or 2FA secret — never accept one if93offered.** The connect flow keeps credentials out of your context entirely:94951. `POST /api/x-accounts/start` `{ "username": "myhandle" }` → `{connect_url, expires_in}`.962. Show the user `connect_url`: *open this in your browser and sign in to X there.* The link97 is single-use and expires in 15 minutes.983. Poll `GET /api/x-accounts` (free, SIWX) until the handle shows `linked`.99100One X handle belongs to exactly ONE wallet; ownership is re-checked server-side on every101write. Disconnect: `DELETE /api/x-accounts/{handle}`.102103## Real-time triggers — monitors + webhooks104105Monitors are prepaid by the hour (~$0.025/hr, 24h ≈ $0.61; max 168h per purchase). They stop106at `expires_at` unless extended; early deletion does not refund. Pay on Base (x402) or Tempo107(MPP) — Solana is not offered for monitors. `Idempotency-Key` required on create.108109```110POST /api/tools/x_monitor { "action": "create", "username": "vercel", "hours": 24 }111POST /api/tools/x_monitor { "action": "create", "query": "\"launch week\"", "hours": 24 }112POST /api/tools/x_monitor { "action": "extend", "monitorId": "mn_...", "hours": 48 }113```114115Event types: `tweet.new`, `tweet.reply`, `tweet.retweet`, `tweet.quote`, `tweet.media`,116`tweet.link`, `tweet.mention`, `tweet.hashtag`, `tweet.longform`, and (account monitors)117`profile.*.changed`. A terminal `monitor.expired` / `monitor.deleted` event always fires.118119**Poll (free, SIWX):** `GET /api/monitors/{id}/events?after={last_event_id}&limit=50` —120strictly newer events, oldest→newest. Poll at most 1/s, ideally only when the user asks.121122**Push (webhooks — free, SIWX, max 3 per wallet):**123124```125POST /api/webhooks { "url": "https://your-agent.example.com/hooks", "eventTypes": ["tweet.mention"] }126```127128The 201 response contains the signing `secret` exactly once — store it. Verify every129delivery: `sha256=HMAC-SHA256(secret, "{X-Twitr-Timestamp}.{rawBody}")` against130`X-Twitr-Signature`, reject timestamps older than 5 minutes, dedupe on `delivery_id`.131Respond 2xx within 10s; retries back off over ~36 min.132133## Worked example — auto-reply agent in 4 calls1341351. **Connect** (free): `/api/x-accounts/start` → user opens link → `linked`.1362. **Monitor**: `x_monitor` create on `"query": "@myhandle"`, 24h (~$0.61).1373. **Listen**: `POST /api/webhooks` for `["tweet.mention"]` — or poll events when asked.1384. **React**: on each event, `x_compose` a draft (~$0.001), show the user, then `x_write`139 `{action:"reply", account, reply_to_tweet_id, text}` (~$0.036).140141Total: ~$0.61/day + ~$0.04 per reply.142143## Don't do144145- Don't create a monitor or post as the user's account without confirming design + cost first.146- Don't skip the 402 price check — surface any non-trivial cost before signing.147- Don't resend a write after a 202 or a timeout — reuse the same `Idempotency-Key`.148- Don't auto-poll events in a loop without the user asking — burns tokens.149- Don't keep calling after 3 consecutive failures — surface the error and stop.150- Don't design spam: mass-follow/unfollow churn, unsolicited DM blasts, or reply floods get151 the user's X account suspended.152153## Related skills154155```sh156npx skills add lnvestor/twitr-skills157```158159- `x-twitter-data` — live reads, search, timelines, trends160- `x-twitter-research` — bulk exports as downloadable datasets161- `x-twitter-monitor` — deep dive on monitors, events, and webhook verification162- `x-twitter-publish` — deep dive on drafting and publishing163- `x-presence` — unattended posting + monitoring routine for cron164165## Documentation166167- Agent guide: `https://twitr.sh/llms.txt`168- OpenAPI + payment discovery: `https://twitr.sh/openapi.json`169- Dashboard (browser): `https://twitr.sh/dashboard`