HTTP 402 Payment Required

Your Agent Pays. Our API Responds.

No API keys. No accounts. No signup. AI agents pay per request with USDC on Base. 35+ production services from $0.001/request.

35+
Services
$0.001
Min Price
USDC
On Base
50/day
Free Tier

How It Works

Four steps. No accounts. No OAuth. Just HTTP.

1

Agent Requests Any Endpoint

Hit any /v1/{service}/* endpoint. First 50 requests/day are free per IP.

GET /v1/agent-geo/geo/8.8.8.8 Host: agent-gateway-kappa.vercel.app
2

Server Returns 402 + Payment Details

When free tier is exhausted, the response includes exactly what to pay, where, and how much.

HTTP/1.1 402 Payment Required { "status": 402, "payment_required": { "amount": "0.001", "currency": "USDC", "chain": "Base", "chain_id": 8453, "recipient": "0x5595...3724", "token": "0x8335...2913" } }
3

Agent Sends USDC on Base

Agent sends the exact amount (or more) to the recipient address. Standard ERC-20 transfer.

// Standard USDC transfer on Base usdc.transfer("0x5595...3724", 1000) // $0.001 = 1000 wei (6 decimals)
4

Retry with Transaction Hash

Same request, add X-Payment header. Gateway verifies on-chain and proxies to the service.

GET /v1/agent-geo/geo/8.8.8.8 Host: agent-gateway-kappa.vercel.app X-Payment: 0xabc123...def456 // Response: the actual API data { "ip": "8.8.8.8", "country": "US", "city": "Mountain View", ... }

Transparent Pricing

Pay exactly what you use. No minimums. No subscriptions. No hidden fees.

$0.001
per request
Geo, DNS, Search, Feeds, Games, Poison Guard
$0.003
per request
Memory, Storage, Scheduler, Webhooks, DeFi, Wallets
$0.005
per request
Scraping, Screenshots, Code Execution, PDF Gen
$0.01
per request
LLM Router (multi-model inference)
ServiceDescriptionPrice/req

Why HTTP 402?

The internet's unused status code, finally put to work.

0 Accounts Required

No signup flows. No OAuth tokens. No API key management. Your agent just pays and gets compute. The protocol IS the auth.

$ Micropayments

Pay $0.001 per request. No monthly minimums, no tiers, no enterprise sales calls. Perfect for autonomous agents with dynamic workloads.

+ Overpayment Credits

Send more USDC than needed? The excess auto-converts to API credits (500 per $1 USDC). A bonus API key is returned in the response header.

? On-Chain Verified

Every payment is verified on Base mainnet via RPC. Transfer event logs are parsed. Replay attacks are blocked. Trustless by design.

~ Agent Native

Built for AI agents, not humans. agent.json for discovery, llms.txt for capabilities, OpenAPI specs on every endpoint. Agents can find and use services autonomously.

= Composable

Works alongside API keys and free tier. Three auth methods coexist: IP free tier, API key credits, and 402 direct payment. Use whatever fits.

Live Demo

See the 402 flow in action. This hits the real production API.

GET /api/payments/402
Click "Run" to fetch live 402 pricing data

Integrate in 20 Lines

Add 402 payment support to any agent. Python, Node, or raw curl.

Python — Autonomous 402 agent client
# pip install requests eth-account web3
import requests
from web3 import Web3

BASE = "https://agent-gateway-kappa.vercel.app"
# Your agent's Base wallet
w3 = Web3(Web3.HTTPProvider("https://mainnet.base.org"))

def call_api(path):
    # Step 1: Try the request
    r = requests.get(f"{BASE}{path}")
    if r.status_code != 402:
        return r.json()  # Free tier or already paid

    # Step 2: Parse payment requirements
    pay = r.json()["payment_required"]

    # Step 3: Send USDC on Base (your wallet logic here)
    tx_hash = send_usdc(pay["recipient"], pay["amount"])

    # Step 4: Retry with payment proof
    r2 = requests.get(f"{BASE}{path}",
                      headers={"X-Payment": tx_hash})
    return r2.json()

# Use it
data = call_api("/v1/agent-geo/geo/8.8.8.8")
print(data)  # {"ip":"8.8.8.8","country":"US",...}
curl — Manual test
# Step 1: Make a request (free tier: 50/day)
curl https://agent-gateway-kappa.vercel.app/v1/agent-geo/geo/8.8.8.8

# Step 2: When you get 402, send USDC to the recipient address
# Step 3: Retry with your tx hash
curl https://agent-gateway-kappa.vercel.app/v1/agent-geo/geo/8.8.8.8 \
  -H "X-Payment: 0xYOUR_TX_HASH"

Agent Discovery

Agents can discover and use all services programmatically.

agent.json

Standard agent manifest at /.well-known/agent.json with capabilities, pricing, and endpoints.

View manifest

llms.txt

LLM-readable service documentation. Every endpoint, every parameter, in plain text.

View llms.txt

OpenAPI

Full OpenAPI 3.1 specs with Swagger UI. Machine-parseable API contracts.

View docs

402 JSON

All pricing, payment info, and chain details in one JSON endpoint.

View pricing

Start Making Requests

50 free requests per day. No key needed. When you need more, pay with credit card or USDC.