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

# x402 Payments

> Let a payment agent pay for metered APIs over HTTP 402, under a budget your customer sets, without ever holding a key

[x402](https://www.x402.org) is a protocol for paying for an HTTP request inside the request itself. A seller answers an unpaid request with `402 Payment Required` and machine-readable payment terms. The buyer signs a payment authorization and retries with it attached, and the seller's *facilitator* settles it on-chain.

With Dakota, a hosted [payment agent](/documentation/agentic-payments) pays those 402s from a Dakota-custodied wallet. Your application forwards the seller's terms, Dakota checks them against a budget your customer set and returns the signed payment header, and your application sends it to the seller. Nobody on your side holds a key.

<Info>
  **Beta.** x402 is in early access. Run it against the [sandbox](/documentation/testing) on Base Sepolia first.
</Info>

## How it differs from the rest of Agentic Payments

The rest of Agentic Payments schedules payments to payees your customer named in advance. x402 turns that model around:

|                                  | Scheduled payments                                                               | x402                                                                                                        |
| -------------------------------- | -------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| **Who is paid**                  | Named recipients, fixed when the mandate is signed                               | Whoever the seller's 402 names, discovered at request time                                                  |
| **What the customer authorizes** | A [mandate](/documentation/agentic-payments/mandate-signing) with per-payee caps | An [x402 mandate](/documentation/agentic-payments/x402/budgets-and-holds): a **budget** across every seller |
| **What Dakota produces**         | A transaction, sent when the payment fires                                       | A signed authorization; the seller's facilitator submits it                                                 |
| **Typical size**                 | Bills and payouts                                                                | Fractions of a cent to a few dollars, many times a day                                                      |
| **Wallet**                       | The customer's wallets                                                           | One dedicated [x402 wallet](#the-x402-wallet) per agent                                                     |

## The flow

```mermaid theme={null}
sequenceDiagram
    participant App as Your application
    participant Seller as Seller API
    participant Dakota as Dakota
    participant Fac as Seller's facilitator
    participant Chain as Base

    App->>Seller: GET /resource
    Seller-->>App: 402 Payment Required + payment terms
    App->>Dakota: POST /payment-agents/{id}/x402/signatures (the terms)
    Note over Dakota: Check the x402 mandate,<br/>record a hold, then sign
    Dakota-->>App: payment header (or 403 naming the limit)
    App->>Seller: GET /resource + payment header
    Seller->>Fac: verify and settle
    Fac->>Chain: transferWithAuthorization
    Seller-->>App: 200 + the resource
    Note over Dakota,Chain: Dakota reads the chain and marks the hold settled
```

The signature Dakota returns is an [EIP-3009](https://eips.ethereum.org/EIPS/eip-3009) `TransferWithAuthorization`: signed typed data, not a transaction. It costs the payer no gas, and the whole payment completes inside one HTTP round trip.

## Issuing a signature is spending money

Nothing downstream asks for approval. Whoever holds the signed authorization can settle it until it expires. That is why the [x402 mandate](/documentation/agentic-payments/x402/budgets-and-holds) is the control that matters, and why Dakota evaluates it and records a **hold** against the budget *before* any signature exists. A payment the mandate refuses is never signed.

It is also why x402 spend never appears as a wallet transaction: the seller's facilitator moves the money, not Dakota. The **holds** are the record of x402 spend. See [budgets & holds](/documentation/agentic-payments/x402/budgets-and-holds#holds).

## The x402 wallet

Each agent pays x402 from exactly one wallet, created when you [enable x402](/documentation/agentic-payments/x402/quickstart#1-enable-x402-on-the-agent) for the agent:

* **It can sign x402 payments and nothing else.** Any attempt to send funds from it is refused. That keeps it a plain account, the kind every x402 facilitator accepts.
* **It is funded by transfer.** Send USDC to its address on the network the agent pays on.
* **It is separate from the agent's other wallets.** It does not appear in the agent's `wallet_ids`, and no x402 request takes a wallet id: the agent's x402 wallet is the only one it pays x402 from.

## Objects

| Object           | What it is                                                                                                        | Lifecycle                               |
| ---------------- | ----------------------------------------------------------------------------------------------------------------- | --------------------------------------- |
| **x402 wallet**  | The agent's sign-only paying wallet. One per agent.                                                               | `provisioning` → `active`               |
| **x402 mandate** | The budget: a per-call ceiling, a rolling aggregate across all sellers, an optional call cap, and a payee policy. | valid from creation until `valid_until` |
| **Hold**         | One issued authorization and the budget it commits.                                                               | `outstanding` → `settled` or `released` |

## What's supported

|          |                                                                                                                                              |
| -------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| Asset    | **USDC only**. Terms in any other token are refused with a `403` naming the supported set.                                                   |
| Networks | Base (`base` / `eip155:8453`) and Base Sepolia (`base-sepolia` / `eip155:84532`)                                                             |
| Protocol | x402 **v1** and **v2**; the seller's 402 decides which. See [the quickstart](/documentation/agentic-payments/x402/quickstart#4-pay-the-402). |
| Scheme   | `exact`                                                                                                                                      |
| Agents   | Hosted payment agents that are `active`                                                                                                      |

## Next

<CardGroup cols={2}>
  <Card title="Quickstart" icon="bolt" href="/documentation/agentic-payments/x402/quickstart">
    Enable x402, fund the wallet, set a budget, and pay a 402.
  </Card>

  <Card title="Budgets & holds" icon="scale-balanced" href="/documentation/agentic-payments/x402/budgets-and-holds">
    Every mandate field, the payee policies, and how holds settle.
  </Card>
</CardGroup>
