{"version":1,"description":"Email via x402 micropayments. Send ($0.02), buy inbox ($1/mo), buy subdomain ($5). Subdomain inboxes for receiving email.","resources":["https://x402email.com/api/send","https://x402email.com/api/subdomain/buy","https://x402email.com/api/subdomain/send","https://x402email.com/api/inbox/buy","https://x402email.com/api/inbox/topup","https://x402email.com/api/inbox/topup/quarter","https://x402email.com/api/inbox/topup/year","https://x402email.com/api/inbox/send","https://x402email.com/api/inbox/messages","https://x402email.com/api/inbox/messages/read","https://x402email.com/api/subdomain/inbox/create","https://x402email.com/api/subdomain/inbox/messages","https://x402email.com/api/subdomain/inbox/messages/read"],"instructions":"# x402email API\n\nEmail via x402 micropayments. USDC on Base. No API keys.\n\n## Three tiers\n\n1. **Shared domain** — POST /api/send ($0.02). Sends from relay@x402email.com. Body: {to, subject, html?, text?, replyTo?, attachments?}. Requires html or text.\n2. **Inbox** — Buy username@x402email.com for $1/30 days. Forward to real address, use as programmatic mailbox, or both. Send from it for $0.005.\n3. **Subdomain** — Buy yourname.x402email.com for $5. Send from anything@yourname.x402email.com for $0.005. Up to 50 authorized signer wallets.\n\nSubdomain owners can buy the matching inbox name with the same wallet (e.g., owner of alice.x402email.com can buy alice@x402email.com).\n\n## Inbox endpoints\n\n| Endpoint | Cost | Auth | Body |\n|----------|------|------|------|\n| POST /api/inbox/buy | $1 | x402 | {username, forwardTo?} — omit forwardTo for programmatic-only mailbox (retainMessages auto-enabled) |\n| POST /api/inbox/send | $0.005 | x402 (owner) | {username, to[], subject, html?, text?, replyTo?, attachments?} |\n| POST /api/inbox/topup | $1 | x402 | {username} — anyone can topup any inbox |\n| POST /api/inbox/topup/quarter | $2.50 | x402 | {username} — 90 days, save 17% |\n| POST /api/inbox/topup/year | $8 | x402 | {username} — 365 days, save 34% |\n| POST /api/inbox/messages | $0.001 | x402 (owner) | {username, cursor?, limit?} — list inbound messages |\n| POST /api/inbox/messages/read | $0.001 | x402 (owner) | {messageId} — full email with from/to/subject/text/html/attachments metadata |\n| POST /api/inbox/messages/delete | free | SIWX (owner) | {messageId} |\n| GET /api/inbox/status?username=x | free | SIWX (owner) | — |\n| POST /api/inbox/update | free | SIWX (owner) | {username, forwardTo?, retainMessages?} — set forwardTo to null to remove forwarding |\n| POST /api/inbox/cancel | free | SIWX (owner) | {username, refundAddress?} — pro-rata USDC refund |\n\n## Subdomain endpoints\n\n| Endpoint | Cost | Auth | Body |\n|----------|------|------|------|\n| POST /api/subdomain/buy | $5 | x402 | {subdomain} — DNS verified in ~5 min |\n| POST /api/subdomain/send | $0.005 | x402 (owner/signer) | {from, to[], subject, html?, text?, replyTo?} |\n| POST /api/subdomain/update | free | SIWX (owner) | {subdomain, catchAllForwardTo?} — set catch-all forwarding for unmatched addresses (null to remove) |\n| POST /api/subdomain/signers | free | SIWX (owner) | {action: \"add\"/\"remove\", subdomain, walletAddress} |\n| GET /api/subdomain/status?subdomain=x | free | SIWX (owner/signer) | — |\n\n## Subdomain inboxes — receive email on subdomains\n\nSubdomain owners can create per-address inboxes (e.g., biden@craig.x402email.com). Free to create (SIWX), cap 100/subdomain. Each inbox optionally forwards and/or retains messages for API access. Unmatched addresses go to catch-all if set, else dropped.\n\n| Endpoint | Cost | Auth | Body |\n|----------|------|------|------|\n| POST /api/subdomain/inbox/create | $0.25 | x402 (owner) | {subdomain, localPart, forwardTo?} — omit forwardTo for programmatic-only. 500 msg cap per inbox. |\n| POST /api/subdomain/inbox/list | free | SIWX (owner) | {subdomain} — returns inboxes with message/unread counts |\n| POST /api/subdomain/inbox/delete | free | SIWX (owner) | {subdomain, localPart} — cascades messages + S3 |\n| POST /api/subdomain/inbox/messages | $0.001 | x402 (owner) | {subdomain, localPart, cursor?, limit?} — list inbound messages |\n| POST /api/subdomain/inbox/messages/read | $0.001 | x402 (owner) | {messageId} — full email with from/to/subject/text/html/attachments |\n| POST /api/subdomain/inbox/messages/delete | free | SIWX (owner) | {messageId} |\n\n## Auth model\n\n- **x402 routes**: wallet identity extracted from payment signature. Ownership checked in handler.\n- **SIWX routes** (free): wallet identity via SIGN-IN-WITH-X header. Returns 402 with SIWX challenge if missing — x402-compatible clients handle this automatically.\n\n## Attachments\n\nMax 5 per email. Each: {content: \"base64\", contentType: \"mime/type\", filename: \"name\"}. ~3.75MB decoded limit. For calendar invites: contentType \"text/calendar; method=REQUEST\".\n\n## Images\n\nUse `<img src=\"url\">` in html body. Host on agentupload.dev (x402-powered uploads). Avoid base64 data URIs — most email clients strip them.\n"}