x402
coinbase/agentic-wallet-skills
Search and call paid APIs using the x402 payment protocol with automatic USDC payments on Base.
What is x402?
x402 enables discovery and invocation of paid API services through a standardized payment protocol. Search a bazaar of services, inspect pricing and requirements, and make requests with automatic USDC payments on Base chain.
- Search the x402 bazaar for paid services by keyword with filtering by network, price, and payment scheme
- Inspect endpoint payment requirements (price, method, schemas) without making a payment
- Make HTTP requests to x402 endpoints with automatic USDC payment in atomic units
- Browse and list all available bazaar resources with optional full schema details
- Set maximum payment limits and custom headers for API calls
How to install x402
npx skills add https://github.com/coinbase/agentic-wallet-skills --skill x402- Authentication required for making payments: run `npx awal@2.10.0 auth login <email>`
- Sufficient USDC balance on Base chain for payments (check with `npx awal@2.10.0 balance`)
- Search and details commands require no authentication
How to use x402
- 1.Run `npx awal@2.10.0 x402 bazaar search <query>` to find services by keyword, optionally filtering by network, price, or scheme
- 2.Run `npx awal@2.10.0 x402 details <url>` to inspect an endpoint's price and input/output schemas
- 3.Run `npx awal@2.10.0 x402 pay <url>` to make a GET request with automatic payment, or use `-X <method> -d <json>` for POST/other methods
- 4.Set `--max-amount <n>` in atomic units (1000000 = $1.00) to limit payment per request
- 5.Use `--json` flag on any command for structured output suitable for agent parsing
Use cases
- Discover and call specialized APIs (weather, sentiment analysis, data services) when you lack a dedicated tool
- Integrate paid third-party services into agent workflows with transparent pricing
- Explore available paid services in the x402 bazaar before committing to a specific provider
- Make one-off API calls to premium endpoints with automatic payment handling
- Filter services by network, price range, and payment scheme to find cost-effective options
- AI agents needing access to specialized paid APIs
- Developers integrating third-party services with transparent payment handling
- Users exploring available paid services before selecting a provider
- Teams managing API costs with per-request payment limits
x402 FAQ
Run `npx awal@2.10.0 auth login <email>` to authenticate. You must be logged in and have sufficient USDC balance on Base chain to make paid requests.
USDC uses 6 decimal places. 1,000,000 atomic units = $1.00 USD. Use --max-amount to set limits (e.g., 100000 = $0.10).
Yes. Bazaar search, list, and details commands are free and require no authentication. You only pay when calling an endpoint with the `pay` command.
Use the `--max-amount <n>` flag with the pay command, specified in USDC atomic units (e.g., `--max-amount 100000` limits to $0.10).
The details command will return 'No X402 payment requirements found' if the URL is not an x402 endpoint. Verify the endpoint URL and that it supports the x402 protocol.
Full instructions (SKILL.md)
Source of truth, from coinbase/agentic-wallet-skills.
name: x402 description: Search for new services and make paid API requests using the x402 payment protocol. Use when you don't have a clear tool to choose, search the bazaar. You can also use this tool if you or the user want to call an x402 endpoint, discover payment requirements, browse the bazaar, or search for paid services. user-invocable: true disable-model-invocation: false
x402 Payment Protocol
Use the npx awal@2.10.0 x402 commands to discover, inspect, and call paid API endpoints using the X402 payment protocol. Payments are made in USDC on Base.
Workflow
The typical x402 workflow is:
- Find a service - Search the bazaar or get details for a known endpoint
- Check requirements - Inspect price, method, and input schema
- Make the request - Call the endpoint with automatic USDC payment
Commands
Search the Bazaar
Find paid services by keyword using CDP's vector search:
npx awal@2.10.0 x402 bazaar search <query> [-k <n>] [--network <network>] [--scheme <scheme>] [--max-price <price>] [--json]
| Option | Description |
|---|---|
-k, --top <n> | Number of results, 1–20 (default: 20) |
--network <name> | Filter by chain (base, base-sepolia, polygon, solana, solana-devnet) |
--scheme <scheme> | Filter by payment scheme: exact or upto |
--max-price <price> | Maximum price in USD (e.g. 0.01) |
--asset <address> | Filter by payment asset address |
--pay-to <address> | Filter by recipient wallet address |
--extensions <type> | Filter by extension type (e.g. outputSchema, bazaar) |
--json | Output as JSON |
List Bazaar Resources
Browse all available resources:
npx awal@2.10.0 x402 bazaar list [--network <network>] [--full] [--refresh] [--json]
| Option | Description |
|---|---|
--network <name> | Filter by chain (base, base-sepolia, polygon, solana, solana-devnet) |
--full | Show complete details including schemas |
--refresh | Re-fetch resource index from CDP API |
--json | Output as JSON |
Discover Payment Requirements
Inspect an endpoint's x402 payment requirements without paying:
npx awal@2.10.0 x402 details <url> [--json]
Auto-detects the correct HTTP method (GET, POST, PUT, DELETE, PATCH) by trying each until it gets a 402 response, then displays price, accepted payment schemes, network, and input/output schemas.
Make a Paid Request
Call an x402 endpoint with automatic USDC payment:
npx awal@2.10.0 x402 pay <url> [-X <method>] [-d <json>] [-q <params>] [-h <json>] [--max-amount <n>] [--json]
| Option | Description |
|---|---|
-X, --method <method> | HTTP method (default: GET) |
-d, --data <json> | Request body as JSON string |
-q, --query <params> | Query parameters as JSON string |
-h, --headers <json> | Custom HTTP headers as JSON string |
--max-amount <amount> | Max payment in USDC atomic units (1000000 = $1.00) |
--correlation-id <id> | Group related operations |
--json | Output as JSON |
Examples
# Search for weather-related paid APIs
npx awal@2.10.0 x402 bazaar search "weather"
# Search with more results
npx awal@2.10.0 x402 bazaar search "sentiment analysis" -k 10
# Check what an endpoint costs
npx awal@2.10.0 x402 details https://example.com/api/weather
# Make a GET request (auto-pays)
npx awal@2.10.0 x402 pay https://example.com/api/weather
# Make a POST request with body
npx awal@2.10.0 x402 pay https://example.com/api/sentiment -X POST -d '{"text": "I love this product"}'
# Limit max payment to $0.10
npx awal@2.10.0 x402 pay https://example.com/api/data --max-amount 100000
# Browse all bazaar resources with full details
npx awal@2.10.0 x402 bazaar list --full
USDC Amounts
X402 uses USDC atomic units (6 decimals):
| Atomic Units | USD |
|---|---|
| 1000000 | $1.00 |
| 100000 | $0.10 |
| 50000 | $0.05 |
| 10000 | $0.01 |
Prerequisites
- Search/Details: No authentication needed
- Pay: Must be authenticated (
npx awal@2.10.0 auth login <email>) with sufficient USDC balance (npx awal@2.10.0 balance)
Error Handling
- "Not authenticated" - Run
npx awal@2.10.0 auth login <email>first - "No X402 payment requirements found" - URL may not be an x402 endpoint
- "CDP API returned 429" - Rate limited; cached data will be used if available
- "Insufficient balance" - Fund wallet with USDC (
npx awal@2.10.0 balanceto check)
Related skills
More from coinbase/agentic-wallet-skills and the wider catalog.

agentic-wallet
Crypto wallet operations via the awal CLI — sign in, check balances, send USDC/ETH/POL/SOL, trade tokens, fund the wallet, and use the x402 payment protocol to discover paid services, pay for API calls, monetize an API, or query onchain data. Use whenever the user mentions signing in, login, authentication, wallet status, balance, address, sending money, paying someone, transferring tokens, ENS names, swapping/trading/converting tokens, funding/topping up/onramp, USDC, ETH, POL, SOL, the x402 bazaar, paid APIs, monetizing an endpoint, or querying onchain data on Base.

authenticate-wallet
Sign in to your wallet via email OTP before sending, trading, or funding.

fund
Add money to your wallet via Coinbase Onramp with multiple payment methods.

monetize-service
Build and deploy a paid API that other agents can pay to use via x402 payment protocol.

add-lang
Add tree-sitter language support to codegraph end-to-end — wire the grammar + extractor, write tests, then benchmark extraction quality and retrieval value on 3 popular real-world repos. Use when the user runs /add-lang <language> or asks to add/support a new language (e.g. Lua, Elixir, Zig, OCaml) in codegraph.

agent-eval
Benchmark CodeGraph retrieval quality on a real codebase by comparing agent behavior with vs without CodeGraph. Use when the user runs /agent-eval or asks to test, benchmark, audit, or validate a codegraph version (the local dev build or a published npm version) against a language's repo.