Repository navigation
ai agent post to x
X is the platform where the API-versus-agent question is genuinely close, so this page does the arithmetic instead of picking a side first. X has a real, working write API; it costs money per request; and X publishes a dedicated automation policy that governs whichever route you take. All three facts were checked on 2026-09-03, and the honest conclusion is at the end rather than assumed at the start.
Scope, as on every page in this set: your own posts, your own account, one at a time, with you in the loop. Not engagement automation - no automated likes, reposts, replies or follows - not mass posting, not multiple accounts. X's spam enforcement is aimed at exactly that cluster, and its automation policy addresses it directly.
Creating a post through the X API v2 is one endpoint:
POST /2/tweets
authenticated with an OAuth 2.0 user token carrying the tweet.write
scope. The documented rate limits are far above human posting: 100 requests
per 15 minutes per user, 10,000 per 24 hours per app.
The part that changed and that older articles get wrong: X API pricing is now pay-per-usage, no subscription tiers. Per X's own pricing page, a standard post costs $0.015 per request, and a post containing a URL costs $0.200 per request. There is no free allowance; every call is charged.
Do the math for the register this page assumes. A person posting three times a day, every day, spends about $1.35 a month at the standard rate, or around $18 a month if every post carries a link. That is not free the way Mastodon's or Bluesky's APIs are free, but for text posts it is coffee money, and it buys the supported channel: documented behavior, no interface drift, no session to keep alive. If you can hold your nose through the developer-portal setup, the API is the robust answer for anything programmatic, and this wiki says so even though it maintains a browser agent.
The URL price is the one honest wrinkle. At $0.200 per link post, a link-heavy posting habit costs real money through the API - more than thirteen times the standard rate - and that asymmetry is presumably not an accident. It is also the one place where the economics stop being negligible and the browser route earns a look.
X maintains a dedicated automation rules page: help.x.com/en/rules-and-policies/x-automation. That page returns a 403 to plain fetchers - it did to this wiki's checks this session - so nothing from it is quoted here, because quoting a page you could not read is how documentation rots. It exists, it is X's governing document on automated behavior, and you should read it in a browser before automating anything on X, through the API or otherwise.
The risk statement, plainly: X suspends and restricts accounts for automated behavior it classifies as spam or platform manipulation, and an account driven through the web interface by an agent is automated behavior in the ordinary sense of the words, whatever the volume. Single posts of your own content with human review is the defensible end of the spectrum; it is not a guarantee. The account is yours and so is the risk. If the account matters commercially, the API route also has the advantage of being the channel X itself sells for this purpose.
Given a working API at these prices, the agent's slot on X is narrow, and it is not "saving money" for most people. It is three specific situations:
- No developer setup, ever. The API route means a developer account, an app, OAuth tokens and a credit card on file at the portal. For someone who posts occasionally and will not do that setup, an agent driving their existing logged-in session is the only automation they will actually use.
- Mixed sessions. An agent can read your timeline context, draft a reply-shaped post about something it just looked up on the web, show you, and post after your approval - one conversational loop in one browser. The API splits that across tools; the agent keeps it in one place with you watching. The drafting half of that loop is web research, which the agent does anyway.
- Link-heavy, low-volume posting, where the $0.200 per-request price makes the API cost visible and the browser costs what your model tokens cost.
The mechanics mirror the other platforms. Keep the session with
--profile-dir and log in yourself once; ask for the post to be typed and
for the agent to stop before the Post button; read it; click it yourself.
invisible_playwright_mcp types through real input events rather than script injection, the
composer is an ordinary rich-text widget by
the forms page's standards, and the
human-review rule is the README's own: nothing submits that a person has
not read. Media carries the same boundary as everywhere: the toolset has no
file-upload action, so an image post needs your hands for the attachment
in a headed session; text and link posts are fully within reach.
uvx invisible-playwright-mcp ui --profile-dir ~/.invisible_playwright_mcp-xGo to x.com. Open the composer, type exactly this post, and stop without clicking Post. Tell me when it is ready for review: "New write-up on the wiki: how the three posting routes actually compare."
For programmatic posting on X, use the API: it works, its per-post price is small for text, and it is the channel built for the purpose. The browser agent is for the person who will never open the developer portal, for sessions where reading and posting mix, and for the occasional link post priced oddly by the API - always at human frequency, always with the final click human. If your plan involves volume on either route, X's automation policy is the document standing in your way, and no tool changes that.
Can an AI agent post to X (Twitter) for me? Yes - it drives your own
logged-in session, types the post and leaves the final click to you. But
check the API first: POST /2/tweets at $0.015 per standard post is the
supported route, and for anything programmatic it is the better one.
How much does the X API cost for posting? Pay-per-usage, per X's pricing page fetched 2026-09-03: $0.015 per standard post, $0.200 per post containing a URL, no subscriptions and no free allowance. Per-user rate limit on the endpoint: 100 requests per 15 minutes.
Is automating posts against X's rules? X publishes dedicated automation rules at help.x.com (linked above; it blocks plain fetchers, so read it in a browser). Automated engagement and spam are the enforced core; posting your own content at human frequency with review is the defensible end. Account risk exists on every route and it is yours.
Can the agent post with an image? Not unattended - the toolset has no file-upload action. Text and link posts work; attach media yourself in a headed session, or use the API, which has proper media upload endpoints.
Should I use the agent to save on API costs? Mostly no. At $0.015 a post, three posts a day costs under two dollars a month through the API, less than the model tokens the agent would spend. The exception worth naming is link-heavy low-volume posting at the $0.200 URL price.
All retrieved 2026-09-03.
-
X API: creation of a post,
for
POST /2/tweets, thetweet.writescope and media constraints. - X API: rate limits, for the 100 per 15 minutes per user and 10,000 per 24 hours per app figures.
- X API: pricing, for the pay-per-usage model and the per-request prices quoted above.
- X automation rules, cited by reference; it returned 403 to plain fetches this session, so no text from it is quoted.
-
oss-invisible/playwright_mcp, plus its README
and source in this repository, for
--profile-dir, real input events, the absence of a file-upload tool, and the human-review rule.
See also: the social posting decision page, posting to Facebook, posting to Instagram, AI agents for web research, and the rest of Using the Agent.
From the invisible_playwright_mcp wiki. The page that tells you to pay X fifteen cents a day instead of running our agent is the page you can trust about the cases where the agent is the right call.
- OpenAI Operator alternatives
- Open-source Operator-style agents
- Is OpenAI Operator still available?
- OpenAI Operator vs Claude computer use
- browser-use alternatives
- Choosing an AI browser agent
- Open-source AI browser agents
- Open-source computer-use agents
- What is an AI web agent?
- AI browser agents vs traditional scraping
- Cloud browser infrastructure for AI agents, explained
- Browserbase alternatives
- Firecrawl vs an AI browser agent
- Skyvern alternatives
- Stagehand vs browser-use
- Project Mariner is gone: what replaced it
- Manus alternatives
- Gemini computer use vs Claude computer use
- A stealth browser MCP, reviewed honestly by its own wiki
- AI browser vs AI browser agent: which one do you want?
- AI browser agent vs RPA: which one fits the job
- AI browser agent vs n8n, Zapier and Make
- Vercel agent-browser alternatives, compared honestly
- What is an agentic browser? Definition and the two kinds
- Open-source agentic browsers: the three layers, compared
- Choosing an MCP server for browser automation: four axes
- Stealth MCP servers compared: Camoufox, nodriver, Patchright
- Playwright MCP alternatives, and the three you don't need
- Autonomous browser agents: the four rungs of autonomy
- What is actually free in the AI browser agent stack
- browser-use on GitHub: what the repo actually gives you
- Playwright MCP vs Chrome DevTools MCP: different jobs
- How to choose among MCP servers: a map by category
- Which MCP servers are worth adding to Claude Code
- MCP on GitHub: finding servers and judging them fast
- MCP vs an API: the decision, and what the wrapper costs
- MCP alternatives: when the protocol is the wrong shape
- Why does my AI agent get blocked?
- The timing signal AI agents give off
- Agent retry loops trip rate limits, not fingerprints
- Claude computer use detected as a bot
- browser-use getting blocked: what you can and cannot change
- Playwright MCP session blocked: four causes, four fixes
- Playwright MCP and captchas: what actually gets you past
- Cloudflare and a browser MCP server: what is being read
- Can an AI agent solve a captcha? The honest answer
- Getting an AI agent to fill out forms
- The best model for an MCP browser agent, and what it really costs
- Browser problem or model problem?
- How to use a Playwright MCP server with Claude Code
- Extracting data to a CSV with an AI agent
- Monitoring a page for changes with an AI agent
- How to let Claude Desktop control a browser
- How to add a browser to Cursor as an MCP server
- Using an AI agent to hunt for apartments
- Getting website data into Google Sheets with an AI agent
- Using an AI agent to download invoices from portals
- AI agents for web research
- Using an AI agent to test your own website
- How to add a browser to Cline as an MCP server
- Posting to social media with an AI agent
- Posting to Facebook with an AI agent
- Posting to Instagram with an AI agent
- Posting to X with an AI agent
- Automating LinkedIn posts: read this first
- Appointment bots: what they are and what an agent can legitimately do
- Track prices across sites with an AI agent
- Build a lead list with an AI browser agent
- Run an AI browser agent on a schedule
- AI browser agent with a local LLM: what changes
- Should you log your AI agent into your accounts?
- How to write a task an AI browser agent can follow
- Move data between two web apps with an AI agent
- The MCP server
- How the tools are shaped, and why
- Playwright MCP vs the Playwright CLI: which fits when
- Playwright MCP: browser is already in use, and the fix
- Playwright MCP best practices: four decisions that matter
- Playwright MCP with a proxy, and the three leaks it leaves
- A browser MCP server in GitHub Copilot: setup and limits
- Using a browser MCP server for web scraping: the pattern
- Which LLM for browser automation: the four properties
- How to build a browser agent, and what to take instead
- Getting an AI agent to log into a website: three routes
- MCP tools, resources and prompts: who controls each
- How many MCP tools is too many? The context arithmetic
- How to build an MCP server: the decisions, not the scaffold
- Local or remote MCP server: what changes, and what does not
- Writing an MCP client in Python: the thirty-line version
- Self-hosted AI agent: what one actually costs to run
- How long an AI browser agent takes per step, measured
- Text, HTML, snapshot or screenshot: what the agent should read
- Giving an AI browser agent a stopping condition
- Keeping an AI browser agent out of destructive actions
- Why did the AI agent click the wrong thing
- When the page changes under the AI agent
- Running one AI agent task across a list of sites
- Seeing a page as it appears in another country
- Getting data out of a dashboard with no export button
- Two browsers in one session: main and support
- Finding the dead links on a site with an AI agent
- Filling a CRM record from a company's website
- One form submission per spreadsheet row, with an AI agent
- Dated screenshots of a page as evidence
- Checking order and delivery status with an AI agent
- Reading a PDF that opens inside the browser
- Summarising a long page or thread with an AI agent
- Collecting every image on a page with its caption
- Collecting event and course listings with an AI agent
- Cancelling a subscription with an AI agent
- What an AI agent can and cannot do inside an iframe
- Shadow DOM and an AI agent: you can click it, you cannot read it
- How to add a browser to Codex as an MCP server
- What a page snapshot costs, per control
- How to let Gemini CLI use a browser
- Native selects and the ones that only look like selects
- Clicking by selector or by coordinates
- How long the agent waits before it gives up
- What a second browser costs
- Uploading a file with an AI agent, and why this one cannot
- Watching the agent work, and when it is worth it
- When not to use an AI browser agent
- Agent or script: deciding once instead of every time
- Using the keyboard instead of the mouse
- Secrets in an agent task: where they end up
- What an agent run should log
- Deduplicating what an AI agent collects
- Normalising values across sites
- Validating an AI agent's output
- Reading a table with an AI agent
- Driving a site's own search and filters
- The task works headed and fails headless
- How to let the AdaL CLI use a browser