Skip to main content
mpp.dexpaprika.com serves the DexPaprika REST endpoints for a payment per request, in USDC on Tempo, with the Machine Payments Protocol (MPP). There is no API key, account or signup: the endpoint answers your first request with HTTP 402 Payment Required, your client pays, sends the request again with the payment credential, and gets the data. It is built for AI agents and scripts that hold a wallet and call now and then, and for reaching endpoints that need a paid plan on the REST API, such as token OHLCV, token indicators and pool transactions, without a subscription. If you call DexPaprika every day, a free API key or a plan fits better. To pay with USDC on Base instead, see x402.

What you need

  • A Tempo wallet holding USDC. On Tempo it is the USDC.e token, 0x20C000000000000000000000b9537d11c60E8b50. Tempo has no separate gas token: the network fee is paid in the same stablecoin, so keep a little more than the price.
  • The Tempo CLI, or Node.js 18 or later for the TypeScript example.
Use a separate wallet that holds only what you are willing to spend, and set a spending cap in your client. Both examples below set one.

Endpoints and price

The paths, parameters and JSON responses are the same as on api.dexpaprika.com, so every tutorial and the API reference apply. Swap the host and the payment replaces the key.
Every 402 states its own price. The current price list is on mpp.dexpaprika.com, and agents can read it from:

Step 1: read the challenge

The payment terms come back in the WWW-Authenticate header, with the scheme name Payment:
method="tempo" and intent="charge" mean a one-off payment on Tempo. The request parameter is base64url-encoded JSON with the terms:
The Tempo CLI decodes all of this for you without paying:

Step 2: pay from the command line

Install the Tempo CLI and connect a wallet:
Then request the endpoint. The CLI pays the challenge and prints the response body. --max-spend caps what this command may spend, in USDC:
To pay from a specific key instead of the logged-in wallet, set TEMPO_PRIVATE_KEY in the environment.

Step 3: pay from TypeScript

Install mppx and viem:
Save this as pay.mjs:
Run it with the wallet’s private key in the environment:
mppx.fetch makes the first request, reads the 402, pays and retries. The receipt comes from the Payment-Receipt header: reference is the payment transaction, which you can look up on the Tempo explorer. maxAmount is the safety net. A challenge above it is skipped and the call throws without paying. polyfill: false keeps mppx from replacing the global fetch; leave it out if you want every fetch in your process to pay automatically.

Errors you don’t pay for

A request with a bad parameter or for something that doesn’t exist is refused before the payment challenge, so your client never pays for it. A parameter value that isn’t allowed gets 400:
An unknown network, token or pool gets 404:
The allowed values for each parameter are in the API reference.

Next steps

Pay with x402 on Base

The same endpoints, paid in USDC on Base with the x402 protocol.

Get an API key

For daily use, a free key in the DexPaprika console, with plans on the pricing page.