{"openapi":"3.1.0","info":{"title":"UnFee — Non-Custodial Multi-Crypto & Card Checkout, x402 AI Agent Settlement & 1-Credit RPC Gateway API","version":"2.2.0","description":"UnFee (https://unfee.xyz) provides True 0% transaction fees on the $5/mo Indie Tier (True 0% Fee) (10,000,000 reqs/mo), $15/mo Pro Tier (True 0% Fee) (35,000,000 reqs/mo), and $49/mo Scale Tier (True 0% Fee) (125,000,000 reqs/mo), and a 0.005% (0.5 bps = 5¢ per $1,000, $100,000/mo breakeven) micro-fee on the $0/mo Starter (5¢ per $1,000 Micro-Fee) (250,000 free API requests/mo) & x402 Pay-As-You-Go tiers. Supports USDC (EIP-3009 x402 gasless), XRP (Native XRPL & cbXRP on Base), RLUSD, ETH, USDT, EURC, cbBTC, DAI, and non-custodial Apple Pay / Google Pay / Debit & Credit Card onramps (/pay & /checkout.js), plus flat-rate 1 Request = 1 Credit JSON-RPC at POST https://api.unfee.xyz/rpc/base, /rpc/eth, and /rpc/xrpl, optional $1.00 Automatic Top-Up (+2,000,000 X-Tokens at 95% usage), HMAC-SHA256 signed webhooks, and instant email receipts. Official X: @unfeexyz (https://x.com/unfeexyz).","contact":{"name":"UnFee (@unfeexyz)","url":"https://x.com/unfeexyz"}},"externalDocs":{"description":"UnFee Public Developer & AI Agent Documentation (/docs & /docs.md)","url":"https://unfee.xyz/docs"},"servers":[{"url":"https://unfee-gateway.unfee.workers.dev","description":"Primary Zero-NRD-Friction AI & MCP Endpoint (Cloudflare Worker Edge — All Routes)"},{"url":"https://unfee.xyz","description":"Primary Production Edge"},{"url":"https://api.unfee.xyz","description":"Direct API & RPC Gateway Edge"}],"x-supported-assets":["USDC (EIP-3009 x402 gasless on Base Mainnet 8453)","XRP (Native XRPL & cbXRP on Base)","RLUSD (Ripple USD on Base & XRPL)","ETH (Base Native)","USDT","EURC","cbBTC","DAI","Apple Pay / Google Pay / Debit & Credit Card Onramps"],"x-official-tiers":{"starter_0":"$0/mo Starter (5¢ per $1,000 Micro-Fee) — 250,000 reqs/mo + 0.005% (0.5 bps) micro-fee","indie_5":"$5/mo Indie Tier (True 0% Fee) — 10,000,000 reqs/mo + True 0% fee ($100,000/mo breakeven)","pro_15":"$15/mo Pro Tier (True 0% Fee) — 35,000,000 reqs/mo + True 0% fee + Auto-Downshift","scale_49":"$49/mo Scale Tier (True 0% Fee) — 125,000,000 reqs/mo + True 0% fee + Auto-Downshift","payg_x402":"Pay-As-You-Go / x402 & $1.00 Auto-Top-Up (+2,000,000 X-Tokens at 95% usage) — $0.50/1M reqs + 0.005% micro-fee"},"paths":{"/mcp":{"post":{"operationId":"mcpStreamableHttpJsonRpc","summary":"Live Zero-Install Remote Streamable-HTTP MCP Server (JSON-RPC 2.0 initialize, tools/list, tools/call)","responses":{"200":{"description":"JSON-RPC 2.0 MCP response"}}},"get":{"operationId":"mcpSseDiscovery","summary":"SSE endpoint discovery for MCP clients (Accept: text/event-stream)","responses":{"200":{"description":"SSE endpoint stream"}}}},"/x402.js":{"get":{"operationId":"getX402PaywallMiddlewareSdk","summary":"1-Line x402 API Paywall Middleware SDK (unfeePaywall) for Cloudflare Workers, Hono, Express, and Node.js","responses":{"200":{"description":"JavaScript ES Module middleware source"}}}},"/tax":{"get":{"operationId":"getTaxStudio","summary":"Interactive IRS Form 8949, FIFO/HIFO/LIFO Cost Basis & TurboTax / QuickBooks CSV Studio (/tax)","responses":{"200":{"description":"Interactive Tax Studio HTML"}}}},"/api/v1/tax/calculate":{"get":{"operationId":"calculatePortfolioTaxesGet","summary":"Calculate FIFO, HIFO, and LIFO capital gains, non-taxable self-transfers, Schedule D summary, and IRS Form 8949 / TurboTax / QuickBooks CSVs","responses":{"200":{"description":"Calculated tax summary, lots, self-transfers, and CSV payloads with X-UnFee-Proof-Of-Delivery header"}}},"post":{"operationId":"calculatePortfolioTaxesPost","summary":"Calculate FIFO, HIFO, and LIFO capital gains across multiple Base (0x...) and XRPL (r...) wallets or custom CSV rows","responses":{"200":{"description":"Calculated tax summary, lots, self-transfers, and CSV payloads with X-UnFee-Proof-Of-Delivery header"}}}},"/api/v1/x402/tax-lot-csv":{"get":{"operationId":"exportX402TaxLotCsv","summary":"Export IRS Form 8949, TurboTax, or QuickBooks Double-Entry CSV (or JSON summary) at $0.01 via x402 (or $0 on $5/mo Indie Tier) with HTTP-200 Proof-of-Delivery SHA-256 header","responses":{"200":{"description":"CSV attachment or JSON tax report with X-UnFee-Proof-Of-Delivery receipt header"}}},"post":{"operationId":"exportX402TaxLotCsvPost","summary":"Export IRS Form 8949, TurboTax, or QuickBooks Double-Entry CSV via POST","responses":{"200":{"description":"CSV attachment or JSON tax report with X-UnFee-Proof-Of-Delivery receipt header"}}}},"/link":{"get":{"operationId":"getPaymentLinkAndQrStudio","summary":"No-Code Payment Link & QR Code Studio (/link & /studio)","responses":{"200":{"description":"Interactive Payment Link & QR Code Studio HTML"}}}},"/to/{wallet}/{amount}/{currency}":{"get":{"operationId":"getInstantPayShortLink","summary":"Human-readable Instant Pay Short Link with dynamic 1200x630 OpenGraph preview card (/og/pay)","responses":{"200":{"description":"Instant non-custodial checkout page with dynamic OpenGraph meta tags"}}}},"/api/health":{"get":{"operationId":"getHealth","summary":"Get live system health, deterministic Create2FeeSplitter contract address, supported assets (USDC, XRP/cbXRP, RLUSD, ETH, USDT, EURC, cbBTC, DAI, Apple Pay/Google Pay/Card), and fee schedule","responses":{"200":{"description":"Healthy status payload"}}}},"/api/arb/opportunities":{"get":{"operationId":"scanArbitrageOpportunities","summary":"Live Base DEX (Uniswap V3 vs Aerodrome) & XRPL (XRP/RLUSD <-> cbXRP/USDC) zero-fee spread scanner + atomic flash-loan calldata","parameters":[{"name":"simulateSpreadBps","in":"query","required":false,"schema":{"type":"number"},"description":"Optional simulated spread in basis points (e.g. 45) to inspect guaranteed profitable atomic flash-loan execution payload"}],"responses":{"200":{"description":"Real-time arbitrage opportunities matrix and atomic flash-swap payload"}}}},"/api/x402/arb-feed":{"get":{"operationId":"getX402ArbFeed","summary":"Monetized x402 ($0.001 USDC / 1000 atomic units to 0xA7a15bCEd59f4B687f5356b880DB3dcDaF086790) M2M arbitrage spread matrix & atomic flash-loan calldata feed","responses":{"200":{"description":"Unlocked real-time arbitrage matrix (when X-Payment-Proof, X-API-Key, or X-Unfee-Sandbox is provided)"},"402":{"description":"HTTP 402 Payment Required challenge ($0.001 USDC on Base eip155:8453 or XRPL)"}}}},"/api/x402/token-audit":{"get":{"operationId":"getX402TokenAudit","summary":"Monetized x402 ($0.002 USDC / 2000 atomic units to 0xA7a15bCEd59f4B687f5356b880DB3dcDaF086790) live Base Mainnet ERC-20 bytecode, supply, pool liquidity & security audit","parameters":[{"name":"token","in":"query","required":false,"schema":{"type":"string","default":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"},"description":"Base Mainnet ERC-20 token contract address (0x...)"}],"responses":{"200":{"description":"Unlocked live Base Mainnet token security & liquidity audit"},"402":{"description":"HTTP 402 Payment Required challenge ($0.002 USDC on Base eip155:8453 or XRPL)"}}}},"/api/pricing":{"get":{"operationId":"getPricing","summary":"Get full pricing tiers ($0/mo Starter (5¢ per $1,000 Micro-Fee), $5/mo Indie Tier (True 0% Fee), $15/mo Pro Tier (True 0% Fee), $49/mo Scale Tier (True 0% Fee), $1 Auto-Top-Up = +2M X-Tokens) and contract details","responses":{"200":{"description":"Pricing catalog JSON"}}}},"/api/keys/free":{"post":{"operationId":"mintFreeApiKey","summary":"Mint an instant $0/mo Starter (5¢ per $1,000 Micro-Fee) API key (250,000 free API requests/mo + 0.005% / 5¢ per $1,000 payment micro-fee, optional $1.00 Auto-Top-Up)","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","default":"ai-agent"},"email":{"type":"string"},"autoTopUpEnabled":{"type":"boolean","default":true}}}}}},"responses":{"201":{"description":"Minted API key and deterministic deposit invoice"}}}},"/v1/checkout/sessions":{"post":{"operationId":"createCheckoutSession","summary":"Create a non-custodial multi-crypto & Card/Apple Pay/Google Pay checkout session","responses":{"200":{"description":"Created checkout session with /pay URL and deterministic Create2 invoice address"}}}},"/api/xrpl/verify":{"post":{"operationId":"verifyXrplPayment","summary":"Verify Native XRPL, cbXRP, or RLUSD settlement ($0 wallet reserve lockup) and dispatch signed webhook + email receipt","responses":{"200":{"description":"Verified XRPL/RLUSD payment"}}}},"/api/checkout/verify":{"post":{"operationId":"verifyCheckoutPayment","summary":"Verify non-custodial checkout payment across USDC, XRP (XRPL & cbXRP), RLUSD, ETH, USDT, EURC, cbBTC, DAI, or Apple Pay/Google Pay/Card onramps, dispatch HMAC-SHA256 signed webhook, and send email receipt","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["free","indie_5","pro_15","scale_49","payg_x402"]},"asset":{"type":"string","enum":["USDC","XRP","cbXRP","RLUSD","ETH","USDT","EURC","cbBTC","DAI","CARD","APPLE_PAY","GOOGLE_PAY"],"default":"USDC","description":"Settlement asset or non-custodial onramp rail (USDC, XRP / cbXRP, RLUSD, ETH, USDT, EURC, cbBTC, DAI, Apple Pay, Google Pay, Card)"},"amountUsdc":{"type":"string","example":"5.00"},"txHash":{"type":"string"},"payerAddress":{"type":"string"},"receiptEmail":{"type":"string"},"webhookUrl":{"type":"string"}}}}}},"responses":{"200":{"description":"Verified payment with X-Unfee-Signature, webhookDelivery, and emailReceipt"}}}},"/api/x402/settle":{"post":{"operationId":"settleX402Authorization","summary":"Settle gasless EIP-3009 transferWithAuthorization Base USDC payment and mint/credit API key","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string"},"to":{"type":"string"},"value":{"type":"string","description":"Atomic USDC units (6 decimals), e.g. 5000000 for $5.00"},"plan":{"type":"string","default":"indie_5"},"receiptEmail":{"type":"string"},"webhookUrl":{"type":"string"}}}}}},"responses":{"200":{"description":"Settled EIP-3009 authorization with signed webhook and email receipt"}}}},"/api/billing/auto-topup":{"post":{"operationId":"configureOrTriggerAutoTopUp","summary":"Enable or trigger $1.00 Automatic Top-Up (+2,000,000 X-Tokens when usage reaches 95%)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"apiKey":{"type":"string"},"enabled":{"type":"boolean","default":true},"simulateTrigger":{"type":"boolean","default":false},"receiptEmail":{"type":"string"},"webhookUrl":{"type":"string"}}}}}},"responses":{"200":{"description":"Updated Auto-Top-Up state and optional topup.completed receipt"}}}},"/api/webhooks/register":{"post":{"operationId":"registerWebhook","summary":"Register a webhook endpoint and receipt email, returning an HMAC-SHA256 signing secret (whsec_unfee_...)","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"webhookUrl":{"type":"string"},"receiptEmail":{"type":"string"},"events":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"201":{"description":"Registered webhook subscription with HMAC-SHA256 signingSecret"}}}},"/api/webhooks/test":{"post":{"operationId":"testWebhookAndEmailReceipt","summary":"Dispatch a signed test webhook (payment.settled or topup.completed) with X-Unfee-Signature and email receipt","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"event":{"type":"string","enum":["payment.settled","topup.completed"]},"amountUsdc":{"type":"string","default":"25.00"},"plan":{"type":"string","default":"indie_5"},"receiptEmail":{"type":"string"},"webhookUrl":{"type":"string"}}}}}},"responses":{"200":{"description":"Signed webhook delivery receipt and formatted HTML/text email receipt"}}}},"/rpc/base":{"post":{"operationId":"proxyBaseRpc","summary":"Base Mainnet (Chain ID 8453) JSON-RPC proxy at POST https://api.unfee.xyz/rpc/base metered flat at 1 Request = 1 Credit","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jsonrpc":{"type":"string","default":"2.0"},"id":{"type":"integer","default":1},"method":{"type":"string","default":"eth_blockNumber"},"params":{"type":"array","items":{}}}}}}},"responses":{"200":{"description":"Base Mainnet JSON-RPC response with X-Request-Credit-Cost: 1"}}}},"/rpc/eth":{"post":{"operationId":"proxyEthRpc","summary":"Ethereum Mainnet (Chain ID 1) JSON-RPC proxy at POST https://api.unfee.xyz/rpc/eth metered flat at 1 Request = 1 Credit","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"jsonrpc":{"type":"string","default":"2.0"},"id":{"type":"integer","default":1},"method":{"type":"string","default":"eth_blockNumber"},"params":{"type":"array","items":{}}}}}}},"responses":{"200":{"description":"Ethereum Mainnet JSON-RPC response with X-Request-Credit-Cost: 1"}}}},"/rpc/xrpl":{"post":{"operationId":"proxyXrplRpc","summary":"Native XRPL JSON-RPC proxy at POST https://api.unfee.xyz/rpc/xrpl (server_info, account_info, tx, ledger_current) metered flat at 1 Request = 1 Credit","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"method":{"type":"string","default":"server_info"},"params":{"type":"array","items":{"type":"object"}}}}}}},"responses":{"200":{"description":"XRPL JSON-RPC response with X-Request-Credit-Cost: 1"}}}},"/api/receipts/email":{"post":{"operationId":"sendEmailReceipt","summary":"Generate and send a transaction completion email receipt with fee comparison and Basescan verification link","requestBody":{"required":false,"content":{"application/json":{"schema":{"type":"object","properties":{"to":{"type":"string"},"amountUsdc":{"type":"string","default":"25.00"},"plan":{"type":"string","default":"indie_5"},"txHash":{"type":"string"}}}}}},"responses":{"200":{"description":"Formatted email receipt payload"}}}}}}