# x402 payments

> Charge per API call in stablecoins with the x402 protocol. Cryptonly verifies and settles each payment, pays the network fee, and tracks every payment in the dashboard.

[x402](https://www.x402.org/) lets you charge for an API call over plain HTTP. Your API answers an unpaid request with `402 Payment Required` and a price. The buyer, often an AI agent, signs a stablecoin payment and retries. Cryptonly settles it on-chain, and your API returns the response.

<LinkButton href="/guides/x402/quickstart/" icon="right-arrow">Read the quickstart</LinkButton>
<LinkButton href="https://merchant.cryptonly.net/x402" variant="secondary" icon="external" target="_blank" rel="noopener noreferrer">Open dashboard</LinkButton>

## How it works

```mermaid
sequenceDiagram
    participant Buyer
    participant API as Your API
    participant Cryptonly
    participant Chain as Base or Solana
    Buyer->>API: GET /weather/paris
    API-->>Buyer: 402 Payment Required (price)
    Buyer->>API: GET /weather/paris + signed payment
    API->>Cryptonly: verify and settle
    Cryptonly->>Chain: transfer
    Cryptonly-->>API: settled
    API-->>Buyer: 200 OK + response
```

Cryptonly is the **facilitator**: it checks the signed payment, sends it to the network and pays the network fee.

  <Card title="No gas for buyers" icon="rocket">
    Buyers hold only stablecoins. Cryptonly pays the ETH or SOL for the transfer.
  </Card>
  <Card title="Paid to your wallet" icon="approve-check-circle">
    Payments go straight to your own wallet, or on Base to your Cryptonly balance.
  </Card>
  <Card title="Prices without deploys" icon="setting">
    Set prices in the dashboard and change them at any time. Or keep them in code.
  </Card>
  <Card title="Every payment tracked" icon="list-format">
    Payment history, CSV export and webhooks for each call.
  </Card>

## Networks and assets

<X402Networks />

Choose which assets you accept under **Settings → General → Accepted assets**. An endpoint priced in the dashboard can have a price in each of them; its 402 offers them all. The [sandbox](https://docs.cryptonly.net/guides/sandbox-environment.md) uses Base Sepolia (`eip155:84532`) and Solana Devnet (`solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1`).

## Pricing

The first 100 payments each month are free. After that, each payment costs $0.0025. See [how fees are paid](https://docs.cryptonly.net/guides/x402/payouts-and-fees.md#fees).

## Get started

- [Prices in the dashboard](https://docs.cryptonly.net/guides/x402/quickstart.md): Recommended. Quickstart for Express, Fastify or NestJS, from wallet to first payment.
- [Prices in your code](https://docs.cryptonly.net/guides/x402/prices-in-code.md): NestJS, or stock x402 middleware for Express, Fastify, Hono, Next.js, FastAPI, Flask or Go.

## Related pages

- [Invoices for AI agents](https://docs.cryptonly.net/guides/invoices/ai-agents.md): Let agents pay your invoices with x402
- [x402 API reference](https://docs.cryptonly.net/api-reference/openapi/operations/x402supported/): supported, config, verify, settle and settlements
