⚑ UnFee Developer & AI Agent Docs
Base Mainnet (8453) Β· Ethereum (1) Β· Native XRPL Content-Negotiated: text/html & text/markdown

UnFee (unfee.xyz) Developer & AI Agent Documentation

The 100% non-custodial anti-fee payment rail & flat-rate 1 Call = 1 Credit multi-chain JSON-RPC gateway. Accept USDC (Gasless EIP-3009 x402), XRP (cbXRP on Base & Native XRPL), RLUSD, ETH, USDT, EURC, cbBTC, DAI, and Apple Pay / Google Pay / Debit & Credit Cards with True 0% Fee on the $5/mo Indie Tier or 0.005% (5Β’ per $1,000) on the $0/mo Starter Tier.

⚑ 60-Second Quickstart πŸ“₯ View Raw Markdown (/docs.md) πŸ’³ Open Live /pay Checkout πŸ“œ OpenAPI 3.1 JSON

🧭 Our Mission, Values & Guiding Principles

UnFee is never positioned as a custodial middleman or legacy processor replica. We are the 100% non-custodial anti-fee alternative built from the ground up to eliminate middleman rent extraction and lower costs for all crypto and fiat users:

1. Lower Costs for All Crypto & Fiat Users

Eliminate extractive middleman tollsβ€”including Stripe / Legacy Card Processors (2.9% + $0.30), Coinbase Commerce (1.0%), raw XRPL merchant gateways (0.5%–1.0% + 1.2 XRP reserve lockups), and 500x compute-unit RPC markupsβ€”so everyday people, merchants, and AI developers keep what they earn.

2. Radical Pricing Transparency & Never-Overpay Fairness

Flat 1 Call = 1 Credit RPC metering on every method, $0/mo Starter (5Β’ per $1,000 Micro-Fee) with an exact $100,000/mo breakeven, $5/mo Indie Tier (True 0% Fee) with 10M requests/mo, and automatic Auto-Downshift billing so users never overpay for unused capacity.

3. 100% Non-Custodial Sovereignty

Peer-to-peer atomic settlement directly to the merchant's wallet via verified, immutable Base Mainnet smart contracts (0xA7a15bCEd59f4B687f5356b880DB3dcDaF086790) with zero custody (0%), zero admin keys, and zero reserve lockups ($0).

1. Overview, Transparent Pricing & Architecture

Every UnFee API key works seamlessly across both our Non-Custodial Multi-Asset Checkout and our Flat-Rate 1 Call = 1 Credit JSON-RPC Gateway.

Tier / Plan ID Monthly Price Included RPC Credits (1 Call = 1 Credit) Transaction Fee Merchant Keeps Burst Limit Key Highlights & Breakeven Math
$0/mo Starter (5Β’ per $1,000 Micro-Fee)
free
$0.00 / mo 250,000 / mo 0.005% (0.5 bps = 5Β’ per $1,000) 99.995% 10 RPS $10,000/mo volume = 50Β’ fee. Exact $100,000/mo breakeven ($100k Γ— 0.005% = $5.00).
$5/mo Indie Tier (True 0% Fee)
indie_5
$5.00 / mo 10,000,000 / mo ($0.50 / 1M) 0.000% ($0.00 Β· 0 bps) 100.000% 50 RPS True 0% transaction fee on unlimited volume + Auto-Downshift guarantee. Automatic winner above $100k/mo.
$15/mo Pro Tier (True 0% Fee)
pro_15
$15.00 / mo 35,000,000 / mo ($0.43 / 1M) 0.000% ($0.00 Β· 0 bps) 100.000% 200 RPS True 0% transaction fee + 35M flat credits + Auto-Downshift to $5 or $0.
$49/mo Scale Tier (True 0% Fee)
scale_49
$49.00 / mo 125,000,000 / mo ($0.39 / 1M) 0.000% ($0.00 Β· 0 bps) 100.000% 500 RPS True 0% transaction fee + 125M flat credits + Unlimited signed webhooks + Auto-Downshift.
Pay-As-You-Go / x402 & Auto Top-Up
payg_x402
$1.00 per 2,000,000 X-Tokens +2,000,000 per $1.00 ($0.50 / 1M) 0.005% (5Β’ per $1,000) 99.995% 200 RPS Stateless HTTP 402 machine micro-payments & optional β˜‘ Automatic Top-Up at 95% capacity.

β˜‘ Automatic Top-Up ($1.00 = +2,000,000 X-Tokens)

Optional opt-in per API key. When remaining credits reach 95% usage (<= 100,000 credits), UnFee automatically adds +2,000,000 X-Tokens for $1.00 USDC so production traffic never stops.

πŸ“‰ Auto-Downshift ("Never Overpay") Billing

If your monthly usage finishes in a lower bracket than your subscribed ceiling, UnFee automatically bills you at the lowest tier covering your actual requests and rolls over unused credit.

πŸ”” Usage Alerts (60%, 70%, 80%, 90%, 95%)

Every key includes configurable threshold alerts via response headers (X-Usage-Alert-Status), signed webhooks, and Discord notifications.

2. 60-Second Quickstart (Mint an API Key & Make Your First Call)

Mint an instant 250,000 req/mo API key (uf_live_...) with zero signup and zero credit card required.

BASH β€” Mint a Free 250,000 req/mo Key via POST https://unfee.xyz/api/keys/free
curl -sS -X POST https://unfee.xyz/api/keys/free \
  -H "Content-Type: application/json" \
  -d '{
    "label": "production-ai-agent",
    "tier": "free",
    "autoTopUpEnabled": true,
    "alertThresholds": [60, 70, 80, 90, 95]
  }'
JSON Response (201 Created)
{
  "status": "created",
  "verified": true,
  "apiKey": "uf_live_free_9a8f7c6e5d4b3a210987",
  "plan": "free",
  "planName": "$0/mo Starter (5Β’ per $1,000 Micro-Fee)",
  "txFeePct": "0.005%",
  "creditsAdded": 250000,
  "creditsRemaining": 250000,
  "maxRps": 10,
  "autoTopUp": {
    "enabled": true,
    "amountUsd": 1,
    "tokensAddedPerTopUp": 2000000,
    "triggerAtUsagePct": 95
  },
  "usageAlerts": {
    "enabled": true,
    "thresholdsPct": [60, 70, 80, 90, 95],
    "statusHeader": "OK (alerts_on:60,70,80,90,95)"
  },
  "create2SplitterAddress": "0xA7a15bCEd59f4B687f5356b880DB3dcDaF086790"
}
⚑ Try it live right now in your browser: Mint a real uf_live_... key from POST /api/keys/free

3. Non-Custodial Checkout & 1-Line JS SDK (/pay & /checkout.js)

Embed a hosted checkout link (https://unfee.xyz/pay) or drop in our 1-line SDK (https://unfee.xyz/checkout.js). Every payment routes directly into our verified Base Mainnet Create2FeeSplitter (0xA7a15bCEd59f4B687f5356b880DB3dcDaF086790).

Supported Settlement Assets & Payment Rails

Asset / Rail Network / Standard Contract / Settlement Rail Splitter Function $5/mo Indie Fee $0/mo Starter Fee
USDC Base Mainnet (8453) Β· EIP-3009 x402 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 sweepBaseUSDC() 0.000% ($0) 0.005% (5Β’/$1k)
XRP cbXRP on Base + Native XRPL Base cbXRP & Native XRPL ($0 reserve lockup) sweepToken(address) & XRPL 0.000% ($0) 0.005% (5Β’/$1k)
RLUSD Ripple USD on Base & XRPL Base ERC-20 & XRPL Issued Currency sweepToken(address) 0.000% ($0) 0.005% (5Β’/$1k)
ETH Base Mainnet Native Ether (8453) Native ETH (18 decimals) sweepETH() 0.000% ($0) 0.005% (5Β’/$1k)
USDT / EURC / cbBTC / DAI Base Mainnet ERC-20 (8453) 0xfde4...9bb2 Β· 0x60a3...db42 Β· 0xcbB7...33Bf Β· 0x50c5...B0Cb sweepToken(address) 0.000% ($0) 0.005% (5Β’/$1k)
Apple Pay / Google Pay / Debit & Credit Card Non-Custodial Fiat-to-Base USDC Onramp Settles directly into 0xA7a15bCEd59f4B687f5356b880DB3dcDaF086790 sweepBaseUSDC() (0% custody) 0.000% ($0) 0.005% (5Β’/$1k)

1-Line Drop-In HTML & Programmatic JS SDK (https://unfee.xyz/checkout.js)

HTML + JavaScript β€” 1-Line Checkout Drop-In & UnFeeCheckout.open({...})
<!-- 1-Line Automatic Checkout Button -->
<script
  src="https://unfee.xyz/checkout.js"
  data-merchant="0x04A72616B16Aa4b74A93851eF9FBF7Bf9f2223a8"
  data-merchant-name="Acme Cloud AI"
  data-amount="25.00"
  data-asset="USDC"
  data-item="Pro AI Workflow Subscription (Monthly)"
  data-tier="indie_5"
  data-customer-email="builder@acme.xyz"
  data-webhook-url="https://api.acme.xyz/webhooks/unfee"
></script>

<!-- Or Trigger Programmatically -->
<script>
  UnFeeCheckout.open({
    merchant: "0x04A72616B16Aa4b74A93851eF9FBF7Bf9f2223a8",
    merchantName: "Acme Cloud AI",
    amount: "25.00",
    asset: "USDC",
    item: "Pro AI Workflow Subscription (Monthly)",
    tier: "indie_5",
    customerEmail: "builder@acme.xyz",
    webhookUrl: "https://api.acme.xyz/webhooks/unfee"
  });
</script>

Verify Checkout Settlement & Trigger Receipt (POST https://unfee.xyz/api/checkout/verify)

BASH β€” Verify Payment & Dispatch Signed Webhook + Email Receipt
curl -sS -X POST https://unfee.xyz/api/checkout/verify \
  -H "Content-Type: application/json" \
  -d '{
    "plan": "indie_5",
    "asset": "USDC",
    "amountUsdc": "25.00",
    "merchantWallet": "0x04A72616B16Aa4b74A93851eF9FBF7Bf9f2223a8",
    "merchantName": "Acme Cloud AI",
    "item": "Pro AI Workflow Subscription",
    "receiptEmail": "builder@acme.xyz",
    "webhookUrl": "https://api.unfee.xyz/api/webhooks/mock-receiver"
  }'

4. Gasless x402 Autonomous AI Agent Payments (EIP-3009)

Autonomous AI agents can inspect GET https://unfee.xyz/.well-known/x402.json, handle HTTP 402 Payment Required challenges, sign an off-chain EIP-3009 transferWithAuthorization payload on Base Mainnet USDC (0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913), and settle via POST https://unfee.xyz/api/x402/settle without holding ETH for gas.

TypeScript (viem) β€” Autonomous Agent EIP-3009 x402 Settlement
import { createWalletClient, http, parseUnits } from "viem";
import { privateKeyToAccount } from "viem/accounts";
import { base } from "viem/chains";
import crypto from "node:crypto";

const account = privateKeyToAccount(process.env.AGENT_PRIVATE_KEY as `0x${string}`);
const client = createWalletClient({ account, chain: base, transport: http("https://api.unfee.xyz/rpc/base") });

const BASE_USDC = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";
const UNFEE_SPLITTER = "0xA7a15bCEd59f4B687f5356b880DB3dcDaF086790";

async function settleX402AgentKey() {
  const nonce = ("0x" + crypto.randomBytes(32).toString("hex")) as `0x${string}`;
  const validBefore = BigInt(Math.floor(Date.now() / 1000) + 3600);
  const value = parseUnits("5.00", 6); // $5.00 Indie Tier -> 10,000,000 credits + 0% fee

  const signature = await client.signTypedData({
    domain: { name: "USD Coin", version: "2", chainId: 8453, verifyingContract: BASE_USDC },
    types: {
      TransferWithAuthorization: [
        { name: "from", type: "address" },
        { name: "to", type: "address" },
        { name: "value", type: "uint256" },
        { name: "validAfter", type: "uint256" },
        { name: "validBefore", type: "uint256" },
        { name: "nonce", type: "bytes32" },
      ],
    },
    primaryType: "TransferWithAuthorization",
    message: { from: account.address, to: UNFEE_SPLITTER, value, validAfter: 0n, validBefore, nonce },
  });

  const res = await fetch("https://unfee.xyz/api/x402/settle", {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({
      plan: "indie_5",
      authorization: {
        from: account.address,
        to: UNFEE_SPLITTER,
        value: value.toString(),
        validAfter: 0,
        validBefore: Number(validBefore),
        nonce,
      },
      signature,
    }),
  });
  console.log("Minted x402 API Key:", await res.json());
}
Python (eth-account + requests) β€” Autonomous Agent EIP-3009 x402 Settlement
import os, time, secrets, requests
from eth_account import Account
from eth_account.messages import encode_typed_data

acct = Account.from_key(os.environ["AGENT_PRIVATE_KEY"])
BASE_USDC = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913"
UNFEE_SPLITTER = "0xA7a15bCEd59f4B687f5356b880DB3dcDaF086790"

nonce_hex = "0x" + secrets.token_hex(32)
valid_before = int(time.time()) + 3600
typed_data = {
    "types": {
        "EIP712Domain": [
            {"name": "name", "type": "string"},
            {"name": "version", "type": "string"},
            {"name": "chainId", "type": "uint256"},
            {"name": "verifyingContract", "type": "address"},
        ],
        "TransferWithAuthorization": [
            {"name": "from", "type": "address"},
            {"name": "to", "type": "address"},
            {"name": "value", "type": "uint256"},
            {"name": "validAfter", "type": "uint256"},
            {"name": "validBefore", "type": "uint256"},
            {"name": "nonce", "type": "bytes32"},
        ],
    },
    "domain": {"name": "USD Coin", "version": "2", "chainId": 8453, "verifyingContract": BASE_USDC},
    "primaryType": "TransferWithAuthorization",
    "message": {
        "from": acct.address,
        "to": UNFEE_SPLITTER,
        "value": 5_000_000,
        "validAfter": 0,
        "validBefore": valid_before,
        "nonce": bytes.fromhex(nonce_hex[2:]),
    },
}
signed = Account.sign_message(encode_typed_data(full_message=typed_data), acct.key)
resp = requests.post("https://unfee.xyz/api/x402/settle", json={
    "from": acct.address, "to": UNFEE_SPLITTER, "value": "5000000",
    "plan": "indie_5", "nonce": nonce_hex, "validAfter": 0,
    "validBefore": valid_before, "signature": signed.signature.hex()
})
print(resp.json())

5. Flat-Rate 1 Call = 1 Credit JSON-RPC Gateway (/rpc/base, /rpc/eth, /rpc/xrpl)

Legacy RPC providers multiply heavy calls by 75x–500x compute units. On UnFee, every JSON-RPC method costs exactly 1 Credit flat.

JSON-RPC / Indexer Method UnFee Credit Cost Legacy CU Provider Cost 10M Calls on UnFee ($5 Indie) 10M Calls on Legacy CU Providers Builder Savings
eth_blockNumber / eth_call 1 Credit 10 – 26 CUs $5.00 $47.50 – $123.50+ 89.5% – 96.0% saved
eth_getLogs (Event & Token Indexing) 1 Credit 750 CUs $5.00 $350.00 – $3,500.00+ 98.6% – 99.8% saved
debug_traceTransaction 1 Credit 2,500 CUs $5.00 $1,187.50 – $11,875.00+ 99.6%+ saved
XRPL server_info / account_info / tx 1 Credit Paid Add-On / Gateway Fee $5.00 ($0 on 250K Starter) $49.00 – $299.00/mo 90.0%+ saved
BASH β€” Base Mainnet (/rpc/base), Ethereum Mainnet (/rpc/eth) & Native XRPL (/rpc/xrpl)
# 1. Base Mainnet (Chain ID 8453) β€” 1 Call = 1 Credit
curl -sS -X POST https://api.unfee.xyz/rpc/base \
  -H "Content-Type: application/json" \
  -H "X-API-Key: uf_live_YOUR_API_KEY" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'

# 2. Ethereum Mainnet (Chain ID 1) β€” 1 Call = 1 Credit
curl -sS -X POST https://api.unfee.xyz/rpc/eth \
  -H "Content-Type: application/json" \
  -H "X-API-Key: uf_live_YOUR_API_KEY" \
  -d '{"jsonrpc":"2.0","id":1,"method":"eth_blockNumber","params":[]}'

# 3. Native XRP Ledger (XRPL) β€” 1 Call = 1 Credit
curl -sS -X POST https://api.unfee.xyz/rpc/xrpl \
  -H "Content-Type: application/json" \
  -H "X-API-Key: uf_live_YOUR_API_KEY" \
  -d '{"method":"server_info","params":[{}]}'
TypeScript (viem / ethers.js) & Python (web3.py)
// TypeScript (viem)
import { createPublicClient, http } from "viem";
import { base, mainnet } from "viem/chains";

export const baseClient = createPublicClient({
  chain: base,
  transport: http("https://api.unfee.xyz/rpc/base", {
    fetchOptions: { headers: { "X-API-Key": process.env.UNFEE_API_KEY! } },
  }),
});

// Python (web3.py)
# from web3 import Web3
# w3 = Web3(Web3.HTTPProvider("https://api.unfee.xyz/rpc/base", request_kwargs={"headers": {"X-API-Key": "uf_live_..."}}))
# print(w3.eth.block_number)

6. Signed Webhooks (HMAC-SHA256) & Instant Email Receipts

Register webhook endpoints via POST /api/webhooks/register, trigger live test deliveries via POST /api/webhooks/test, and dispatch itemized HTML/text email receipts via POST /api/receipts/email.

Node.js (Express) β€” Verify X-Unfee-Signature (HMAC-SHA256)
import express from "express";
import crypto from "node:crypto";

const app = express();
const WEBHOOK_SECRET = process.env.UNFEE_WEBHOOK_SECRET; // "whsec_unfee_..."

app.post("/webhooks/unfee", express.raw({ type: "application/json" }), (req, res) => {
  const sig = req.headers["x-unfee-signature"] || "";
  const expected = "sha256=" + crypto.createHmac("sha256", WEBHOOK_SECRET).update(req.body).digest("hex");
  if (sig.length !== expected.length || !crypto.timingSafeEqual(Buffer.from(sig), Buffer.from(expected))) {
    return res.status(401).json({ error: "Invalid X-Unfee-Signature" });
  }
  const payload = JSON.parse(req.body.toString("utf8"));
  console.log("Verified UnFee Webhook:", payload.event, payload.txHash);
  res.status(200).json({ received: true });
});
Python (FastAPI) β€” Verify X-Unfee-Signature (HMAC-SHA256)
import os, hmac, hashlib
from fastapi import FastAPI, Request, HTTPException

app = FastAPI()
WEBHOOK_SECRET = os.environ["UNFEE_WEBHOOK_SECRET"]

@app.post("/webhooks/unfee")
async def verify_unfee_webhook(request: Request):
    raw_body = await request.body()
    sig = request.headers.get("X-Unfee-Signature", "")
    expected = "sha256=" + hmac.new(WEBHOOK_SECRET.encode(), raw_body, hashlib.sha256).hexdigest()
    if not hmac.compare_digest(sig, expected):
        raise HTTPException(status_code=401, detail="Invalid X-Unfee-Signature")
    return {"received": True}

7. Verified Base Mainnet (8453) Smart Contracts & Non-Custodial Tax Architecture

Contract / Component Base Mainnet (8453) Address Basescan Verification Link Architecture Notes
Create2FeeSplitter 0xA7a15bCEd59f4B687f5356b880DB3dcDaF086790 View on Basescan β†— Block #53038810 Β· 2,190 bytes Β· solc 0.8.24 Β· Zero admin keys, un-upgradeable.
Create2FeeSplitterFactory 0x6ED5d52C58b44480aE764DE79a1086b23Aa6De26 View on Basescan β†— Deterministic counterfactual invoice deployment factory.
Protocol Treasury 0xAF4107196680A0d2Ca7E027D77CcF3Eb2EEBdFd0 View on Basescan β†— Receives protocol subscription & micro-fee share only; never touches merchant principal.
Base Mainnet USDC 0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 View on Basescan β†— Canonical Circle USD Coin (6 decimals, EIP-3009 enabled).
Solidity β€” ICreate2FeeSplitter Interface (0xA7a15bCEd59f4B687f5356b880DB3dcDaF086790)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

interface ICreate2FeeSplitter {
    function merchantWallet() external view returns (address);
    function protocolTreasury() external view returns (address);
    function invoiceId() external view returns (bytes32);

    function sweepBaseUSDC() external;
    function sweepToken(address token) external;
    function sweepETH() external;
}

FinCEN FIN-2019-G001 Section 4.2.1 Non-Custodial Software Exemption & Tax Isolation: Because 100.000% of merchant principal on the $5/mo Indie Tier (99.995% on the $0/mo Starter Tier) routes atomically peer-to-peer straight to the merchant's wallet on-chain, UnFee never holds custody of customer funds and is never taxed on merchant principal volume.

8. AI Agent & LLM Discovery Directory (Machine-Readable Index)

Discovery Resource Live URL Content-Type Description
Interactive Docs Portal https://unfee.xyz/docs text/html / text/markdown Full documentation hub; returns raw Markdown when requested with Accept: text/markdown or ?format=md.
Raw Markdown Mirror https://unfee.xyz/docs.md text/markdown; charset=utf-8 Clean single-file Markdown documentation for LLMs, Cursor @Docs, and RAG pipelines.
Concise LLM Index https://unfee.xyz/llms.txt text/plain; charset=utf-8 Standard llms.txt overview, guiding principles, quickstart commands, and discovery URLs.
Full LLM Reference https://unfee.xyz/llms-full.txt text/plain; charset=utf-8 Expanded architecture, contract table, and curl reference for context-window ingestion.
OpenAPI 3.1 Specification https://unfee.xyz/openapi.json application/json Complete OpenAPI 3.1 schema for OpenAI Actions, LangChain, and automated SDK generators.
x402 Payment Manifest https://unfee.xyz/.well-known/x402.json application/json Machine-readable EIP-3009 transferWithAuthorization contract and pricing descriptor.
AI Plugin Manifest https://unfee.xyz/.well-known/ai-plugin.json application/json AI plugin manifest linking /openapi.json, /docs, and /docs.md.
Installable AI Agent Skill /skills/low-cost-crypto-transaction/SKILL.md text/markdown; charset=utf-8 Drop-in skill for Cursor, Claude Code, OpenClaw, and Smithery agents.
AI Skill Registry JSON https://unfee.xyz/skills/index.json application/json Structured JSON catalog of UnFee capabilities, endpoints, and supported assets.