# Payments

Last updated: 2026-10-15

Paid routes use x402 version 2. You pay per call in USDC; there is no account, key or sign-up.

## Network

| Item | Value |
|---|---|
| Protocol | x402 v2, scheme `exact` |
| Networks | Base Sepolia (a test network). The 402 lists every rail, the primary first; pay on any one. |
| Asset | USDC on each rail, the same price on all |
| Facilitator | PayAI (`facilitator.payai.network`). On mainnet there is no fallback; x402.org is the fallback on testnet only |

The live offer is `eip155:84532`, Base Sepolia (a test network): payments use free test USDC from a faucet, and no real money moves.

USDC on a main network is real money: each paid call is charged. A payment is settled on the rail you signed it for; the paying address and the receipt's `payment.network` show which.

## Prices

| Route | Price per call |
|---|---|
| `POST /v1/verify/quote` | US$0.01 |
| `POST /v1/verify/quotes` | US$0.02 per call of 1 to 20 quotes on one page (less than one verify/quote call each from 3 quotes up) |
| `POST /v1/verify/text-quote` | US$0.005 per call, for text you already hold (nothing is fetched) |
| `POST /v1/verify/citations` | US$0.10 per batch |
| `POST /v1/verify/document` | US$0.10 per part of up to 10 pairs |
| `POST /v1/fetch` | US$0.002 per URL: `urls` with up to 10 URLs costs US$0.002 times the count |
| `POST /v1/recheck` | US$0.003 per re-check of one page |
| `POST /v1/check/links` | US$0.005 per batch |
| `POST /v1/check/packages` | US$0.005 per batch |
| `POST /v1/attest` | US$0.002 |

## Flow

1. Send the request with no payment header.
2. If the request is valid, you get `402 Payment Required`. A request with an empty body (or `{}`) gets the same 402, so a directory or client can read the price before it has a real input; anything else that fails validation gets 400. The `PAYMENT-REQUIRED` header (base64 JSON) holds the offer: amount, asset, network, pay-to address and a description of the route. The body is a JSON error with code `payment_required`.
3. Sign the offer with your wallet and send the same request again with the signed payment in the `PAYMENT-SIGNATURE` header.
4. We verify the payment with the facilitator, run the route, and settle the payment only if the route answers with a status below 400. A settled call carries a `PAYMENT-RESPONSE` header.

Any x402 v2 client library handles steps 2 and 3. The offer also carries Bazaar discovery data (input and output schemas).

## Pay from code

Install the x402 client at the versions this service uses:

```sh
npm install @x402/fetch@2.28.0 @x402/evm@2.28.0 viem@2.57.4
```

[fetch-x402](/docs/examples/fetch-x402) (Node) and [python-x402](/docs/examples/python-x402) (Python) each make one paid call step by step. Both sign for the network in `ATTESTPAGE_NETWORK` (default Base, `eip155:8453`), so set it to another network the 402 lists to pay there. The wallet needs USDC on Base Sepolia (a test network); no ETH, the facilitator pays the gas. Get test USDC before you pay: (1) make a key, 0x plus 64 hex characters, and set `ATTESTPAGE_X402_KEY`; (2) get its address with `privateKeyToAccount(key).address`; (3) free test USDC for Base Sepolia comes from the Run402 faucet, `POST https://api.run402.com/faucet/v1` with the JSON body `{"address": "<your wallet address>"}`, 0.25 USDC per drip (25 calls at 0.01 USDC each), one drip per wallet and IP every 24 hours (source: operation `faucetDrip` in https://run402.com/openapi.json, checked 18 Oct 2026); no key or account is needed.

## When you are charged

- **Never charged:** a request that fails validation (400, before any 402; a paid retry is validated again before the payment is used), a blocked or disallowed URL, a host name that does not resolve, rate limits, refused payers, and any answer with status 400 or above.
- **Charged:** any answer below 400. This includes results about the target page that you may not like: a 404, a bot wall, a timeout. That result is what the call checks.
- **Retries:** if your payment carries a payment id (the x402 `payment-identifier` extension) and you resend the same request with the same id within one hour, you get the stored response again, marked `idempotent-replayed: true`, and are not charged twice. Reusing a payment id for a different request gets 409 `payment_id_conflict`.
- **Settle failures:** if a call ends in 502 `settle_failed`, resend the same request with the same payment id. If the payment went through on chain after all, you get the withheld result, marked `payment-redelivered: true`, without paying again. If it did not, the same signed payment is settled at most once; a new signature for that id gets 409 `settle_pending` until the first one expires (see `Retry-After`). This needs a payment id: without one, a charge that went through is recorded for reconciliation, and the result is not sent. Redelivery is a full-service feature: the edge server cannot match a resend across its instances. Here the withheld result is kept in memory for an hour (and at least until its payment has expired), so a server restart also loses it; a resend of the same signed payment is then still never charged twice.
- **Charged, result lost (`result_lost`):** the same on every rail. If a charge went through and we can no longer deliver the result (the kept result expired before a resend, or was not kept), we record it as `result_lost` and check it on that rail's chain. We record the refund as due, and a person pays it by hand in USDC to the paying address on the same rail. Contact no contact address is set on this server; the robots.txt opt-out works without one with the transaction id to ask about it.

## Lightning (L402)

Lightning (L402) is not enabled on this server. The sats prices in [pricing.json](https://s2h6qt73jtzlgbgnnfacln2poq.srv.us/pricing.json) are for when it is.

## Prepaid credits (Bitcoin signet)

Prepaid credit keys (Bitcoin signet) are not enabled on this server. Where they are on (full service only), this section explains how to buy and spend one.

## Free trial

There is no free trial at the moment; use the free samples instead.

## Sanctions screening

Paying addresses are checked against a public sanctions list. A listed address gets 403 `payer_refused` and its payment is not settled.

## Receipts

A paid receipt records the payment: rail, network, asset, amount, paying address and payment id (for L402: the payment hash and preimage instead of an address and id). See [How it works](/docs/how-it-works).
