Skip to main content
Get from zero to a paid ELUUP API request using the official x402 Axios client flow described in this documentation.

Client Setup

ELUUP’s x402 endpoints require every paid request to carry a signed USDC payment authorization. You do not construct this by hand — the @x402/axios client library wraps your existing axios instance and handles the full challenge → sign → retry flow automatically.

Install dependencies

Configure the client

That’s the entire setup. Every call made through api will:
  1. Send the request without payment.
  2. If the server responds 402, read the payment requirements, sign a USDC authorization with signer, and automatically retry the request with the signed payment attached.
  3. Return the final response — whether that’s a 200 success, or a 402 if the retried payment also failed (see HTTP 402 — Payment Required for why this does not throw).

Important: never use the payTo wallet as your payer

The payTo address is ELUUP’s payment-receiving wallet. Your signer must be a different wallet than payTo, funded with your own USDC. Attempting to pay from the same address as payTo is rejected with self_send_not_allowed (see HTTP 402 — Payment Required).

Fund your wallet correctly

Before making any paid request, confirm:
  • Your signer wallet holds USDC on Base mainnet (eip155:8453) — not a testnet, and not USDC on another chain.
  • The balance covers at least the price of the request you’re making (see Pricing).

x402 docs: Overview · Quickstart · Payment Flow · API Reference · Errors & Troubleshooting · Examples