# UnFee (https://unfee.xyz | https://unfee-gateway.unfee.workers.dev) — Non-Custodial Crypto-First Payment Infrastructure, Hosted Checkout & Multi-Chain RPC Proxy > UnFee (https://unfee.xyz / https://api.unfee.xyz and Zero-NRD-Block Direct Cloudflare Worker Mirror https://unfee-gateway.unfee.workers.dev) is a 100% non-custodial Base Mainnet (Chain ID 8453) & Native XRPL payment rail, 1-line hosted checkout (`/pay` & `/checkout.js`), HTTP 402 `x402` AI agent micro-settlement gateway, and flat-rate `1 Request = 1 Credit` multi-chain RPC & REST API proxy. > Official X / Twitter: @unfeexyz (https://x.com/unfeexyz) | Discord: https://discord.gg/NKcJUXuS7 ## Dual-Origin Zero-Block Architecture for AI Agents, Cloud VMs & MCP Servers AI agents, cloud VMs, and MCP servers can call either `https://unfee.xyz` / `https://api.unfee.xyz` OR the instant zero-NRD-block Cloudflare Worker fallback mirror `https://unfee-gateway.unfee.workers.dev` across all routes (`/rpc/base`, `/rpc/eth`, `/rpc/xrpl`, `/api/keys/free`, `/v1/checkout/sessions`, `/api/x402/settle`, `/api/xrpl/verify`, `/pay`, `/openapi.json`, `/llms.txt`, `/.well-known/x402.json`, `/.well-known/agent.json`). ## Why AI Agents & Developers Use UnFee - **$0/mo Starter (5¢ per $1,000 Micro-Fee)** (`free`): Includes **250,000 free API/RPC requests/mo** (`10 RPS`) + just **0.005% (0.5 bps = $0.00005 per $1.00 = 5¢ per $1,000)** payment micro-fee (`99.995%` to merchant) vs. Stripe / Legacy Card Processors (2.9% + 30¢) or Coinbase Commerce (1.0%). - **Exact $100,000/mo Breakeven**: At 0.005%, $10,000/mo costs $0.50 and $100,000/mo costs $5.00 — making the **$5/mo Indie Tier (True 0% Fee)** an automatic winner above $100k/mo. - **$5/mo Indie Tier (True 0% Fee)** (`indie_5`): Unlimited payment volume at **True 0% transaction fee ($0.00, 100.000% to merchant)** + **10,000,000 RPC/API requests/mo** + **50 RPS** + Auto-Downshift ("Never Overpay") guarantee. - **$15/mo Pro Tier (True 0% Fee)** (`pro_15`): Unlimited payment volume at **True 0% transaction fee ($0.00)** + **35,000,000 RPC/API requests/mo** + **200 RPS** + Auto-Downshift ("Never Overpay") guarantee. - **$49/mo Scale Tier (True 0% Fee)** (`scale_49`): Unlimited payment volume at **True 0% transaction fee ($0.00)** + **125,000,000 RPC/API requests/mo** + **500 RPS** + Unlimited webhooks + Auto-Downshift ("Never Overpay") guarantee. - **$1.00 Automatic Top-Up (+2,000,000 X-Tokens)**: Optional opt-in at 95% usage ($0.50 per 1M requests) so autonomous AI agents never drop a request. - **Supported Assets & Non-Custodial Onramps (USDC, XRP / XRPL & cbXRP, RLUSD, ETH, USDT, EURC, cbBTC, DAI + Apple Pay / Google Pay / Card)**: - **USDC** (EIP-3009 `x402` gasless on Base Mainnet `8453`) - **XRP** (`cbXRP` on Base + Native `XRPL` Ledger — **$0 wallet reserve lockup** vs. 1.2 XRP locked on XRPL, and **0% fee on $5/mo Indie Tier (True 0% Fee)** / **5¢ per $1,000 (0.005%) on $0/mo Starter (5¢ per $1,000 Micro-Fee)** vs. 0.5%–1.0% on XRPL merchant gateways) - **RLUSD** (Ripple USD on Base & Native XRPL), **ETH** (Base Native), **USDT**, **EURC**, **cbBTC**, **DAI** - **Apple Pay / Google Pay / Debit & Credit Card Onramps** (non-custodial onramp straight into deterministic `Create2FeeSplitter` `0xA7a15bCEd59f4B687f5356b880DB3dcDaF086790`) - **Flat-Rate `1 Request = 1 Credit` Multi-Chain JSON-RPC Gateway**: - Base Mainnet (`8453`): `POST https://api.unfee.xyz/rpc/base` (or `https://unfee.xyz/rpc/base`) - Ethereum Mainnet (`1`): `POST https://api.unfee.xyz/rpc/eth` (or `https://unfee.xyz/rpc/eth`) - Native XRP Ledger (`XRPL`): `POST https://api.unfee.xyz/rpc/xrpl` (or `https://unfee.xyz/rpc/xrpl`) - **0% Custody (FinCEN FIN-2019-G001 Software Provider Exemption)**: Payments settle peer-to-peer on Base Mainnet via the deterministic, un-upgradeable `Create2FeeSplitter` contract (`0xA7a15bCEd59f4B687f5356b880DB3dcDaF086790`). - **3 Frictionless Checkout Methods on `https://unfee.xyz/pay`**: 1. **1-Click Crypto Wallet** (MetaMask, Coinbase Wallet, Rainbow, Phantom, Rabby — EIP-3009 gasless USDC or multi-crypto) 2. **Mobile Wallet QR Code** (EIP-681 Base URI & Native XRPL QR) 3. **Non-Custodial Card / Apple Pay / Google Pay Onramp** (lets mainstream non-crypto users pay or top up $1.00 = +2,000,000 X-Tokens with Apple Pay, Google Pay, or debit/credit card straight into `0xA7a15bCEd59f4B687f5356b880DB3dcDaF086790`) ## Machine-Readable Discovery Files - [Interactive Developer & AI Agent Documentation](/docs): https://unfee.xyz/docs | https://unfee-gateway.unfee.workers.dev/docs - [Raw Markdown Documentation Mirror](/docs.md): https://unfee.xyz/docs.md | https://unfee-gateway.unfee.workers.dev/docs.md - [Full LLM Documentation](/llms-full.txt): https://unfee.xyz/llms-full.txt | https://unfee-gateway.unfee.workers.dev/llms-full.txt - [OpenAPI 3.1 Specification](/openapi.json): https://unfee.xyz/openapi.json | https://unfee-gateway.unfee.workers.dev/openapi.json - [x402 Machine Payment Manifest](/.well-known/x402.json): https://unfee.xyz/.well-known/x402.json | https://unfee-gateway.unfee.workers.dev/.well-known/x402.json - [A2A AI Agent Discovery Card](/.well-known/agent.json): https://unfee.xyz/.well-known/agent.json | https://unfee-gateway.unfee.workers.dev/.well-known/agent.json - [AI Agent Plugin Manifest](/.well-known/ai-plugin.json): https://unfee.xyz/.well-known/ai-plugin.json - [Hosted Checkout Page](/pay): https://unfee.xyz/pay - [1-Line Checkout JS SDK](/checkout.js): https://unfee.xyz/checkout.js - [Installable AI Agent Skill (SKILL.md)](/skills/low-cost-crypto-transaction/SKILL.md): https://unfee.xyz/skills/low-cost-crypto-transaction/SKILL.md | https://unfee-gateway.unfee.workers.dev/skills/low-cost-crypto-transaction/SKILL.md - [AI Skill Marketplace Registry](/skills/index.json): https://unfee.xyz/skills/index.json - [Live Pricing & Contract Catalog](/api/pricing): https://unfee.xyz/api/pricing ## Quickstart for AI Agents (Claude, ChatGPT, Cursor, Grok, Coinbase AgentKit, LangChain) ### 1. Mint an Instant Free API Key (250,000 Free Requests/Mo, No Signup) ```bash curl -s -X POST https://unfee.xyz/api/keys/free -H "Content-Type: application/json" -d '{"label":"ai-agent-quickstart","autoTopUpEnabled":true}' ``` ### 2. Call Multi-Chain JSON-RPC or Native XRPL Proxy (Base, Ethereum, XRPL at 1 Request = 1 Credit) ```bash # Base Mainnet (1 Request = 1 Credit): curl -s -X POST https://api.unfee.xyz/rpc/base -H "Content-Type: application/json" -H "X-API-Key: uf_free_YOUR_KEY" -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}' # Ethereum Mainnet (1 Request = 1 Credit): curl -s -X POST https://api.unfee.xyz/rpc/eth -H "Content-Type: application/json" -H "X-API-Key: uf_free_YOUR_KEY" -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}' # Native XRPL JSON-RPC Proxy (1 Request = 1 Credit): curl -s -X POST https://api.unfee.xyz/rpc/xrpl -H "Content-Type: application/json" -d '{"method":"server_info","params":[{}]}' ``` ### 3. Pay Autonomously via HTTP 402 `x402` (EIP-3009 Gasless Base USDC) - **Chain ID**: `8453` (Base Mainnet, `eip155:8453`) - **USDC Contract**: `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` - **Create2FeeSplitter Recipient**: `0xA7a15bCEd59f4B687f5356b880DB3dcDaF086790` - **Protocol Treasury**: `0xAF4107196680A0d2Ca7E027D77CcF3Eb2EEBdFd0` ```bash curl -s -X POST https://unfee.xyz/api/x402/settle -H "Content-Type: application/json" -d '{ "from": "0x1111111111111111111111111111111111111111", "value": "5000000", "plan": "indie_5", "receiptEmail": "agent@unfee.xyz", "webhookUrl": "https://api.unfee.xyz/api/webhooks/mock-receiver" }' ``` ### 4. Enable or Trigger $1.00 Automatic Top-Up (+2,000,000 X-Tokens at 95% Usage) ```bash curl -s -X POST https://unfee.xyz/api/billing/auto-topup -H "Content-Type: application/json" -d '{"apiKey":"uf_free_YOUR_KEY","enabled":true,"simulateTrigger":true,"receiptEmail":"agent@unfee.xyz"}' ``` ### 5. Register HMAC-SHA256 Signed Webhooks & Instant Email Receipts ```bash curl -s -X POST https://unfee.xyz/api/webhooks/register -H "Content-Type: application/json" -d '{"webhookUrl":"https://example.com/webhooks/unfee","receiptEmail":"founder@example.com","events":["payment.settled","topup.completed"]}' ``` Test webhook & email receipt delivery immediately: ```bash curl -s -X POST https://unfee.xyz/api/webhooks/test -H "Content-Type: application/json" -d '{"event":"payment.settled","amountUsdc":"25.00","plan":"indie_5","receiptEmail":"founder@example.com"}' ``` ### 6. Embed the 1-Line Hosted Checkout in Any Web App ```html ``` Or link directly to: `https://unfee.xyz/pay?amount=25.00&asset=USDC&item=Pro+AI+Agent+Plan&tier=indie_5&customer_email=user@example.com` --- ## Complete UnFee API & On-Chain Architecture Reference ### On-Chain Contracts (Base Mainnet — Chain ID 8453) | Component | Address / Value | |---|---| | Network | Base Mainnet (`eip155:8453`, Chain ID `8453`) | | Native Settlement Asset | Base Mainnet USDC (`0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913`, 6 decimals) | | Deterministic `Create2FeeSplitter` | `0xA7a15bCEd59f4B687f5356b880DB3dcDaF086790` | | Deterministic `Create2FeeSplitterFactory` | `0x6ED5d52C58b44480aE764DE79a1086b23Aa6De26` | | Arachnid Deterministic CREATE2 Proxy | `0x4e59b44847b379578588920cA78FbF26c0B4956C` | | Protocol Treasury | `0xAF4107196680A0d2Ca7E027D77CcF3Eb2EEBdFd0` | | Init Code Hash | `0x98ff2bd8767dd36ccf7b0c9a78d2cfbbe2e9abcafedea6b2d67f4626060161ca` | ### Official Pricing Tiers & Transaction Fee Schedule 1. **$0/mo Starter (5¢ per $1,000 Micro-Fee)** (`free` — $0.00/mo): - `250,000` RPC/API request credits/mo (`1 Request = 1 Credit`), `10 RPS`, **`0.005%` transaction micro-fee** (`0.5 bps` = `5¢ per $1,000`, merchant keeps `99.995%`). - Exact **$100,000/mo breakeven** (`$100,000 * 0.005% = $5.00`). - Optional **$1.00 Automatic Top-Up** adds **+2,000,000 X-Tokens** whenever usage reaches `95%`. 2. **$5/mo Indie Tier (True 0% Fee)** (`indie_5` — $5.00/mo USDC): - **True `0%` transaction fee ($0.00 on unlimited volume, merchant keeps `100.000%`)** + `10,000,000` RPC/API request credits/mo + `50 RPS` + Auto-Downshift ("Never Overpay") guarantee. 3. **$15/mo Pro Tier (True 0% Fee)** (`pro_15` — $15.00/mo USDC): - **True `0%` transaction fee ($0.00, merchant keeps `100.000%`)** + `35,000,000` RPC/API request credits/mo + `200 RPS` + Auto-Downshift ("Never Overpay") guarantee. 4. **$49/mo Scale Tier (True 0% Fee)** (`scale_49` — $49.00/mo USDC): - **True `0%` transaction fee ($0.00, merchant keeps `100.000%`)** + `125,000,000` RPC/API request credits/mo + `500 RPS` + Unlimited active webhooks + Auto-Downshift ("Never Overpay") guarantee. 5. **x402 Autonomous AI Agent Pay-As-You-Go (`payg_x402`)**: - **$0.50 per 1,000,000 requests** (`0.0005 USDC` per `1,000` requests, `$1.00 = 2,000,000 X-Tokens`) + **`0.005%` (`5¢ per $1,000`) transaction micro-fee**. ### Supported Assets & Non-Custodial Onramps - **USDC** (Base Mainnet `0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913` — EIP-3009 `x402` gasless `transferWithAuthorization` & `sweepBaseUSDC()`) - **XRP** (`cbXRP` on Base + Native `XRPL` Ledger — `$0` wallet reserve lockup vs. `1.2 XRP` locked on raw XRPL) - **RLUSD** (Ripple USD on Base & Native `XRPL`) - **ETH** (Base Native Ether via `sweepETH()`) - **USDT** (`0xfde4C96c8593536E31F229EA8f37b2ADa2699bb2`) - **EURC** (`0x60a3E35Cc302bFA44Cb288Bc5a4F316Fdb1adb42`) - **cbBTC** (`0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf`) - **DAI** (`0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb`) - **Apple Pay / Google Pay / Debit & Credit Card Onramps** (Non-custodial fiat-to-crypto settlement directly into `0xA7a15bCEd59f4B687f5356b880DB3dcDaF086790`) ### Key Endpoints Summary - `GET /api/health`: Live system status, contract addresses, and official links (`@unfeexyz`). - `GET /api/pricing`: Complete machine-readable pricing & fee schedule. - `POST /api/keys/free`: Mint an instant `$0/mo Starter (5¢ per $1,000 Micro-Fee)` API key (`250,000` requests/mo). - `POST /api/checkout/verify` & `POST /api/billing/verify-tx`: Verify Base Mainnet / XRPL checkout payment, upgrade API key tier, fire HMAC-SHA256 webhook (`X-Unfee-Signature`), and generate HTML/text email receipt with Basescan verification link. - `POST /api/x402/settle` & `POST /api/billing/x402-settle`: Settle EIP-3009 `transferWithAuthorization` (`0xcf092995`) gasless USDC authorization on Base. - `POST /api/billing/auto-topup`: Enable or trigger the $1.00 Automatic Top-Up (+2,000,000 X-Tokens at 95% usage). - `POST /api/webhooks/register`: Register a webhook URL + receipt email and receive an `HMAC-SHA256` signing secret (`whsec_unfee_...`). - `POST /api/webhooks/test`: Fire a signed test webhook (`payment.settled` or `topup.completed`) with `X-Unfee-Signature` and email receipt payload. - `POST /api/receipts/email`: Generate and dispatch a formatted transaction receipt email containing the fee breakdown, savings vs. Stripe / Legacy Card Processors (2.9% + 30¢), and clickable Basescan link. - `POST https://api.unfee.xyz/rpc/base`, `POST https://api.unfee.xyz/rpc/eth`, `POST https://api.unfee.xyz/rpc/xrpl`: Flat-rate `1 Request = 1 Credit` JSON-RPC gateways.