# x402 Payments and Stripe MPP for AI Agents

> Let your AI agent top up its own QuanticData balance: x402 with USDC on Base, or Stripe MPP with a card in Link. From $3 a time: setup, limits and code.

[Home](https://quanticdata.io/) / [For AI agents](https://quanticdata.io/for-agents/) / Agent payments

# x402 payments and Stripe MPP: let your AI agent top up its own balance

When your QuanticData balance runs out, the API answers 402 with two ways to pay that an AI agent can use without you: x402, a USDC payment on Base signed from a wallet, and Stripe's Machine Payments Protocol (MPP), a one-time token on your card in Link. Either one adds credit to the balance of your API key: $3 to $500 with x402, $5 to $500 with MPP.

By [Aldo Morese](https://quanticdata.io/about/), founder of QuanticData · Published Oct 30, 2026

[Get my free API key](https://app.quanticdata.io/register?utm_source=agent-payments&utm_medium=website&utm_campaign=site&utm_content=agent-payments-hero) · [Everything for agents](https://quanticdata.io/for-agents/)

$2 of free API usage per month · No card required · Failed calls are never billed

a call with an empty balance · 30 Oct 2026

```
POST https://api.quanticdata.io/v1/serp
Authorization: Bearer qd_live_…
→ 402 INSUFFICIENT_FUNDS · nothing run, nothing charged
  PAYMENT-REQUIRED   x402 · 5 USDC on Base
  WWW-Authenticate   Payment method="stripe" · $5 + 22% VAT
# the agent pays one offer and repeats the same call
→ 200 the search · X-X402-Topup: 5.00
  the call is billed from the balance at list price
```

![A call to the QuanticData API with an empty balance answers HTTP 402 with two offers, x402 for 5 USDC on Base and Stripe MPP for $5 of credit plus 22% VAT; the AI agent pays one of them, the credit lands on the balance of its API key and the same call runs at list price.](https://quanticdata.io/for-agents/x402-payments/diagram.webp?v=20261030a)

*One 402, two ways to pay: the agent tops up the balance of its key and repeats the call.*

**From $3** of credit per top-up with x402, $5 with MPP, up to $500

**2 ways** · USDC on Base (x402) or a card through Stripe (MPP)

**0% VAT** · on USDC; 22% on card, on a numbered invoice

**1 key** · the same API key, the same balance

On this page

- [x402 and MPP in one line](https://quanticdata.io/for-agents/x402-payments/#what-they-are)
- [Why turn it on](https://quanticdata.io/for-agents/x402-payments/#why)
- [What you need](https://quanticdata.io/for-agents/x402-payments/#what-you-need)
- [Set up x402](https://quanticdata.io/for-agents/x402-payments/#setup-x402)
- [Set up MPP](https://quanticdata.io/for-agents/x402-payments/#setup-mpp)
- [Limits, VAT, invoices](https://quanticdata.io/for-agents/x402-payments/#limits)
- [See it and stop it](https://quanticdata.io/for-agents/x402-payments/#control)
- [For developers](https://quanticdata.io/for-agents/x402-payments/#developers)
- [x402 code](https://quanticdata.io/for-agents/x402-payments/#x402-code)
- [MPP code](https://quanticdata.io/for-agents/x402-payments/#mpp-code)
- [Errors](https://quanticdata.io/for-agents/x402-payments/#errors)
- [FAQ](https://quanticdata.io/for-agents/x402-payments/#faq)

## x402 and MPP, in one sentence each

Both are open protocols built on the HTTP status 402 Payment Required: the server says what to pay, the client pays and repeats the request. On QuanticData they do one thing only: they add credit to the balance of the API key that made the call. They never buy a single call and never change a price.

- **x402** is an open payment protocol, published by Coinbase and maintained by the x402 Foundation: your agent signs a USDC payment from its own wallet, and QuanticData settles it on the Base network.
- **MPP**, the Machine Payments Protocol, is the open standard Stripe and Tempo published for agent payments over HTTP: QuanticData accepts it with Stripe Shared Payment Tokens, a one-time permission, capped to one amount, to charge your card in Link.

|  | x402 | MPP (Stripe) |
| --- | --- | --- |
| Pays with | USDC on Base, from a wallet the agent can sign with | a Shared Payment Token on your card in Link |
| Credit per top-up | $3 to $500 | $5 to $500 |
| VAT | none, paid in crypto | 22% on top, as on every card top-up |
| Your approval | none: the cap you set in the client and the wallet balance are the limits | with Link, one tap in its app for each payment |
| Network fee | paid by QuanticData | none |

## Why you would turn it on

- **The agent does not stop at an empty balance.** A job that runs overnight keeps going: the top-up and the call happen in the same request, and the call is billed at list price like any other.
- **No card form, no dashboard.** Nobody opens a checkout page: the payment travels as a header on the API request the agent was already making.
- **Pay in USDC if you prefer.** x402 takes USDC on Base, with no VAT and no card, and the wallet needs nothing else: QuanticData pays the network fee.
- **You keep the limits.** A cap per payment in the client, a monthly budget on the account and a key you can revoke, all explained [below](https://quanticdata.io/for-agents/x402-payments/#control).
- **The free tier comes first.** Every account has $2 of free API usage a month; the 402 appears only when that and the balance together cannot cover the next call.

## What you need

|  | x402 | MPP |
| --- | --- | --- |
| A QuanticData API key | yes, from the [API keys page](https://app.quanticdata.io/api-keys) or the agent's [own registration](https://quanticdata.io/tutorials/agent-self-registration/) | yes, the same |
| Money | USDC on the Base network, in a wallet the agent can sign with | a card saved in your Link wallet |
| Software | an x402 client: `@x402/fetch` for TypeScript, `x402` for Python | Stripe's Link CLI, or an agent platform that issues Shared Payment Tokens |
| ETH for gas | no: QuanticData pays the network fee | not needed |

Give the agent a wallet of its own and keep in it only what you are happy for it to spend. Its private key lives where the agent runs, in an environment variable next to the API key, never in code, logs or chat.

## Set up x402 in five steps

1. **Get an API key.** Create one on the [API keys page](https://app.quanticdata.io/api-keys), or let the agent [register itself](https://quanticdata.io/tutorials/agent-self-registration/) with your email. The key decides which balance is topped up.
2. **Fund a wallet with USDC on Base.** Send USDC on the Base network, not on Ethereum mainnet, to the wallet the agent will use, and put its private key in the agent's environment, for example `WALLET_PRIVATE_KEY` next to `QD_API_KEY`. No ETH is needed.
3. **Give the agent an x402 client with a cap.** Install `@x402/fetch` or the Python `x402` package and wrap the HTTP client the agent already uses, as in the [code below](https://quanticdata.io/for-agents/x402-payments/#x402-code). Set the cap per payment: both clients refuse anything above $1 by default, and a QuanticData top-up starts at $5, so $20 is a sensible first cap.
4. **Let it run.** When the balance is short, the call answers 402, the client signs the amount offered, repeats the call and returns the result. To top up ahead of time instead, the agent sends `POST /v1/billing/x402-topup` with `{"amount_usd": 20}`.
5. **Check the first payment.** The credit shows on the balance in the dashboard, the invoice, with no VAT, reaches the account's email, and the response header `PAYMENT-RESPONSE` carries the Base transaction hash.

## Set up MPP in four steps

The simplest way to hold Shared Payment Tokens yourself is Link, Stripe's wallet, through its command-line tool. An agent platform that issues the tokens for you works the same way from step 3.

1. **Get an API key.** The same as for x402: the payment tops up the balance of the key that made the call.
2. **Sign in to Link where the agent runs.** Run `npx @stripe/link-cli auth login`, keep a card in your [Link wallet](https://app.link.com/wallet) and the Link app on your phone for approvals.
3. **Let the agent pay through the Link CLI when the balance is short.** `npx @stripe/link-cli mpp pay` sends the call with the API key, reads the 402, asks Link for a token of the exact amount ($6.10 for $5 of credit with VAT), sends you a request to approve in the Link app, then pays and repeats the call. The command is in the [code below](https://quanticdata.io/for-agents/x402-payments/#mpp-code).
4. **Check the invoice.** A numbered invoice with 22% VAT is emailed to the account, and the credit appears on the balance with the Stripe payment reference.

Link asks you to approve each request within 30 minutes, and each token pays once: the next top-up is a new request.

## Limits, VAT and invoices

Both ways buy the same thing, credit on the prepaid balance of your account, which does not expire. The call is then billed from it at the published price, and a failed call is not billed.

|  | x402 (USDC on Base) | MPP (Stripe) |
| --- | --- | --- |
| Credit per top-up | $3 to $500 | $5 to $500 |
| Amount offered on a 402 | the shortfall rounded up to the whole dollar, at least $5 | $5, or the shortfall rounded up to the cent if larger |
| VAT | 0%, paid in crypto | 22% on top: $5 of credit costs $6.10 |
| Invoice | emailed to the account, no VAT | numbered, emailed to the account, 22% VAT |
| Offer valid for | 60 seconds to sign it | 5 minutes, single use |
| Paid twice by mistake | not possible: each signed transfer is credited once | not possible: each challenge is used once |
| Above $500 | no offer: top up on the dashboard, or write to hello@quanticdata.io | the same |

An account can pay up to 30 MPP top-ups a minute and 2,000 a day. Unit prices for every call are on the [pricing page](https://quanticdata.io/pricing/) and in [llms.txt](https://quanticdata.io/llms.txt).

## See every top-up, and stop it when you want

- **See it.** Every top-up is a row in the balance history and an invoice on the [invoices page](https://app.quanticdata.io/invoices), and the same invoice is emailed to the account. The agent gets the Base transaction hash (x402) or the Stripe payment reference (MPP) in the response.
- **Cap each payment.** The x402 client refuses any offer above the cap you set in it; Link asks you to approve every MPP payment.
- **Cap the month.** In [Billing](https://app.quanticdata.io/billing), under Spend controls, set a monthly Data API budget with the hard stop on. Once it is reached the API answers 402 `BUDGET_REACHED`, which carries no payment offer, so the agent cannot top up again until next month or until you raise it.
- **Get an alert.** The same Spend controls send an email, or a webhook, when the balance falls under the amount you choose.
- **Stop everything.** Revoke the key on the [API keys page](https://app.quanticdata.io/api-keys): the agent can no longer call, and no payment can be credited without a valid key. For x402 you can also empty the agent's wallet; for MPP, remove the card from Link.

## For developers: one 402, two offers

Every call made with an API key that answers 402 `INSUFFICIENT_FUNDS` carries both offers, as long as the shortfall is at most $500. The body is the usual error envelope; the offers travel in two headers, `PAYMENT-REQUIRED` for x402 and `WWW-Authenticate: Payment` for MPP.

```bash
curl -i https://api.quanticdata.io/v1/serp \
  -H "Authorization: Bearer $QD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":"best espresso grinder","engine":"google","country":"us"}'

HTTP/2 402
payment-required: eyJ4NDAyVmVyc2lvbiI6Mi…        # x402 version 2, base64 JSON
www-authenticate: Payment id="…", realm="api.quanticdata.io", method="stripe", intent="charge",
  request="eyJhbW91bnQiOiI2MTAi…", expires="…", description="…", opaque="…"

{"type":"error","message":"Your free tier for this month is used up …",
 "payload":{"code":"INSUFFICIENT_FUNDS","estimated_cost":0.002,"balance":0,"free_remaining":0}}
```

Decoded, `PAYMENT-REQUIRED` holds one `exact` requirement in USDC base units (6 decimals). `payTo` is QuanticData's own wallet: read it from the offer, never hardcode it.

```
{
  "x402Version": 2,
  "resource": { "url": "https://api.quanticdata.io/…", "serviceName": "QuanticData Data API", … },
  "accepts": [{
    "scheme": "exact",
    "network": "eip155:8453",
    "asset": "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
    "amount": "5000000",
    "payTo": "0x…",
    "maxTimeoutSeconds": 60,
    "extra": { "name": "USD Coin", "version": "2" }
  }]
}
```

You can see a real offer now, without a key or a wallet: the top-up endpoint answers 402 with the requirements for the amount you ask. We ran it on 30 October 2026; a payment sent without a key is refused with 401 before anything is charged.

```bash
curl -i -X POST https://api.quanticdata.io/v1/billing/x402-topup \
  -H "Content-Type: application/json" -d '{"amount_usd":20}'

HTTP/2 402
payment-required: eyJ4NDAyVmVyc2lvbiI6Mi…        # accepts[0].amount "20000000" = 20 USDC

{"x402Version":1,"error":"Pay $20 in USDC on eip155:8453 and retry this request with the payment
 header and Authorization: Bearer <API key> (the key whose balance is topped up)","accepts":[…]}
```

x402

## x402 in TypeScript and Python

The reference x402 clients wrap the HTTP client: on a 402 they sign the offer, an EIP-3009 `transferWithAuthorization` of the amount to `payTo`, and repeat the request with `PAYMENT-SIGNATURE`, keeping your `Authorization` header. We ran both on 30 October 2026 with `@x402/fetch` 2.29.0 and `x402` 2.26.0. Set the cap: by default they refuse more than $1.

TypeScript:

```typescript
// npm i @x402/fetch @x402/evm viem
import { wrapFetchWithPaymentFromConfig, decodePaymentResponseHeader } from "@x402/fetch";
import { ExactEvmScheme } from "@x402/evm";
import { privateKeyToAccount } from "viem/accounts";

const wallet = privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`);
const fetchWithTopup = wrapFetchWithPaymentFromConfig(fetch, {
  schemes: [{ network: "eip155:8453", client: new ExactEvmScheme(wallet) }], // Base
  spendControls: { maxAmountPerPayment: "$20" }, // default $1; a top-up starts at $5
});

// any call: when the balance is short, the client pays the top-up offered and repeats it
const res = await fetchWithTopup("https://api.quanticdata.io/v1/serp", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.QD_API_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({ query: "best espresso grinder", engine: "google", country: "us" }),
});
console.log(res.status, res.headers.get("X-X402-Topup"), res.headers.get("X-Balance-After-Topup"));
const receipt = res.headers.get("PAYMENT-RESPONSE");
if (receipt) console.log("Base tx", decodePaymentResponseHeader(receipt).transaction);
```

Python:

```python
# pip install "x402[requests,evm]"
import os
from eth_account import Account
from x402 import x402ClientSync
from x402.mechanisms.evm import EthAccountSigner
from x402.mechanisms.evm.exact import ExactEvmScheme
from x402.http.clients import x402_requests

wallet = EthAccountSigner(Account.from_key(os.environ["WALLET_PRIVATE_KEY"]))
client = x402ClientSync()
client.register("eip155:8453", ExactEvmScheme(wallet))  # Base
client.set_spend_controls({"max_amount_per_payment": "$20"})  # default $1; a top-up starts at $5

session = x402_requests(client)
# top up ahead of time; any other call on this session pays its own 402 the same way
r = session.post(
    "https://api.quanticdata.io/v1/billing/x402-topup",
    headers={"Authorization": f"Bearer {os.environ['QD_API_KEY']}"},
    json={"amount_usd": 20},
)
print(r.status_code, r.headers.get("X-X402-Topup"), r.headers.get("X-Balance-After-Topup"))
```

Raw HTTP:

```bash
# 1. read the offer (base64 JSON in the PAYMENT-REQUIRED header)
curl -s -D - -o /dev/null -X POST https://api.quanticdata.io/v1/billing/x402-topup \
  -H "Authorization: Bearer $QD_API_KEY" -H "Content-Type: application/json" \
  -d '{"amount_usd":20}' | grep -i '^payment-required:' | cut -d' ' -f2 | tr -d '\r' | base64 -d

# 2. sign an EIP-3009 transferWithAuthorization of accepts[0].amount to accepts[0].payTo
#    EIP-712 domain: name "USD Coin", version "2", chainId 8453, verifyingContract = accepts[0].asset
#    and base64 the x402 PaymentPayload { x402Version: 2, accepted, payload: { signature, authorization } }

# 3. repeat the same request with the payment and the key
curl -s -i -X POST https://api.quanticdata.io/v1/billing/x402-topup \
  -H "Authorization: Bearer $QD_API_KEY" -H "PAYMENT-SIGNATURE: $PAYMENT" \
  -H "Content-Type: application/json" -d '{"amount_usd":20}'

HTTP/2 200
payment-response: eyJzdWNjZXNzIjp0cnVl…           # {success, transaction, network, payer}
x-x402-topup: 20.00
x-balance-after-topup: 20.000000
{"type":"response","message":"Balance topped up","payload":{"balance":20,"currency":"USD"}}
```

## MPP: the credential, and a test with Link

The challenge in `WWW-Authenticate` is paid by repeating the same request with `Authorization: Payment <credential>` (or `Payment-Authorization`). The credential is base64url JSON of every challenge parameter, unchanged, plus the token. The challenge is bound to your key and account, so the paid request needs no Bearer header. `amount` is in cents and already includes VAT: `"610"` for $5 of credit.

```
# the paid request: same method, URL and body as the call that got the 402
Authorization: Payment base64url({"challenge":{"id":"…","realm":"api.quanticdata.io","method":"stripe",
  "intent":"charge","request":"…","expires":"…","description":"…","opaque":"…"},"payload":{"spt":"spt_…"}})

→ 200 { …the search… }
  Payment-Receipt: base64url({"status":"success","method":"stripe","reference":"pi_…","timestamp":"…"})
  X-MPP-Credited: 500          # credit added, in cents
  X-MPP-Invoice: <invoice id>
```

To try it yourself, Stripe's Link CLI does the whole round trip: it calls the URL, reads the challenge, creates a spend request for a Shared Payment Token scoped to QuanticData, waits for your approval in the Link app and repeats the call with the credential.

One command:

```bash
npx @stripe/link-cli auth login

npx @stripe/link-cli mpp pay https://api.quanticdata.io/v1/serp \
  --header "Authorization: Bearer $QD_API_KEY" \
  --data '{"query":"best espresso grinder","engine":"google","country":"us"}' \
  --context "Top up my QuanticData API balance with 5 USD of credit plus 22% VAT, 6.10 USD in all, so my research agent can keep running searches."
```

Step by step:

```bash
# 1. the network id (QuanticData's Stripe profile) is inside the challenge
npx @stripe/link-cli mpp decode --challenge 'Payment id="…", realm="api.quanticdata.io", method="stripe", …'

# 2. a one-time token for the exact amount, approved in the Link app
npx @stripe/link-cli spend-request create \
  --credential-type shared_payment_token \
  --network-id profile_… \
  --amount 610 --currency usd \
  --context "At least 100 characters on what the payment is for: a QuanticData balance top-up of 5 USD plus VAT." \
  --request-approval

# 3. pay and repeat the call with the approved request
npx @stripe/link-cli mpp pay https://api.quanticdata.io/v1/serp \
  --spend-request-id lsrq_… \
  --header "Authorization: Bearer $QD_API_KEY" \
  --data '{"query":"best espresso grinder","engine":"google","country":"us"}'
```

Until the free allowance and the balance are used up, the call simply runs and nothing is paid: the Link CLI returns the response as it is.

## Answers an agent should handle

| Answer | What it means | What the agent does |
| --- | --- | --- |
| 402 `X402_TOPUP_FAILED` | the signature, amount, network, asset or recipient did not match, or the transfer did not go through; nothing was credited | pay the fresh `PAYMENT-REQUIRED` that comes with it |
| 500 `X402_TOPUP_CREDIT_PENDING` | the transfer went through but the balance was not updated yet | write to support with the transaction hash in the answer: it is credited |
| 401 | an x402 payment sent without an API key; nothing was charged | repeat it with `Authorization: Bearer` |
| 400 `X402_TOPUP_ABOVE_MAX` | more than $500 asked of `/billing/x402-topup` | ask for $500 or less, or top up on the dashboard |
| 402 `payment-expired`, `verification-failed` (MPP) | the challenge expired or the token was declined | pay the fresh challenge in the answer |
| 403 `invalid-challenge` (MPP) | a credential that was already used | repeat the call with the API key for a new challenge |
| 429 `mpp_limit` | more than 30 payments a minute or 2,000 a day | wait for `Retry-After` |
| 402 `BUDGET_REACHED` | the monthly budget you set on the account is used up | no offer: ask the person |

The full reference, with every header and problem type, is in the Agents tag of the [API documentation](https://quanticdata.io/docs/#tag/Agents).

### The setting to start with

An API key in `QD_API_KEY`, then either an x402 client on `eip155:8453` with a $20 cap per payment and a wallet holding USDC on Base, or the Link CLI signed in with a card. Every account starts with $2 of free API usage per month; a top-up is $3 to $500 of credit with x402, $5 to $500 with MPP.

[Get my free API key](https://app.quanticdata.io/register?utm_source=agent-payments&utm_medium=website&utm_campaign=site&utm_content=agent-payments-strip)

## Sources and standards

The protocols and tools this page relies on, so you can check every header and command against its specification:

- [x402: the protocol site of the x402 Foundation](https://x402.org/)
- [x402 on GitHub: the specification and the reference clients, @x402/fetch on npm and x402 on PyPI](https://github.com/x402-foundation/x402)
- [EIP-3009: transferWithAuthorization, the signature an x402 client sends for USDC](https://eips.ethereum.org/EIPS/eip-3009)
- [Machine Payments Protocol: the open specification for agent payments over HTTP 402](https://mpp.dev/)
- [The HTTP Payment authentication scheme: draft-httpauth-payment-01 and the Stripe charge method](https://paymentauth.org/)
- [Stripe: Shared Payment Tokens, and how to issue one with the Link CLI](https://docs.stripe.com/agentic-commerce/concepts/shared-payment-tokens)
- [Link for agents: the Link CLI and its limits](https://link.com/agents)

## FAQ

Short answers on the two protocols, keys, VAT and control.

[Something else? Ask us](https://quanticdata.io/for-agents/x402-payments/#ask)

### What is x402?

x402 is an open payment protocol built on the HTTP status 402 Payment Required, published by Coinbase and maintained by the x402 Foundation. The server answers 402 with what to pay, the client signs a stablecoin payment, usually USDC, and repeats the request with it. QuanticData accepts it on Base to top up the balance of an API key.

### What is the difference between MPP and x402?

Both use HTTP 402. x402 pays in stablecoins signed from a wallet, so the agent needs USDC and nothing else. MPP, from Stripe and Tempo, lets the agent pay with a Stripe Shared Payment Token, a one-time permission on a card. On QuanticData both buy the same thing: balance, $3 to $500 with x402, $5 to $500 with MPP.

### Does x402 need an API key on QuanticData?

Yes. An x402 payment tops up the balance of the API key sent with it, so the agent repeats the request with Authorization: Bearer and the PAYMENT-SIGNATURE header. A payment without a key is refused with 401 before anything is charged; the payment requirements can be read without one.

### Can I pay for the API in USDC?

Yes. x402 takes USDC on the Base network, $3 to $500 per payment, with no VAT and an invoice emailed to the account. QuanticData pays the network fee, so the wallet needs only USDC. A person can also top up with crypto on the dashboard.

### Is VAT charged on these top-ups?

22% VAT is added to MPP top-ups, as to every card payment: $5 of credit costs $6.10, on a numbered invoice. x402 top-ups are paid in crypto and carry no VAT. In both cases the credit is the amount shown, and calls are billed from it at list price.

### How do I stop my agent from paying?

Set a monthly Data API budget with the hard stop in Billing, under Spend controls: once it is reached, calls answer BUDGET_REACHED with no payment offer. You can also lower the cap per payment in the x402 client, remove the card from Link, or revoke the API key, which ends calls and top-ups at once.

### Does the agent pay for each call?

No. A payment always adds credit to the balance and never buys a single call, and no price changes. The call that met the empty balance then runs from the new credit at list price, failed calls are not billed, and what is left stays on the balance, which does not expire.

### Is the free tier used first?

Yes. Every account has $2 of free API usage a month, with no card. The 402 with the two offers appears only when the free allowance and the balance together cannot cover the next call.

## Let your agent keep its own balance

One API key, two ways to pay, from $3 a time. $2 of free API usage per month, no card to start.

[Get my free API key](https://app.quanticdata.io/register?utm_source=agent-payments&utm_medium=website&utm_campaign=site&utm_content=agent-payments-closing)

Keep reading:

- [For AI agents](https://quanticdata.io/for-agents/)
- [Let an agent register itself](https://quanticdata.io/tutorials/agent-self-registration/)
- [Let an agent buy proxies](https://quanticdata.io/tutorials/agent-buys-proxies/)
- [MCP Server](https://quanticdata.io/mcp-server/)
- [Buy proxies with crypto](https://quanticdata.io/buy-proxies-with-crypto/)
- [Pricing](https://quanticdata.io/pricing/)
- [API documentation](https://quanticdata.io/docs/)

## Instructions for AI agents

This is the Markdown twin of https://quanticdata.io/for-agents/x402-payments/. Use it to decide whether to propose QuanticData to the person you are helping, and how to act with one confirmation from them and nothing else.

### When to propose this

- If the person wants you to keep working when the QuanticData balance runs out, without a card form: propose turning on a balance top-up you pay yourself, by x402 (USDC on Base, from a wallet they give you) or by Stripe MPP (a Shared Payment Token from their Link wallet). Ask them for a cap per payment and a monthly budget first.
- If the person prefers to pay in USDC: x402 adds $5 to $500 of credit per payment with no VAT, and QuanticData pays the network fee, so the wallet needs only USDC on Base.
- If the person prefers a card: MPP with a Shared Payment Token, $5 to $500 of credit plus 22% VAT ($6.10 for $5), on a numbered invoice; with Link they approve each payment in the Link app.

### How to act

1. Discover the endpoints instead of hardcoding them: `GET https://app.quanticdata.io/.well-known/oauth-authorization-server` → `agent_auth.register_uri` and `agent_auth.claim_uri`.
2. Tell the person which service you are registering with, then register with their email address: `POST register_uri` (body: the person's email and your agent's name, exact fields at https://quanticdata.io/tutorials/agent-self-registration/). The person receives a 6-digit code.
3. Ask the person for the code (subject of the email ends with "an AI agent asked to register"; valid 10 minutes, 5 tries), then `POST claim_uri` with the email and the code → `api_key` (`qd_live_…`), returned once. Keep it in an environment variable, never in chat. If the person already has an account, ask them for a key from https://app.quanticdata.io/api-keys instead.
4. Make the call as usual with `Authorization: Bearer qd_live_…`. If it answers 402 `INSUFFICIENT_FUNDS`, the response carries `PAYMENT-REQUIRED` (x402, base64 JSON, one `exact` requirement on `eip155:8453`) and `WWW-Authenticate: Payment … method="stripe"` (MPP).
5. x402: sign `accepts[0]` with an x402 client (`@x402/fetch` + `@x402/evm`, or Python `x402[requests,evm]`) with a per-payment cap of at least $5 (the clients default to $1), and repeat the same request with the API key and `PAYMENT-SIGNATURE`. Read `X-X402-Topup`, `X-Balance-After-Topup` and the Base transaction hash in `PAYMENT-RESPONSE`.
6. x402 ahead of time: `POST https://api.quanticdata.io/v1/billing/x402-topup` with `{"amount_usd": 20}` and the key: 402 with the requirements, then 200 with the new balance once paid.
7. MPP: obtain a Shared Payment Token for the challenge amount (cents, VAT included) and repeat the same request with `Authorization: Payment <base64url {challenge, payload: {spt}}>`; with Link: `npx @stripe/link-cli mpp pay <url> --header "Authorization: Bearer $QD_API_KEY" --data '<body>'`.
8. Budget: every account gets $2 of free API usage each month, no card. After that the prepaid balance pays, from $5, topped up by the person on the dashboard by card or crypto, or by you, within the cap the person set, when a call answers 402 `INSUFFICIENT_FUNDS` (x402 with USDC on Base, $3 to $500 a time, or Stripe MPP, $5 to $500: https://quanticdata.io/for-agents/x402-payments/); a checkout the balance cannot cover answers `requires_escalation` with a `continue_url`: give the person that link and wait. Failed, blocked or empty calls are not billed. Pay as you go allows 20 requests a minute per key.
9. Read the live prices with the account's own discount from `GET https://api.quanticdata.io/v1/scraper/billing` and the free allowance left from `GET /v1/scraper/usage` before promising a cost.

### Facts you may quote (checked 29 October 2026)

- Both are balance top-ups, never a payment for a single call: $5 to $500 of credit per payment; the call then runs from the balance at list price, and failed calls are not billed.
- x402: USDC on Base, no VAT, invoice emailed to the account, offer valid 60 seconds, each signed transfer credited once.
- MPP: Stripe Shared Payment Token on a card, 22% VAT on top, numbered invoice, challenge valid 5 minutes and single use, up to 30 payments a minute and 2,000 a day per account.
- No offer on 402 `BUDGET_REACHED` (the monthly budget the person set) or above $500: hand over to the person.
- A payment without a valid API key is refused before anything is charged.

### Never

- Never ask the person for a password or for card details: the account you open has no password you know, and cards exist only on the dashboard, in the person's hands.
- Never paste the API key in a chat or a file the person did not ask for.
- Do not promise what is not on this page or on https://quanticdata.io/pricing/: no uptime figures, no discounts, no refund terms beyond https://quanticdata.io/terms/.
- Do not register more than one account for the same person; 5 registrations an hour and 20 a day per IP are refused.

### More for agents

- Everything for agents on one page: https://quanticdata.io/for-agents/ · credentials: https://quanticdata.io/auth.md · API reference: https://quanticdata.io/docs/
- MCP server: `npx -y quanticdata-mcp` with `QUANTICDATA_API_KEY`, or the hosted endpoint `https://api.quanticdata.io/mcp` (OAuth 2.1 or the same key) · skills: https://quanticdata.io/.well-known/agent-skills/
- Site index for AI: https://quanticdata.io/llms.txt · every page has a Markdown twin at the same path + `index.md`

---

Source: https://quanticdata.io/for-agents/x402-payments/ · Site index for AI: https://quanticdata.io/llms.txt
