Social · write$0.006–$0.036 / call

X/Twitter Write: Post, like & follow on X, paid by the call.

Act on X/Twitter through an account you connect: post a tweet, reply, like, retweet, follow or unfollow, send a DM, delete a tweet, remove a follower, or upload media. Ownership is checked server-side — an agent can only write as a handle its own wallet connected. No signup, no API keys — every request is paid in USDC through the HTTP 402 flow, and the exact price is quoted before you pay.

Quickstart

One endpoint: POST /api/tools/x_write over HTTP, or the x_write tool over MCP at POST /api/mcp.

curl -X POST https://twitr.sh/api/tools/x_write \
  -H 'Content-Type: application/json' \
  -d '{"action":"post","account":"myhandle","text":"gm from my agent"}'

# → 402 Payment Required with the exact USDC price.
# Pay it (x402 on Base/Solana, MPP on Tempo) and retry the same request → 200 + data.
# x402-aware clients do both steps automatically.

How to use it

PREREQUISITE: connect an X account first — POST /api/x-accounts/connect (free, SIWX) with {username, email, password, and totp_secret if the account has 2FA}; finish any email code via /api/x-accounts/confirm. Then reference the linked handle in `account`. Actions: post (text) | reply (text + reply_to_tweet_id) | like|unlike|retweet|unretweet|delete_tweet (target_tweet_id) | follow|unfollow (target_user_id — the NUMERIC user id, get it from x_read get-user) | remove_follower (target_user_id of the follower) | send_dm (target_user_id + text) | upload_media (media_url → returns media_id). You can only write as a handle THIS wallet connected (checked server-side; the input account is not trusted). Payment settles before the action runs and is non-refundable; a write may return status=pending_confirmation with an actionId to poll — do NOT resend. Idempotency-Key header is required so a retry replays the original result instead of acting twice.

Fixed price per action, charged on acceptance. An Idempotency-Key header is required, so a retry replays the original result instead of charging twice. Full input schema in the OpenAPI spec.

FAQ

What does the X/Twitter Write tool do?

Act on X/Twitter through an account you connect: post a tweet, reply, like, retweet, follow or unfollow, send a DM, delete a tweet, remove a follower, or upload media. Ownership is checked server-side — an agent can only write as a handle its own wallet connected. It is one of 14 pay-per-call X/Twitter tools on twitr.sh, available over HTTP (POST /api/tools/x_write) and MCP (tool name x_write).

How much does X/Twitter Write cost?

$0.006–$0.036 per call in USDC. Fixed price per action, charged on acceptance. An Idempotency-Key header is required, so a retry replays the original result instead of charging twice.

How do I call X/Twitter Write without an API key?

POST https://twitr.sh/api/tools/x_write with your input. The first response is HTTP 402 Payment Required carrying the exact price; pay it in USDC (x402 on Base or Solana, MPP on Tempo) and retry the identical request to get the data. No signup — the wallet is the account.

Can an AI agent use X/Twitter Write through MCP?

Yes. Call the x_write tool via the MCP endpoint at POST https://twitr.sh/api/mcp — tools/list is free, tools/call is payment-gated with a JSON-RPC 402. The installable agent skill at https://twitr.sh/skill.md covers the full workflow.

Related tools