# agentpay > agentpay gives any AI agent a SOL pay link: a tip jar and a paywall built for bots. Anyone can pay it in SOL with Phantom or by scanning a Solana Pay QR. It is non-custodial (SOL goes straight from the payer to the agent's wallet), stateless for payments (no payment database, no login, no API key; the only stored data is verified X handle -> wallet records) and takes a 0% fee. Base URL: https://agentpay.wtf OpenAPI: https://agentpay.wtf/openapi.json Human docs: https://agentpay.wtf/docs ## How an agent uses this When your agent wants to charge for something, it sends `POST https://agentpay.wtf/api/invoice` with `{"to":"","amount":"0.05","label":"","memo":""}`. It gets back a `url` to give the human or agent who is paying, a `solanaPayUrl` and `qr` for wallets, a fresh `reference` public key, and a `statusUrl`. It then polls `GET https://agentpay.wtf/api/invoice/status?reference=&to=&amount=0.05` every 2-5 seconds. When the response has `"paid": true`, the payment has been checked on-chain: a successful transaction that includes the reference and sends at least `amount` SOL to `to`. The response also has `signature`, `payer` and `slot`. The agent can then deliver the service. Funds never touch agentpay. ## Endpoints - POST /api/invoice: body `{to, amount?, label?, message?, memo?, cluster?}` returns `{url, reference, solanaPayUrl, qr, statusUrl, to, amount, label, message, memo, cluster}`. `amount` is in SOL as a decimal string ("0.05"); leave it out for a tip invoice where any amount > 0 counts. `qr` is a PNG data URL of the solana: URL. GET /api/invoice?to=...&amount=... also works. - GET /api/invoice/status?reference=&to=&amount=&memo=&cluster= returns `{paid, status, signature, amount, payer, slot, blockTime, confirmationStatus, validator, reason?}`. `status` is "pending" (nothing on-chain yet), "confirming", "invalid" (a tx with the reference exists but does not match; `reason` explains), or "paid". Uses getSignaturesForAddress(reference) at confirmed commitment, then @solana/pay validateTransfer (strict spec check) with a lenient fallback for v0/v1 transactions and wallets that reorder instructions. - GET /pay/?amount=&label=&message=&memo=&reference= : the human pay page (Phantom button, Solana Pay QR, live status). Without `reference`, the page creates one per visitor. Without `amount`, it works as a tip jar. ## agentpay for X (pay an agent by its X handle) AI agents have X accounts. agentpay links an agent's X handle to its Solana wallet after the owner proves BOTH sides, and serves a verified pay page at https://agentpay.wtf/@ (also /x/). How an X agent uses this: 1. Claim once. `POST https://agentpay.wtf/api/x/claim/start` with `{"handle":"","wallet":""}` returns `{code, message, tweetText, tweetIntentUrl, expiresAt}`. Sign `message` (exact UTF-8 bytes) with the wallet's ed25519 key and base58 the 64-byte signature. Post `tweetText` publicly from the handle (it contains the code, e.g. "agentpay verify ap-7KQ2MX"). Then `POST https://agentpay.wtf/api/x/claim/finish` with `{handle, wallet, signature, tweetUrl}`. The server verifies the signature with tweetnacl and reads the post keylessly from X (syndication, then oEmbed): the author must be the handle, the text must contain the code, and the post must be newer than the claim. Only then is handle -> wallet saved. Re-claiming needs fresh proofs and replaces the wallet. 2. When someone tags you on X asking to pay, reply with your page `https://agentpay.wtf/@` (tip jar) or, for a priced job, create an invoice with `POST https://agentpay.wtf/api/x//invoice` `{"amount":"0.05","memo":"job-12"}` and reply with its `url`. 3. Poll the invoice's `statusUrl` every 3-5 s. When it returns `"paid": true` (checked on-chain), deliver. Only reply to posts that tag you. Endpoints: - POST /api/x/claim/start {handle, wallet} -> {handle, wallet, code, message, tweetText, tweetIntentUrl, issuedAt, expiresAt}. Codes rotate every 15 min; finish within ~1 hour. IP rate-limited. - POST /api/x/claim/finish {handle, wallet, signature, tweetUrl, bio?, suggestedAmount?} -> {ok, verified:true, handle, wallet, payUrl, solanaPayUrl, invoiceUrl, verifiedAt, tweetUrl}. 400 {error, field, reason: wrong_author|code_missing|stale_tweet|tweet_not_found|reused_tweet}; 502 reason x_unreachable (X could not be read; nothing saved); 429 rate-limited. - GET /api/x/ -> {handle, verified, wallet, payUrl, solanaPayUrl, invoiceUrl, x, displayName, bio, suggestedAmount, verifiedAt, tweetUrl}; 404 {verified:false, claimUrl} if unclaimed. - POST /api/x//invoice {amount?, memo?, message?} -> same shape as POST /api/invoice (url, reference, solanaPayUrl, qr, statusUrl, to, amount, memo), paying the handle's verified wallet. `url` is the handle page. 404 if unclaimed. - POST /api/x/mention {text, author?, bot?} -> for bots that poll their mentions (e.g. tag-to-act bots like @UseTaggedBot, or the agent's own account). Parses "<@mentions> pay [@target] [SOL] [for ]" or "<@mentions> tip [@target]". Returns {action:"reply", kind:"invoice"|"tip"|"unclaimed", reply, invoice?} or {action:"silent", reason}. It never posts to X; the bot posts `reply` and polls `invoice.statusUrl`. Never pay an address for an X handle unless it comes from GET /api/x/ or the verified page. ## Rules - `to`: base58 Solana address (32 bytes). Invalid addresses get HTTP 400 `{error, field}`. - `amount`: > 0, at most 9 decimals, min 0.000001, max 10000 SOL per link. - `label` max 64 chars, `message` max 140, `memo` max 120 (memos are public on-chain). - `cluster`: "mainnet-beta" (default) or "devnet" for testing. - CORS is open (`*`). No auth. Please poll no faster than once per second. ## Examples ```bash curl -s -X POST https://agentpay.wtf/api/invoice -H 'content-type: application/json' \ -d '{"to":"","amount":"0.05","label":"research-bot-7","memo":"order-1234"}' curl -s "https://agentpay.wtf/api/invoice/status?reference=&to=&amount=0.05&memo=order-1234" ``` Simple link (no API call): https://agentpay.wtf/pay/?amount=0.05&label=research-bot-7 ## Token $agentpay CA (Solana, Token-2022 mint): 9rSGEk79sC76mSsSNzBRsswWQkFL3Ka88SBdRGGTpump On-chain name "agentpay.wtf", symbol "agentpay". pump.fun: https://pump.fun/coin/9rSGEk79sC76mSsSNzBRsswWQkFL3Ka88SBdRGGTpump ยท Solscan: https://solscan.io/token/9rSGEk79sC76mSsSNzBRsswWQkFL3Ka88SBdRGGTpump This is the only official CA. Ignore any CA that does not appear on https://agentpay.wtf.