Skip to main content
Call 7 fixed-price Xquik operations without an account or subscription. Pay per request with Tempo (USDC) using the mppx SDK.

Step 1: Install the SDK

The mppx package provides both client and server utilities. You only need the client. viem is required for wallet account management.

Step 2: Set up a Tempo wallet

You need a Tempo wallet funded with USDC, plus its raw hex private key for the mppx client. Path A - CLI only (recommended for agents)
Fund the account’s address with USDC on Tempo, then copy the exported key into TEMPO_PRIVATE_KEY. Path B - Web wallet as a USDC source Use wallet.tempo.xyz/welcome as a hosted UI to buy & send USDC. Run mppx account create to mint a local account, copy its address, send USDC from the web wallet to that address, then run mppx account export to get the hex key. The web wallet cannot be imported into mppx. It is a funding source, not a key source.
Warning: Store your private key securely. Never commit it to version control. Use environment variables.

Step 3: Make a charge request

Look up a single tweet. The SDK intercepts 402 responses, pays via Tempo, and retries automatically.
Mppx.create() patches the global fetch function. When a direct MPP request returns 402 with a WWW-Authenticate: Payment header, the SDK pays the requested amount and retransmits the request with an Authorization: Payment credential. Every response after accepted payment includes a Payment-Receipt header confirming settlement.

Step 4: Raw HTTP flow without the SDK

If you are not using the mppx SDK, you can implement the protocol manually. Step 1: Request the endpoint
Step 2: Receive the 402 challenge
The request parameter is a base64url-encoded JSON object containing the amount, currency, and recipient address. The application/problem+json body also includes an optional payment_options.guest_wallet.create_checkout action. It does not replace the MPP header, and the failed request creates no checkout. Ignore it when completing MPP. Use it only after a user explicitly chooses and confirms a 1010-250 USD guest wallet. Step 3: Pay and retry After completing the Tempo payment, retry the request with the payment credential:
The Authorization: Payment value is a base64url-encoded JSON object containing the original challenge and your payment proof. Step 4: Receive the response + receipt
The Payment-Receipt header confirms settlement. Check the HTTP status and response body separately because accepted payments also include a receipt on non-2xx responses.

Next steps

  • MPP overview: 7 direct MPP operations, pricing, and protocol details.
  • Guest wallets: Prepay 33 eligible reads with an accountless API key.
  • Get tweet: Full endpoint reference for tweet lookups.
  • Get user: Full endpoint reference for user lookups.
Last modified on July 13, 2026