> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentaos.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# x402 Payments

> Pay for 402-protected resources from your sub-account.

# x402 Payments

AI agents can discover, check, and pay for x402-protected APIs.

## Check

```bash theme={null}
agenta sub x402 check <url>
```

Returns `requires402`, payment options (scheme, network, amount, asset).

## Discover

```bash theme={null}
agenta sub x402 discover <domain>
```

Probes a domain for all x402 endpoints.

## Fetch & Pay

```bash theme={null}
agenta sub x402 fetch <url>
agenta sub x402 fetch <url> --max-amount 1000000
```

Automatically pays and returns the response. `--max-amount` caps spending in atomic units (1000000 = 1 USDC).

Returns: `paid`, `transaction`, `status`, `body`.
