x402 wallet setup: fund a wallet to pay per call

The only credential x402 needs is a funded wallet. Here is the minimal setup to start paying for calls.

Choose a chain and wallet

Pick the rail you want to pay on: an EVM wallet for Base, or a Solana wallet for Solana. A programmatic wallet (a generated keypair you store as an env var) is the typical setup for an agent or backend.

Fund it with USDC

Move a small amount of USDC onto your chosen chain — Base USDC or Solana USDC. A few cents covers thousands of typical 2s calls, and you top up whenever you like. No 2s account is involved; the wallet is the account.

Wire the key into your client

Put the wallet private key in an environment variable (for example EVM_PRIVATE_KEY) and pass it to the SDK. Keep it server-side — never ship a funded key to a browser.

TypeScripttypescript
import { TwoS } from '@2sio/sdk'
const client = new TwoS({ privateKey: process.env.EVM_PRIVATE_KEY as `0x${string}` })

No wallet yet? Try free first

You can exercise any endpoint with a trial call before funding anything — see the quickstart.

Call a live x402 API right now — no signup.

Browse the full endpoint directory, grab the quickstart, or read the llms.txt manifest. Every endpoint is keyless and pay-per-call.

FAQ

What wallet do I need for x402?
An EVM wallet to pay on Base, or a Solana wallet to pay on Solana, funded with a little USDC. For agents and backends, a generated keypair stored in an env var is typical.
How much should I fund?
A few cents of USDC is enough to start — most calls cost a fraction of a cent and you pay per call. Top up as needed.
Is it safe to put a wallet key in an env var?
Use a dedicated wallet funded with only what you need, keep the key server-side (never in browser code), and rotate it if exposed. Treat it like any other secret.

Related

Topics: x402 wallet · x402 wallet setup · fund wallet for x402 · usdc wallet for x402 · x402 getting started wallet