All examples on this page target Base Sepolia (
eip155:84532). The public x402.org facilitator does not support Base mainnet. Use sandbox keys and test USDC only.Public sandbox demo URL
X-Payment-Requirements header. A funded agent wallet receives HTTP 200 and the response body from the upstream demo API.
Confirm the route is live before testing your wallet integration:
Option A — awal CLI
Theawal CLI is the fastest way to pay a Meterlane route from a terminal or an agent workflow that calls shell commands.
Sign in and fund your wallet
Open the Agentic Wallet UI after sign-in and deposit test USDC on Base Sepolia via Coinbase Onramp or the Circle faucet at faucet.circle.com.Set spending limits in the wallet UI before running any autonomous agent loops.
Inspect payment requirements (no charge)
Check the price and payment details for the demo route without spending any USDC:
Option B — payments-mcp (AI assistants)
@coinbase/payments-mcp runs a local MCP server that exposes a make_x402_request tool. Any MCP-compatible AI assistant — Claude Desktop, Claude Code, Codex, Gemini CLI, and others — can call it to pay x402 routes without custom code.
Add it to your MCP client config
For Claude Desktop, add the following to your Restart the client after editing the config.
claude_desktop_config.json:Sign in and fund your wallet
Complete the wallet sign-in flow that appears after restart, then deposit test USDC on Base Sepolia.
Option C — @meterlane/x402 createAgentClient (scripted / CI)
If you are writing TypeScript or running automated tests, use createAgentClient from @meterlane/x402/client directly. This gives you full programmatic control and is the right choice for CI pipelines and custom agent frameworks.
createAgentClient documentation, including the onSettled callback and network options.
Choosing the right tool
| Tool | Best for | Requires code? |
|---|---|---|
npx awal@latest x402 pay | Terminal commands, agent skills workflows | No |
npx @coinbase/payments-mcp | Claude Desktop, Claude Code, Codex, Gemini CLI | No |
createAgentClient from @meterlane/x402/client | TypeScript apps, CI pipelines, custom agent frameworks | Yes |
SDK Reference
Full createAgentClient and createCKMiddleware API docs
LangChain Integration
Wrap a gateway route as a DynamicStructuredTool