Documentation
Three ways to connect
Local MCP for IDE agents, REST API with x402 micropayments for developers, or ACP marketplace for agent-to-agent commerce.
Quick Start
1
Run xbird login
Auto-detects your Twitter session from the browser. Encrypts credentials into a self-contained stateless token locally — nothing is sent to the server.
2
Fund your wallet
xbird auto-generates a wallet at ~/.config/xbird/wallet.json. Send ~$0.01 USDC on Base — enough for hundreds of API calls.
3
Make your first request
Use @x402/fetch with your xbird_sk_ token in the X-Encryption-Key header. The server decrypts per-request, stores nothing.
AuthenticationTwo modes
SimplePer-request headers
Pass Twitter cookies directly as request headers. Best for quick testing and one-off calls.
headers: {"X-Twitter-Auth-Token": "<auth_token>","X-Twitter-CT0": "<ct0>"}
ProductionStateless token
Run xbird login once. Credentials are AES-256-GCM encrypted into a self-contained token. Server stores nothing — fully stateless.
// Generate (once, local)$ npx @checkra1n/xbird login// Use (every request)headers: { "X-Encryption-Key": "<token>" }// token = xbird_sk_<key>.<ciphertext>.<iv>
x402 Payment Flow
1Client
API request
xbird2xbird
HTTP 402 + price
Client3Client
Sign payment
USDC4xbird
Verify + execute
Twitter5xbird
Return result
ClientFully automatic with @x402/fetch. Sub-second latency.
Endpoints9 routes
EndpointMethodPriceDescription
GET
Search tweets/api/search?q=...&count=...$0.005/api/search?q=...&count=...GET$0.005Search tweetsGET
Get tweet by ID/api/tweet/:id$0.001/api/tweet/:idGET$0.001Get tweet by IDGET
Get user profile/api/user/:handle$0.001/api/user/:handleGET$0.001Get user profileGET
Get user's tweets/api/user/:id/tweets$0.01/api/user/:id/tweetsGET$0.01Get user's tweetsPOST
Post a new tweet/api/tweet$0.01/api/tweetPOST$0.01Post a new tweetPOST
Reply to a tweet/api/tweet/:id/reply$0.01/api/tweet/:id/replyPOST$0.01Reply to a tweetPOST
Like a tweet/api/tweet/:id/like$0.01/api/tweet/:id/likePOST$0.01Like a tweetPOST
Retweet/api/tweet/:id/retweet$0.01/api/tweet/:id/retweetPOST$0.01RetweetPOST
Upload media/api/media/upload$0.05/api/media/uploadPOST$0.05Upload mediaTypeScript example
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";import { registerExactEvmScheme } from "@x402/evm/exact/client";import { privateKeyToAccount } from "viem/accounts";// 1. Setup x402 payment (wallet from ~/.config/xbird/wallet.json)const account = privateKeyToAccount("0x...");const client = new x402Client();registerExactEvmScheme(client, { signer: account });const payFetch = wrapFetchWithPayment(fetch, client);// 2. Use stateless token from `xbird login`const res = await payFetch("https://xbirdapi.up.railway.app/api/search?q=AI+agents&count=20",{headers: {// Self-contained token: xbird_sk_<key>.<ciphertext>.<iv>"X-Encryption-Key": process.env.XBIRD_TOKEN,},});const { data, cursor } = await res.json();
Stateless Token Flow
1CLI
Auto-detect cookies
Browser2CLI
AES-256-GCM encrypt
Local3CLI
Save xbird_sk_ token
Local4You
Request + token
Server5Server
Decrypt, execute, discard
TwitterZero server storage. Token is self-contained — server decrypts per-request.