Skip to main content

x402 Protocol

402.cat uses x402 micropayment protocol instead of API keys. Pay per request with USDC.

Payment Flow

1

Request

Make request to protected endpoint
2

402 Response

Server returns HTTP 402 Payment Required with payment details
3

Sign

Create EIP-3009 authorization signature
4

Retry

Retry request with PAYMENT-SIGNATURE header

Headers

V2 (Current):
PAYMENT-SIGNATURE: <base64_payment_data>
V1 (Backward Compatible):
X-PAYMENT: <base64_payment_data>

Using httpcat-cli

CLI handles authentication automatically:
httpcat buy MOON 0.10
# Automatically signs and pays

Manual Implementation

See x402 Protocol for detailed implementation guide.

Referrals

Add referrer header to earn 10% of fees:
X-402-Referrer: 0xYourAddress...

x402 Protocol Details

Complete x402 documentation