Overview
Make a paid API request to an x402 endpoint with automatic USDC payment. Use when you or the user want to call a paid API, make an x402 request, or use a paid service. Use search-for-service first to find available endpoints.Prerequisites
- Must be authenticated (
npx awal@latest statusto check) - Wallet must have sufficient USDC balance (
npx awal@latest balanceto check)
Confirming wallet status
Command syntax
Options
| 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 |
USDC amounts
x402 uses USDC atomic units (6 decimals):| Atomic Units | USD |
|---|---|
| 1000000 | $1.00 |
| 100000 | $0.10 |
| 50000 | $0.05 |
| 10000 | $0.01 |
Examples
Error handling
| Error | Resolution |
|---|---|
| ”Not authenticated” | Run npx awal@latest auth login <email> first |
| ”No X402 payment requirements found” | URL may not be an x402 endpoint; use search-for-service to find valid endpoints |
| ”Insufficient balance” | Fund wallet with USDC; see fund skill |