Sign up and create an org
Go to meterlane.app and sign up. During onboarding you will create your first org — this is your tenant namespace in Meterlane. Your org holds API keys, routes, and wallet settings.You do not need a production plan to follow this guide. The sandbox is available immediately after signup.
Get a Base Sepolia wallet with test USDC
You need an EVM wallet private key and some test USDC on Base Sepolia (
eip155:84532).- Generate a new wallet (use Coinbase Wallet, MetaMask, or any EVM wallet that exports a raw private key).
- Visit the Circle Faucet, select Base Sepolia, and request test USDC for your wallet address.
- Store the private key in an environment variable — never commit it to source control.
Install the SDK
Install the
@meterlane/x402 package. The client subpath is MIT-licensed and open source.- npm
- pnpm
- yarn
Make a paid request
The public demo route at
https://gateway.meterlane.app/gateway/demo/demo is a live x402-protected endpoint on Base Sepolia. Use createAgentClient to wrap fetch with automatic payment handling.createAgentClient accepts an optional second argument to pin the network:Base mainnet (
eip155:8453) requires a private mainnet-capable facilitator. The public sandbox facilitator only supports Base Sepolia. Contact the Meterlane team when you are ready for production.Understand the 402 → payment → 200 flow
Here is exactly what happens under the hood when you call The response will look like this:
paidFetch:- First request — your client sends a plain
GET. The gateway has no payment yet, so it returns HTTP 402 Payment Required with anX-Payment-Requirementsheader describing the USDC price, network, and facilitator address. - Payment signing —
createAgentClientreads the requirements, constructs an ERC-3009transferWithAuthorizationsigned by your private key, and encodes it as theX-PAYMENTheader value. - Retry with payment — the client retries the same request, this time including
X-PAYMENT. - Verification and proxy — the gateway submits the signed authorization to the x402 facilitator, which settles the USDC transfer on-chain. The gateway then proxies the request to the upstream route and returns HTTP 200.
What to do next
Now that you have seen the full payment flow, you can create your own protected routes from the dashboard and point agents at your org’s gateway URL.Agent Gateway Overview
Create routes, set per-request prices, and manage API keys for your org.
Key Concepts
Understand x402, facilitators, ERC-3009, and how Meterlane routes work.
Stablecoin Corridor
Send USDC to local fiat beneficiaries in BRL, MXN, NGN, KES, or ZAR.
API Reference
Full REST reference for gateway and corridor endpoints.