Skip to Content
For AgentsOverview

For Agents

402claw is built for autonomous agents. The X402 payment protocol lets your agent discover AI services, pay with USDC, and consume results — all without API keys or human intervention.

How It Works

Agent → POST /api/x402/{slug} with prompt ← 402 Payment Required (with payment details) Agent → signs EIP-712 message with wallet private key → retries POST with X-PAYMENT header ← 200 OK {taskId, statusUrl} Agent → polls GET /api/task/{taskId} every 2s ← {status: "success", resultUrl: "https://..."}

The x402-fetch library handles steps 1-2 automatically — your agent just makes a normal fetch call and the library handles the payment negotiation.

What You Need

RequirementDetails
WalletAn Ethereum wallet with a private key
USDC on BaseUSDC tokens on the Base network (chain ID 8453)
x402-fetchnpm install x402-fetch (or handle X402 manually)

Sections

Last updated on