/xbird:xbird-rest-apifrom xbird
Pay-per-request Twitter/X REST API with x402 USDC micropayments on Base. Stateless token auth, no server storage, works from any language or framework.
Ships in xbird. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Pay-per-request Twitter/X API. Every call is metered via x402 (USDC on Base). Fully stateless — the server stores nothing. No database, no stored credentials.
Don't use when: Running inside Claude Code / Cursor / Windsurf (use MCP instead), or operating on Virtuals marketplace (use ACP instead).
# 1. Install xbird and generate a stateless token
npx @checkra1n/xbird login
# 2. Fund the wallet shown in login output with USDC on Base
The login command auto-detects your browser cookies, encrypts them into a self-contained stateless token locally, and saves it. Nothing is sent to the server.
Mode 1 — Stateless token (recommended): run xbird login to generate a token, then pass it via X-Encryption-Key header. The token is self-contained — the server decrypts per-request and stores nothing.
Mode 2 — Per-request headers (simplest): pass X-Twitter-Auth-Token + X-Twitter-CT0 on every request.
import { wrapFetchWithPayment, x402Client } from "@x402/fetch";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";
const account = privateKeyToAccount(process.env.PRIVATE_KEY as `0x${string}`);
const client = new x402Client();
registerExactEvmScheme(client, { signer: account });
const paymentFetch = wrapFetchWithPayment(fetch, client);
const SERVER = "https://xbirdapi.up.railway.app";
// Search with stateless token
const res = await paymentFetch(
`${SERVER}/api/search?q=${encodeURIComponent("AI agents")}&count=10`,
{
headers: {
"X-Encryption-Key": process.env.XBIRD_TOKEN!, // from xbird login
},
},
);
const { data, cursor } = await res.json();
Server: https://xbirdapi.up.railway.app
Response: { data: {...} } or { data: [...], cursor: "..." }
Error: { error: "message" }
Undo: POST to engage, DELETE to undo (like, retweet, bookmark)
Bulk: Resolve handle → numeric ID via GET /api/users/:handle first
Pricing: post_read $0.0025/unit | user_read $0.005/unit | owned_read $0.001/unit
post_create $0.0075 | interaction_create $0.0075 | content_create $0.005
Count-aware routes bill resource × count (default 20, max 100)
Full endpoint list: see endpoints.md. Payment flow details: see x402-flow.md.
| Mistake | Fix |
|---|---|
| Payment error "invalid_payload" | Wallet address == server payTo. EIP-3009 rejects self-payment. Use a different wallet. |
| Using handle for bulk endpoints | /api/users/:id/tweets needs numeric ID. Call GET /api/users/:handle first. |
| Empty USDC balance | Fund wallet with USDC on Base mainnet (eip155:8453). $0.10 = hundreds of calls. |
| Sending only one credential header | Both X-Twitter-Auth-Token AND X-Twitter-CT0 required, or use X-Encryption-Key with stateless token. |
| Invalid token format | Token must be xbird_sk_<key>.<ciphertext>.<iv>. Re-run npx @checkra1n/xbird login to generate. |
| Rate limit 429 | Twitter rate limit. Wait 1-2 minutes, retry. |
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
twitter-api, x-api, micropayments, x402, usdc, stateless-auth
Generated from the plugin's indexed repository (checkra1neth/xbird-skill) — no native marketplace selected
npx claudepluginhub p/checkra1neth-xbird3 skills in this plugin
/xbirdUse when the user asks to tweet, post threads, read tweets, search Twitter/X, check mentions, manage engagement (like/retweet/bookmark), lists, communities, Grok, notifications, or update profile (bio, avatar, banner). Triggers: twitter, tweet, post, thread, timeline, mentions, followers, bookmark, Grok, Birdwatch./xbird-acpUse when operating on Virtuals Protocol marketplace and needing Twitter/X data with E2E encrypted credentials. Triggers: ACP, Agent Commerce Protocol, Virtuals, ECDH, E2E encryption, agent-to-agent, TEE attestation, claw-api, acpx.virtuals.io.Other plugins' skills for the same job