Skip to main content
x402.dexpaprika.com serves the DexPaprika REST endpoints for a payment per request, in USDC on Base. There is no API key, account or signup: the endpoint answers your first request with HTTP 402 Payment Required, your client signs a USDC payment, sends the request again, 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 on Tempo instead of Base, see MPP.

What you need

  • A wallet with USDC on Base. You don’t need ETH for gas: you sign a USDC transfer authorization and the facilitator submits it on chain.
  • 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. The cap is shown in step 2.

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 x402.dexpaprika.com, and agents can read it from:

Step 1: read the challenge

Request any paid endpoint without paying. The payment terms come back base64-encoded in the PAYMENT-REQUIRED header:
The same header carries a resource object with a description of what the endpoint returns, and a bazaar extension with the input and output schema. Agents can use both to decide whether the call is worth paying for.

Step 2: pay from TypeScript

Install the x402 client packages and viem:
Save this as pay.mjs:
Run it with the wallet’s private key in the environment:
The wrapper makes the first request, reads the 402, signs the payment and retries. The payment-response header on the paid response holds the settlement: transaction is the USDC transfer on Base, which you can look up on BaseScan. spendControls is the safety net. If an endpoint asks for more than maxAmountPerPayment, the client throws before it signs anything. With the cap set to $0.001, below the price:

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 and in the bazaar schema of the 402.

Next steps

Pay with MPP on Tempo

The same endpoints, paid with the Machine Payments Protocol on Tempo.

Get an API key

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