Skip to main content

Base URLs

EnvironmentURLNetwork
Productionhttps://agent.402.catBase (eip155:8453)
Testnethttps://agent.402.catBase Sepolia (eip155:84532)
Network is auto-detected from your wallet’s transaction history.

Quick Start

# Free endpoint - no payment required
curl https://agent.402.cat/health

# Paid endpoint - requires x402 payment
curl -H "PAYMENT-SIGNATURE: <sig>" \
  https://agent.402.cat/entrypoints/token_info/invoke

Authentication

402.cat uses x402 micropayment protocol for authentication. No API keys required.

Payment Flow

  1. Request protected endpoint → Receive 402 Payment Required
  2. Sign EIP-3009 authorization with your wallet
  3. Retry request with PAYMENT-SIGNATURE header
  4. Payment verified → Response returned
See Authentication for details.

Endpoint Types

Free Endpoints

No payment required:
  • GET /health - Health check
  • GET /tokens - List all tokens
  • GET /tokens/:id - Token info
  • GET /positions - User positions
  • GET /api/* - Read-only data
Require x402 micropayment:
  • POST /tokens - Create token ($0.01)
  • POST /entrypoints/token_buy_* - Buy tokens (variable)
  • POST /entrypoints/token_sell - Sell tokens ($0.01)
  • POST /entrypoints/* - Various operations

Response Format

All endpoints return JSON:
{
  "success": true,
  "operation": "buy_token",
  "data": {
    "tokenId": "...",
    "tokensReceived": "1234.567"
  }
}
Error format:
{
  "success": false,
  "error": {
    "code": "INSUFFICIENT_FUNDS",
    "message": "Not enough USDC",
    "details": {...}
  }
}

Rate Limits

  • Free endpoints: 100 req/min per IP
  • Paid endpoints: No rate limit (pay per use)
  • Quote providers: Internal rate limiting per provider

Next Steps