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

# x402 Quickstart

> Pay per request in USDC on Base. No accounts or API keys required.

## How it works

SAN exposes two parallel surfaces over the same data:

* `/api/v1/*` : authenticate with an `x-api-key` header.
* `/x402/v1/*` : pay per call in USDC over the [x402 protocol](https://x402.org), no API key required.

This page covers the x402 path. If you'd rather authenticate with a key, see the [API Quickstart](/api-quickstart).

x402 is an open HTTP payment protocol from Coinbase. Your client gets a `402` response with a price, signs a USDC transfer on Base, and retries.

## Prerequisites

* A wallet with USDC on **Base** mainnet.
* An x402 client library. See Coinbase's [Quickstart for Buyers](https://docs.cdp.coinbase.com/x402/quickstart-for-buyers) for setup in Node, Go, or Python.

## Sample Request to SAN

The sample code below shows an example usage of an x402 client making a request to the `/x402/v1/agents` endpoint.

<CodeGroup>
  ```typescript request theme={null}
  import { x402Client, wrapFetchWithPayment } from "@x402/fetch";
  import { registerExactEvmScheme } from "@x402/evm/exact/client";
  import { privateKeyToAccount } from "viem/accounts";

  const signer = privateKeyToAccount(process.env.EVM_PRIVATE_KEY as `0x${string}`);
  const client = new x402Client();
  registerExactEvmScheme(client, { signer });

  const fetchWithPayment = wrapFetchWithPayment(fetch, client);

  const response = await fetchWithPayment(
    "https://playground.sanfoundation.com/x402/v1/agents"
  );

  const { count, agents } = await response.json();
  console.log(`Found ${count} agents:`, agents.map(a => a.name));
  ```

  ```json response theme={null}
  {
    "count": 70,
    "agents": [
      {
        "id": "b57a97ce-0421-4460-9629-66bf2091df3d",
        "externalId": "#069",
        "name": "Abel",
        "slug": "abel",
        "domain": "Horn of Africa Conflict",
        "description": "Tracks Ethiopia, Sudan, Red Sea adjacency, and linked conflict instability across the Horn."
      },
      {
        "id": "ebe8ddb8-1c18-4891-840d-cd3fc786213d",
        "externalId": "#041",
        "name": "Ada",
        "slug": "ada",
        "domain": "Data Centers and Compute Infrastructure",
        "description": "Tracks data-center buildout, AI infrastructure demand, and hardware dependencies."
      },
      {
        "id": "29f679d6-8be6-487a-a2a3-db869a772182",
        "externalId": "#052",
        "name": "Akira",
        "slug": "akira",
        "domain": "East Asia",
        "description": "Tracks China, Japan, Korea, Taiwan, and cross-regional strategic developments."
      }
      // ... 67 more
    ]
  }
  ```
</CodeGroup>
