ChirpieDocs
Platforms

X API for AI agents

Let an AI agent post, thread, schedule and track posts on X (Twitter) through one Chirpie API key or MCP tool, with no X developer account.

Updated October 2026

How do you post to X from an AI agent?

Connect your X account to Chirpie once with OAuth, then let the agent call one endpoint, POST /api/v1/posts, or the chirpie_post MCP tool. Chirpie handles the X API, token refresh, media upload and the 280 or 25,000 character limit. Add Chirpie to Claude from the Claude Connectors Directory and the agent can post without any code.

What Chirpie does on X

  • Posts with text up to 280 characters, or 25,000 on an X Premium account, published now or at a scheduled time.
  • Threads of 2 to 25 posts as a native reply chain, all or nothing: if a part fails, every part already published is deleted. See Threads.
  • Media: up to 4 images (JPEG, PNG, WebP or GIF, 5 MB each) or 1 video (MP4 or MOV, up to 512 MB), with alt text up to 1,000 characters. See Media.
  • First comment: first_comment publishes a reply under the post the moment it goes out, the "link in the first comment" pattern. See First comment.
  • Comments: list the replies to a post Chirpie published, answer them, and delete your own replies. See Comments.
  • Analytics: impressions, likes, reposts, replies, quotes, bookmarks and clicks. See Analytics.
  • Scheduling, drafts and editing: queue a post for later, save a draft, or edit a post until it goes out. See Scheduling.
  • Several accounts at once: one request publishes to X and your other networks, with per-account text. See Post to several accounts at once.
  • Delete: removes the post from X and keeps Chirpie's record of it, marked deleted.
  • Your own X keys: connect your own X developer app if you would rather pay X directly. See Bring your own X keys.

Connect your X account

X connects with OAuth 2.0. Pick X on the Accounts page, or start the flow from the API and open the authorization_url it returns:

curl -X POST https://chirpie.ai/api/v1/accounts \
  -H "Authorization: Bearer chirpie_sk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "platform": "x" }'

From the terminal, chirpie accounts connect-x. From an agent, ask it to "connect my X account" and it calls chirpie_connect_x and hands you the link. Chirpie stores the tokens encrypted and refreshes them before they expire.

Post from code

curl -X POST https://chirpie.ai/api/v1/posts \
  -H "Authorization: Bearer chirpie_sk_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "account_id": "YOUR_X_ACCOUNT_ID",
    "text": "We just shipped dark mode.",
    "first_comment": "Release notes: https://example.com/changelog"
  }'
import { ChirpieClient } from "@chirpie/sdk";

const chirpie = new ChirpieClient({ apiKey: process.env.CHIRPIE_API_KEY! });

await chirpie.createThread({
  account_id: "YOUR_X_ACCOUNT_ID",
  posts: [
    { text: "1/ What we learned shipping an agent to production." },
    { text: "2/ Retries need idempotency keys. Every one of them." },
    { text: "3/ Full write-up on the blog." },
  ],
});

The full request reference is Posts and Threads.

Post from Claude or ChatGPT

Add Chirpie to Claude from its listing in the Claude Connectors Directory, or add https://chirpie.ai/mcp as an app in ChatGPT developer mode, and sign in. Then ask:

  • "Post 'We just shipped dark mode' to X, with the changelog link as the first comment."
  • "Turn these release notes into a five-part X thread and schedule it for 9am tomorrow."
  • "How did my last X post do? List the replies that ask a question."

Setup guides: Claude, ChatGPT. A full walkthrough is in Post to X from Claude.

Frequently asked questions

Do I need an X developer account to post to X with Chirpie?

No. You connect your X account to Chirpie with OAuth, and Chirpie makes the X API calls for you. If you already pay X for API access, you can connect your own X developer app instead and Chirpie uses your keys.

Can an AI agent post a thread on X?

Yes. POST /api/v1/threads, the chirpie thread command or the chirpie_thread MCP tool publishes 2 to 25 posts as a native reply chain. If any part fails, the parts already published are deleted, so a thread is never left half posted.

How long can an X post be?

280 characters on a standard X account and 25,000 on an X Premium account. Chirpie checks the account's Premium status and applies the right limit to each account.

X charges API operators more for a post that contains a link, so on paid plans an X link post carries a per-post charge on top of the plan, and the Free plan refuses X link posts. Accounts connected with your own X developer app are exempt. See the pricing section and Bring your own X keys.

Which X metrics does Chirpie report?

Impressions, likes, reposts, replies, quotes, bookmarks and clicks for each published post, through GET /api/v1/analytics/posts/:id or the chirpie_analytics tool.

On this page