TUE, MAY 26, 2026
Independent · In‑Depth · Unsponsored
✎ General

X Upgrades Its API for AI Agent Builders — Pay-Per-Use Is Now Worldwide

X launched pay-per-use API access globally on April 5, adding XMCP for MCP-compatible agents, official SDKs, the xurl CLI, and a free Playground. Developers earn up to 20% back in xAI credits. Here is everything that changed and what you can build with it.

By AIToolsRecap April 6, 2026 8 min read 1025 views
Home Articles General X Upgrades API for Easier AI Agent Building — P...
X Upgrades Its API for AI Agent Builders — Pay-Per-Use Is Now Worldwide

X announced worldwide access to its pay-per-use API on April 5, 2026, completing a rollout that began in February and is now available to developers globally. The shift marks the most developer-friendly pricing change X has made since the 2022 acquisition — replacing rigid monthly subscription tiers with a credit-based model where developers pay only for the API calls they actually make.

The announcement arrived alongside a full developer tooling upgrade: a new XMCP server for MCP-compatible AI agents, the xurl command-line interface, official Python and TypeScript SDKs, and a free API Playground for safe testing without live API costs. Together, the package is X's clearest signal yet that it wants to be a real-time data layer for the AI agent era — not just a social platform with an expensive API bolted on.

How pay-per-use pricing actually works

Under the new model, developers purchase credits upfront in the X Developer Console and are charged per API call as they make requests. The pricing structure: $0.005 per post read, $0.01 per user lookup, $0.01 per post created. There are no monthly subscription minimums, no rate-limit tiers to navigate upfront, and no contract commitments. Real-time cost monitoring tools are built into the redesigned Console.

The previous pricing structure — a $200/month Basic plan and a $5,000/month Pro tier — had driven thousands of developers away from the X ecosystem over the past two years. Beloved third-party apps like Tweetbot and Twitterrific shut down permanently under the old model. Pay-per-use changes the math entirely: developers can now validate an idea on X data for $5 to $50 per month, build an MVP, test it with real users, and only scale API spending when the product generates revenue. The pay-per-use model is capped at 2 million post reads per month — above that threshold, Enterprise access is required.

For developers migrating from the legacy free tier, X issued a one-time $10 voucher to ease the transition. Existing Basic and Pro plan holders can remain on fixed monthly plans or opt into pay-per-use. New developers signing up are enrolled on pay-per-use by default.

The xAI credit bonus: up to 20% back

The most strategically interesting element of the announcement is the link between X API spending and xAI API credits. For every dollar spent on X API credits, developers earn back a percentage in free xAI API credits — scaling up to 20% back based on cumulative spend. A developer spending $1,000 on X API credits receives $200 in xAI API credits usable for Grok model access, Grok Voice, or Grok Imagine.

The incentive structure ties the X data ecosystem directly to xAI's revenue ambitions. xAI is reportedly burning through $1 billion per month as it scales AI data center infrastructure, having raised over $45 billion in direct funding including a $20 billion Series E. Driving developers to integrate Grok into their X-powered applications creates a flywheel: X API usage funds xAI credits, which funds Grok usage, which generates xAI revenue. For developers, the practical result is that building on X data now partially subsidizes access to one of the most capable real-time AI models available.

XMCP — the MCP server for X

The XMCP server is the most technically significant addition for AI agent builders. Model Context Protocol has become the default mechanism for connecting AI agents to external tools and data sources — Anthropic's MCP crossed 97 million installs in March 2026. XMCP makes X's real-time data stream natively accessible to any MCP-compatible AI agent framework, without requiring custom API integration work.

In practice, this means an AI agent built with Claude, Grok, or any MCP-compatible model can read X posts, monitor keywords, look up accounts, and post content as part of a multi-step autonomous workflow — using the same connector interface developers already use to link agents to Gmail, Google Drive, Slack, or any other MCP tool. XMCP is open source and available on the XDevelopers GitHub organization.

xurl CLI and official SDKs

The xurl CLI is X's official command-line interface for interacting with the X API. It handles OAuth 1.0a and OAuth 2.0 authentication, automatically detects and streams streaming endpoints like /2/tweets/search/stream, supports chunked media uploads, and provides a built-in webhook testing workflow using ngrok for local development. Credentials are stored securely in a YAML config at ~/.xurl with per-app isolation. xurl is available under MIT license on GitHub.

Official Python and TypeScript SDKs ship alongside xurl, giving developers idiomatic library support for the most widely used languages in AI agent development. Previously, developers building X integrations relied on community-maintained libraries with varying levels of currency and support. Official SDK support closes that gap and removes a common friction point for teams evaluating whether X data is worth integrating into their agent stack.

The free API Playground

The API Playground is a standalone local HTTP server that simulates the X API v2 for testing and development, with an interactive web UI. Developers can test their API integrations, explore endpoint behavior, and iterate on agent workflows without making live API calls — and without spending real credits. The Playground is available on GitHub under the XDevelopers organization and is available free of charge to all developers regardless of API plan.

What builders are saying — and the cost concern

Developer reaction to the announcement has been broadly positive, particularly around the real-time data access use cases. Monitoring bots, sentiment trackers, engagement autopilots, thread repurposing tools, and social-signal-based lead generation systems all become economically viable at $0.005 per post read in ways they were not under the $200/month floor. The xAI credit bonus has been described by some indie builders as making X "the first social platform where API spending also buys you AI compute."

The critical note came from Andrej Karpathy, who flagged that write costs — $0.01 per post created — remain high for agent workflows that need to post at volume, and that X's API documentation still needs agent-friendly adjustments to support the kinds of autonomous, multi-step workflows that the new tooling is clearly designed to enable. X acknowledged both concerns and indicated it is working on quick improvements to documentation and pricing ergonomics for high-frequency posting use cases.

What you can build with it now

The combination of pay-per-use pricing, XMCP, and the xAI credit bonus opens up a practical builder toolkit. A social listening agent that monitors keywords in real time and uses Grok to generate intelligent replies costs roughly $15/month in API credits for 2,000 posts read plus posting responses back. A competitive intelligence tracker that pulls mentions and enriches leads with account data via the $0.01 user lookup runs profitably at $30/month in API costs for a product sold at $79 to $149/month. A thread repurposing tool that pulls creator content via the API and reformats it for newsletters using AI can run as a bring-your-own-key one-time purchase — zero recurring API cost to the builder.

The key constraint to plan around: the 2 million post read cap on pay-per-use. Applications expecting to process more than that will need to budget for Enterprise access, which remains negotiated rather than self-serve. For most indie builders and early-stage startups, 2 million reads per month is sufficient headroom to build and validate a real product. The door that has been closed to developers for two years just opened — and the tools to walk through it are available today.

Tags
AI agentsAI NewsGenerative AIGrokgrowth agentsCoding AI2026