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

# Pay per request with MPP

> Use USDC on Base to pay for Particle API requests with the Machine Payments Protocol, alongside x402.

You can pay for a Particle API request with USDC on Base using the
[Machine Payments Protocol](https://mpp.dev). MPP uses the same per-call prices
and payable endpoints as [x402](/x402). You do not need an account or an API key.

## Choose a protocol

When MPP is available, the same `402 Payment Required` response advertises both
payment options. Read the challenge returned by the endpoint to discover its
current price and accepted method.

|                | x402                  | MPP                             |
| -------------- | --------------------- | ------------------------------- |
| Challenge      | `PAYMENT-REQUIRED`    | `WWW-Authenticate: Payment ...` |
| Payment        | `PAYMENT-SIGNATURE`   | `Authorization: Payment ...`    |
| Receipt        | `PAYMENT-RESPONSE`    | `Payment-Receipt`               |
| Payment method | `exact`, USDC on Base | `evm`, `charge`, USDC on Base   |

Send exactly one payment credential per request. A request containing both an
x402 payment and an MPP payment receives `400` before either is verified.

## Pay with an MPP client

Use an MPP client with the **EVM charge** method and a wallet holding USDC on
Base. A client configured only for Tempo cannot pay a Base challenge.

```bash theme={"dark"}
npm install mppx viem
```

```typescript theme={"dark"}
import { Fetch, evm } from "mppx/client";
import { privateKeyToAccount } from "viem/accounts";

const fetch = Fetch.from({
  acceptPaymentPolicy: { origins: ["https://api.particle.pro"] },
  methods: [evm.charge({
    account: privateKeyToAccount(process.env.WALLET_PRIVATE_KEY as `0x${string}`),
    currencies: [evm.assets.base.USDC],
    maxAmount: "1.00",
  })],
});

const response = await fetch(
  "https://api.particle.pro/v1/podcasts/search?q=artificial%20intelligence",
);
console.log(response.status, response.headers.get("Payment-Receipt"));
console.log(await response.json());
```

The client reads the challenge, signs the requested USDC transfer, and retries
with `Authorization: Payment ...`. Set `maxAmount` to your per-request budget.

## Prices and retries

The MPP challenge's encoded `request` contains the amount in atomic USDC units,
the token address, recipient, and chain ID. USDC has six decimal places:
`25000` means `$0.025`. Use the quoted amount instead of hard-coding a price.

A challenge expires after five minutes and applies to the exact method, path,
query string, and request body. If you change the request, obtain a new challenge.

Successful payments return a `Payment-Receipt` with the transaction reference.
Failed API requests and MCP tool errors are not charged. If settlement times out,
retry the identical request with the **same payment credential** first: the
transfer might have completed even if the response did not arrive. Authorize a
new payment only after an explicit rejection.

## API keys and MCP

API keys and account Bearer credentials keep their existing behavior and take
precedence over per-request payments, including when a key is invalid. For MPP,
omit account credentials and send only the `Authorization: Payment` credential.

MPP is also available over HTTP on `POST https://mcp.particle.pro/mcp`. The price
is the sum of the request's billable tool calls. `initialize`, `tools/list`,
`ping`, and free tools remain free. An unpaid tool call advertises both payment
protocols and the OAuth Bearer challenge so your client can choose how to connect.

Alerts, account endpoints, and other endpoints that require an account retain
their existing restrictions. See [what can be paid for](/x402#what-can-be-paid-for).

## Agent discovery

MPP uses [OpenAPI discovery](https://mpp.dev/advanced/discovery). Agents and
registries can read the public documents without authentication:

* [REST discovery](https://api.particle.pro/openapi.json) lists the API operations.
* [MCP discovery](https://mcp.particle.pro/openapi.json), available when MPP is
  enabled, describes the HTTP MCP endpoint.
* [The agent map](https://api.particle.pro/llms.txt) lists endpoints and tools
  with their per-call prices. [The setup playbook](https://api.particle.pro/agents.md)
  explains how to connect.

The OpenAPI root's `x-service-info` supplies service categories and documentation
links. Payable operations include `x-payment-info.offers[]` with `method: "evm"`,
`intent: "charge"`, the USDC token address, and an amount in atomic units. MCP
uses `amount: null` because its total depends on the requested tools. Both
documents describe the `Payment` authentication scheme and payment headers.
For registries such as MPPScan that read the Agentcash discovery profile, the
same offers also appear in `x-payment-info.protocols[].mpp`, alongside a USD
`price` object. REST prices are fixed; MCP advertises the minimum billable tool
price and dynamic pricing because a request can contain multiple tool calls.

Discovery is advisory: use the runtime `402` challenge for the current terms.
MPP offers are advertised only when enabled. MPP discovery uses `/openapi.json`;
the existing `/.well-known/x402` documents continue to describe x402.

You can check either document with the reference validator:

```bash theme={"dark"}
npx mppx discover validate https://api.particle.pro/openapi.json
```

## Related

* [Pay per request with x402](/x402)
* [Agent authentication](/auth)
* [Payment errors](/errors/payment_required)
