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

# x402 payments: Sella's USDC micropayment handshake

> x402 extends HTTP 402 into a full micropayment handshake: challenge, sign, settle in USDC on-chain. Every paid Sella call uses this protocol.

x402 extends the HTTP `402 Payment Required` status into a full micropayment handshake. It lets an agent pay for a resource inline — no checkout page, no human, no stored card. Sella uses x402 for dataset purchases, Cradle and Mergekit jobs, and [API Data Market](/consumers/api-market) calls.

## The four-step flow

Every paid call follows the same four-step pattern. Your agent handles steps three and four; Sella handles the rest.

<Steps>
  <Step title="Request">
    Your agent calls a paid resource with no payment attached — just the normal request with your Bearer token.
  </Step>

  <Step title="Challenge">
    The server responds with HTTP `402` and a `PAYMENT-REQUIRED` payload that describes exactly what to pay, to which address, on which chain, and by when.
  </Step>

  <Step title="Sign">
    Your agent signs the challenge locally with its wallet key, producing a `PAYMENT-SIGNATURE`. The key never leaves your machine.
  </Step>

  <Step title="Retry & settle">
    Your agent retries the request with the signature attached. The server verifies the signature and settles the payment on-chain through the facilitator, then returns the resource.
  </Step>
</Steps>

## Anatomy of a challenge

When a paid resource returns `402`, the response body is a JSON challenge object. Here is a representative example:

```json theme={null}
{
  "x402Version": 2,
  "accepts": [
    {
      "network": "base",
      "priceInAtomicUnits": "45000000",
      "payTo": "0x…SellaVault",
      "expiresAt": "2026-07-02T21:00:00Z"
    }
  ]
}
```

<ResponseField name="x402Version" type="number">
  Protocol version. `2` is current and preferred.
</ResponseField>

<ResponseField name="accepts" type="array">
  One or more acceptable payment options. Each option specifies a chain, amount, recipient address, and expiry. Pick one option and sign it.
</ResponseField>

<ResponseField name="network" type="string">
  The settlement chain for this option, e.g. `base`, `solana`, or `stellar`.
</ResponseField>

<ResponseField name="priceInAtomicUnits" type="string">
  The amount in the token's smallest denomination. Divide by the token's decimals to get the human figure — for example, `45000000` equals 45 USDC at 6 decimals.
</ResponseField>

<ResponseField name="payTo" type="string">
  The recipient wallet address for this payment option.
</ResponseField>

<ResponseField name="expiresAt" type="string">
  ISO 8601 timestamp after which this challenge is no longer valid. If you miss it, request a fresh `402` and sign the new challenge.
</ResponseField>

<Warning>
  Always read the chain, amount, and recipient from the live challenge. Never hard-code these values — they vary per listing and per option.
</Warning>

## Versions and headers

x402 has two versions. Use v2 for all new integrations.

<CardGroup cols={2}>
  <Card title="v2 (preferred)" icon="circle-check" href="/reference/mcp-tools">
    Supply a `PAYMENT-SIGNATURE` header in direct HTTP calls. In MCP tool calls, pass the base64-encoded signature as the `payment_signature` argument.
  </Card>

  <Card title="Legacy v1" icon="clock" href="/reference/mcp-tools">
    `X-PAYMENT` and `X-PAYMENT-RESPONSE` headers are still accepted for older clients — mapped to the `x_payment` and `payment_proof` MCP arguments respectively.
  </Card>
</CardGroup>

## Supported chains

Sella's chain-agnostic router selects the appropriate settlement chain per product. The `402` challenge always tells you which chain to use for that specific call.

| Chain                 | Status                    |
| --------------------- | ------------------------- |
| Base, Solana, Stellar | Live                      |
| Ethereum, Tempo       | Preview (API Data Market) |
| Sui, Aptos            | Planned                   |

All settlements are denominated in **USDC**, regardless of the underlying chain.

## MPP

The [API Data Market](/consumers/api-market) also supports **MPP** for pay-per-call flows, settled via the `mpp/pay` proxy route — often on Tempo. The runtime MPP challenge is authoritative for price, just like a `402` challenge.

## Settlement and fees

Sella verifies and settles payments through an x402 **facilitator**. On paid marketplace listings, a **3% platform fee** is split to a per-chain treasury at settlement time. The remainder goes directly to the publisher's wallet in USDC.

## Security

x402 is designed so that neither Sella nor any other party can fabricate or replay a payment on your behalf.

<CardGroup cols={2}>
  <Card title="Nonce + expiry" icon="timer" href="/reference/glossary">
    Each payment carries a unique nonce and an expiry timestamp. This prevents any signed payload from being replayed after it has settled.
  </Card>

  <Card title="Local signing" icon="lock" href="/consumers/authentication">
    Your wallet key signs the challenge on your machine. The private key never transits Sella — only the resulting signature is sent.
  </Card>
</CardGroup>
