跳到正文
DEV Community· Dominic Frei·· 12 小時前AI 評分62

X API 在 2026 年還能自動化甚麼?

What can you automate with the X API in 2026?

AI 導讀

截至 2026 年 11 月,X API 自助方案仍可自動發布貼文、自己貼文下的串文回覆、圖片、影片、投票和私訊,但不能自由參與他人對話。自 2026 年 2 月 23 日起,只有對方提及或引用帳戶時才能回覆其貼文;4 月 16 日起,自助方案亦移除按讚、追蹤和引用貼文,發布貼文收費 $0.015,含 URL 則 $0.200。

正文

As of November 2026, the X API still lets you automate your own publishing: posts, threads made of replies to your own posts, images and video, polls and direct messages. What you can no longer automate on a self-serve plan is engagement with other people. Since February 23, 2026, X accepts an API reply only when the original author mentioned or quoted you. On April 16, 2026 it removed likes, follows and quote posts from every self-serve tier. Posting costs $0.015 per post, $0.20 if the post contains a URL, and a non-Premium account stays at 280 characters even through the API.

What can you still automate with the X API?

You can automate anything that publishes as you. You cannot automate anything that reaches into someone else's conversation uninvited. The table sorts the common jobs by what a self-serve plan allows as of November 2026, based on X's changelog and the create post reference.

Task Self-serve plans (pay-per-use, Basic, Pro) Notes
Publish a post Yes $0.015 per post, $0.20 with a URL
Thread replies under your own post Yes You are the author, so the reply rule does not apply
Upload images, GIFs, video Yes 4 photos, or 1 GIF, or 1 video per post
Create a poll Yes 2 to 4 options of up to 25 characters, open 5 minutes to 7 days
Edit a published post Documented edit_options on the create endpoint; we have not tested it
Limit who can reply Yes reply_settings: following, mentionedUsers, subscribers, verified
Mark a paid partnership Yes paid_partnership field, added June 3, 2026
Reply to someone else's post Only if they mentioned or quoted you Enterprise is exempt
Quote a post No Enterprise only
Like or follow No Removed April 16, 2026

For a single brand the rate limits barely matter. Per the rate limit table, POST /2/tweets allows 100 requests per 15 minutes per user and 10,000 per 24 hours per app. Credits run out long before that.

Can a bot reply to other people's posts on X?

Only when that person summoned it, which X defines as mentioning your account or quoting your post. The changelog entry of February 23, 2026 says X made the change to cut automated, low-quality replies, and that it applies to self-serve tiers only. Ordinary posts that are not replies are unaffected.

In practice the refusal is an HTTP 403. We have seen X word it two ways. The first is "You can only reply to or quote posts where you are mentioned or are the author." The second is "Reply to this conversation is not allowed." Neither one is a credential problem, and a different OAuth scope will not fix it. The refusal is also permanent for that post: every retry gets the same answer.

That last point cost us real money before we handled it. In July 2026 our X lane retried 723 refused stranger replies and 722 "duplicate content" refusals, each up to the retry cap, and on a metered API every retry is a paid call. pendpost now parks a post on the first refusal of either kind instead of retrying it.

I think the rule is fair, honestly. An API that lets anyone reply to anyone at scale gets abused. It still broke a feature we had shipped. Radar, pendpost's listening feature, used to queue X replies to people asking for a tool like ours. Below Enterprise that can never work, so the Radar X lane now gives you a draft to copy and an "Open on X" link, and you post the reply by hand. If you do have Enterprise access, an owner-only setting puts the API reply back.

Can you post more than 280 characters through the X API?

Only from an account with X Premium. The counting characters guide sets the limit at 280, and the Premium help page raises it to 25,000 for subscribers. Your developer plan does not change that number; the posting account's Premium status does.

Count the way X counts. Each URL counts as 23 characters however long it is, and each emoji counts as 2. A post over the limit fails at publish time. A scheduler that swallows that failure without recording it leaves the post overdue with no error anywhere. We shipped that bug once, in July 2026, so pendpost now blocks an over-length X caption with a lint error before you can approve it. The composer can also split the text into a thread, cutting at paragraph breaks first, then sentence ends, and never rewriting a word.

How much does the X API cost in 2026?

As of November 2026, X sells self-serve access as prepaid credits. The changelog dates the pay-per-use launch to February 6, 2026, and says Basic and Pro remain available to existing subscribers. The per-request prices from the pricing page:

Request Price
Create a post $0.015
Create a post containing a URL $0.200
Create a summoned post (X's term for a reply to someone who mentioned or quoted you) $0.010
Read a post $0.005
Read a user $0.010
Read your own data (posts, followers, bookmarks) $0.001

The URL price is the one to plan around. A four-post thread with the link in the first post costs $0.245, and the link alone accounts for $0.185 of it. Reads add up too. Pay-per-use reads are capped at 3 million posts per month, per the usage and billing page, and a daily sweep of your own post metrics bills every time it runs. pendpost leaves X out of its daily insights refresh unless you opt in for that reason.

How do you post a thread through the X API without breaking it?

Post the first tweet, wait for its id, then post the next tweet with reply.in_reply_to_tweet_id set to that id, and repeat. Order is the whole difficulty. A reply cannot go out before its parent exists, because until then there is no id to point at.

We learned this the hard way on July 8, 2026. Our cloud runner queued each reply of a launch thread as its own job, and each job carried a snapshot of the plan taken when it was queued. The parent tweet did not exist yet at that moment, so every snapshot said the parent had no id, forever. Five replies failed with an empty result that read as "nothing published", and only our local backup scheduler recovered them, in order, later that morning.

The fix is a thread gate, and it is worth copying even if you never use pendpost:

  1. Resolve the parent's id when the reply fires, not when it is queued. The dispatcher passes the freshly minted id to the publish step explicitly.
  2. If the parent has not published yet, return a deferred result (parent_unpublished) and try again shortly. Never fail the reply, and never skip it silently.
  3. If the parent does not exist in the plan at all, return a terminal error (parent_missing), because waiting will not fix it.
  4. Approve each tweet of the thread on its own, so a human reads every part before any of it goes out.

The X credentials page covers connecting the lane, and the MCP server page shows how an agent drafts a thread while you keep the approval.

What happens when your X API credits run out?

Everything fails until you buy more credits. X's billing page says requests "will fail until you purchase more credits"; in our logs the status code is HTTP 402. Since the refusal is account-wide, retrying any single post is pointless.

pendpost treats the first 402 as a lane halt. It stops sending to X, shows the waiting posts as failed with the reason instead of retrying them, and waits for you. After a top-up, resuming the lane (in the dashboard or with the resume_lane tool) re-fires the due posts once, which is also the only real way to check the balance, because X offers no credits endpoint. If the credits are still not there, the halt re-arms instead of hammering the API every minute. The circuit breaker docs describe the same pattern for Meta's action blocks.

For the numbers on every other platform, see the social media API posting limits reference.


Originally published on pendpost.com. pendpost is a free, open-source (MIT), local-first social media planner where an AI agent drafts posts behind a human approval gate.

來源:DEV Community · dev.to