How to post a thread on X with an API

Send one request with the first post in content and each reply in segments. Octopost posts the first tweet, then each reply as a reply to the one before it, so X shows a native thread. Up to 24 replies, one request, and the whole thread is scheduled, queued or approved as a single post.

What a thread takes on the raw X API

X has no "create thread" endpoint. A thread is a chain of separate posts: you create the first one, read its id from the response, then create the next post with reply.in_reply_to_tweet_id set to that id, and repeat. Each step needs a valid OAuth 2.0 user token, and each one can fail on its own, which leaves half a thread on your timeline.

Octopost does the chaining on its side. You send the text of every post at once; it publishes them in order and reports the URL of each one. You connect your X account in the dashboard once, so there is no X developer app or token refresh for you to manage.

One request, one thread

Get an API key from the dashboard, connect X, then send the thread. published: true posts it now; leave it out and add scheduledFor to post it later.

cURL

curl -X POST https://octopost.ink/api/posts \
  -H "Authorization: Bearer op_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "content": "We rebuilt our importer. It is 6x faster. Here is what changed:",
    "platforms": ["twitter"],
    "published": true,
    "segments": [
      { "content": "1. We stream rows instead of loading the whole file." },
      { "content": "2. Validation runs in a worker, off the request path." },
      { "content": "Full write-up: https://example.com/blog/importer" }
    ]
  }'

Same thread from an agent (MCP), as a prompt

Turn these release notes into an X thread of 4 posts, under 280 characters
each. Put the link to the changelog in the last reply. Queue it for my
approval instead of posting it.

Through the MCP server the agent calls queue_post or create_post with the same segments array. Field details are in the threaded posts docs and the Posts API reference. If you have a long draft and want to see where it splits, paste it into the thread splitter first.

Putting the link in the last reply rather than the first post is a common pattern: the first post carries no link, and X units are charged per post (a post with a link uses 13, a plain one 1), so a 4-post thread with one link in the last reply uses 16 units. See what posting to X through the API costs.

Limits worth knowing

  • Up to 24 replies after the first post, 25 posts in total.
  • Each post must fit 280 characters, and every link counts as 23. X Premium long posts are not supported.
  • Each post in the thread can carry its own media: up to 4 images or 1 video, not both.
  • X is the live network today. Threads opens after Meta approves the Octopost app, and Bluesky and Mastodon threading is in testing.
  • The thread is one post in Octopost: one queue slot, one schedule entry, one approval.

Questions

Can I post a Twitter thread through the API without my own X developer account?

Yes. You connect your X account to Octopost once and Octopost publishes with its own X app. You only need an Octopost API key.

How many tweets can one thread have?

Up to 25: the first post plus 24 replies, each up to 280 characters.

Can I schedule a thread for later?

Yes. Add scheduledFor with an ISO 8601 time including a timezone offset, or queueStatus "queued" to let the interval queue pick the time. The whole thread goes out together.

Can an AI agent write and post the thread?

Yes. Connect Claude Code, Cursor, Codex CLI, Gemini CLI or Windsurf to the Octopost MCP server and ask for a thread. The agent sends the segments for you, and with needs_approval set nothing posts until you approve it.

Does each post in a thread use X units?

Yes. X bills per post, so each post in the thread counts: 1 unit for a plain post, 13 for a post that contains a link.

Start for $1

Every plan includes the MCP server and the REST API. Basic is $29 a month for 3 accounts, Premium $79 for 10, Business $199 for unlimited. The first 7 days cost $1, then the plan renews monthly unless you cancel.

Try it 7 days for $1