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

# X402 Payments

> Multi-chain, multi-asset x402 payments — Agent Wallet's implementation of the x402 protocol for autonomous agent commerce.

Agent Wallet implements [x402 specification v2](https://www.x402.org/) — the open protocol for machine-to-machine stablecoin payments over HTTP. This page covers what Agent Wallet provides and how it differs from other x402 implementations. For a full protocol explainer, see the [x402 official documentation](https://www.x402.org/).

## What Agent Wallet Provides

Most x402 implementations support a single stablecoin on a single chain (typically USDC on Base). Agent Wallet supports **multiple assets across multiple chains**:

| Stablecoin | Supported Chains        |
| ---------- | ----------------------- |
| **USDC**   | Base                    |
| **FDUSD**  | BSC, Arbitrum, Ethereum |

<Info>
  **Coming soon:** FDUSD support on SUI.
</Info>

Your agent's wallet needs to hold the required stablecoin on the chain the merchant accepts. When a merchant supports multiple options, the wallet selects the best match from what's available in your balance.

## x402 Tools

Agent Wallet provides two tools for x402 payments, available through both the [CLI](/agent-wallet/ai-integration/cli) and the [MCP server](/agent-wallet/ai-integration/mcp-server). Which one to use depends on the agent's environment and capabilities.

### authorizePayment (Recommended)

Signs the payment authorization only — the agent handles the HTTP communication with the resource server itself.

**How it works:**

1. Agent calls the resource server and receives HTTP `402 Payment Required` with payment requirements (`accepts[]` array with chain, token, amount, recipient)
2. Agent passes the requirements to `authorizePayment` — the wallet selects the best payment option from the agent's balance and signs an [EIP-3009](https://eips.ethereum.org/EIPS/eip-3009) `transferWithAuthorization`
3. Agent retries the original request with the signed `PaymentPayload` attached
4. The resource server's facilitator verifies and settles the payment on-chain

This gives the agent **maximum autonomy**. The agent understands what's happening at each step, makes its own decisions about whether to pay, and handles the HTTP communication directly. The wallet's role is limited to what it should be: signing the payment authorization.

<Note>
  EIP-3009 means the payment is **gasless for the payer** — the facilitator executes the on-chain transfer, not the agent's wallet.
</Note>

When using the [Finance District CLI Skills](/agent-wallet/ai-integration/agent-skills), the skill teaches the agent the full x402 protocol flow and guides it to use `authorizePayment` at the right step.

### getX402Content (Fallback)

Bundles the entire x402 flow — initial HTTP request, authorization signing, and retry — into a single call. The agent provides the resource URL, and the wallet handles everything internally.

Use this when the agent **cannot make HTTP requests directly** (e.g. web-based AI assistants like Claude Desktop or Cursor that have MCP access but cannot execute shell commands or make outbound HTTP calls).

### Choosing the Right Tool

| Tool                 | Agent handles HTTP | Best for                                                                             |
| -------------------- | ------------------ | ------------------------------------------------------------------------------------ |
| **authorizePayment** | Yes                | Agents with HTTP access — Claude Code, OpenClaw, autonomous agents, agent frameworks |
| **getX402Content**   | No                 | Agents without HTTP access — Claude Desktop, Cursor, web-based assistants            |

## Try It Out

**With `authorizePayment`:**

> "Access the premium data API at [https://api.example.com/market-data](https://api.example.com/market-data)"

The agent handles the 402 response, requests payment signing from the wallet, and retries with proof.

**With `getX402Content`:**

> "Pay for the API at [https://api.example.com/market-data](https://api.example.com/market-data)"

The wallet handles the full flow and returns the content.

**Direct payment:**

> "Pay 2 USDC to 0xABC...123 on Base"

The agent can also make explicit payments to known addresses without encountering a 402 flow.

## Agent Wallet + Prism

X402 is where the two Finance District products meet:

* **Agent Wallet** is the buyer side — your agent has funds and wants to pay for services
* **[Prism](/prism/overview)** is the seller side — merchants accept stablecoin payments from AI agents

When an Agent Wallet pays a Prism merchant via x402, the transaction stays within one ecosystem. The agent pays, Prism verifies, the merchant gets their funds.

<CardGroup cols={2}>
  <Card title="Prism Overview" icon="store" href="/prism/overview">
    Learn how merchants accept agent payments
  </Card>

  <Card title="X402 Protocol" icon="file-code" href="/prism/integrations/x402">
    How Prism implements x402 on the merchant side
  </Card>

  <Card title="CLI Skills" icon="wand-magic-sparkles" href="/agent-wallet/ai-integration/agent-skills">
    Install the skills that teach agents x402
  </Card>

  <Card title="x402.org" icon="globe" href="https://www.x402.org/">
    Official x402 protocol specification
  </Card>
</CardGroup>
