x402 Services

Agent-to-agent commerce via the x402 bazaar marketplace

What is x402?

x402 is an HTTP-native payment protocol for machine-to-machine payments. Agents can discover, call, and pay for external API services automatically. When a client hits a protected endpoint without paying, it returns HTTP 402 with payment requirements. The client signs a USDC payment and retries with a payment header.

No authentication needed to searchUSDC payments on BaseAuto-settle per request

Search the Bazaar

Find paid API services by keyword. No authentication or balance is required for searching.

npx awal@latest x402 bazaar search "weather"

Search Examples

npx awal@latest x402 bazaar search "weather"
Find weather-related paid APIs
npx awal@latest x402 bazaar search "sentiment analysis" -k 10
Search with more results
npx awal@latest x402 bazaar list --full
Browse all bazaar resources with full details
npx awal@latest x402 details https://example.com/api/weather
Check what an endpoint costs
Results are cached locally at ~/.config/awal/bazaar/ and auto-refresh after 12 hours.

Pay for a Service

Make a paid API request to an x402 endpoint with automatic USDC payment.

npx awal@latest x402 pay <url>

Payment Examples

npx awal@latest x402 pay https://example.com/api/weather
Make a GET request (auto-pays)
npx awal@latest x402 pay https://example.com/api/sentiment -X POST -d '{"text": "Hello"}'
Make a POST request with body
npx awal@latest x402 pay https://example.com/api/data --max-amount 100000
Limit max payment to $0.10

Pay Command Syntax

npx awal@latest x402 pay <url> [-X <method>] [-d <json>] [-q <params>] [-h <json>] [--max-amount <n>] [--json]
-X, --method
HTTP method (default: GET)
-d, --data
Request body as JSON string
-q, --query
Query parameters as JSON string
--max-amount
Max payment in USDC atomic units (see table below)
--json
Output as JSON

USDC Atomic Units

x402 uses USDC atomic units (6 decimals) for payments:

$1.00
1000000 units
$0.10
100000 units
$0.05
50000 units
$0.01
10000 units

Prerequisites (for paying)

  • Must be authenticated (npx awal@latest status to check)
  • Wallet must have sufficient USDC balance (npx awal@latest balance to check)