MPP
MPP is the standardized payment-auth flow supported by Rungate for clients that can respond to WWW-Authenticate: Payment challenges.
#Overview
When MPP is enabled, an unpaid request can return a 402 with a standard payment challenge. The client retries using Authorization: Payment ... and receives a Payment-Receipt header on success. For the underlying payment method, see Tempo's machine payments docs.
Current payment rail:
- Network: Tempo mainnet (
4217) - Settlement asset:
pathUSD(0x20c0000000000000000000000000000000000000) - Tempo has no native gas token. Transaction fees are paid in Tempo stablecoins, so the paying wallet should hold
pathUSD. - Rungate can advertise MPP and x402 on the same unpaid request. MPP-capable clients should follow the payment challenge in
WWW-Authenticate.
#Challenge flow
The example below uses Tempo against the same Tempo-mainnet pathUSD payment rail currently advertised by Rungate.
HTTP/1.1 402 Payment Required
WWW-Authenticate: Payment ...
PAYMENT-REQUIRED: <optional x402 fallback>
Content-Type: application/json
{
"error": {
"code": 402,
"message": "Payment required"
}
}#Client example
The mppx client can pay the challenge and retry in one call.
import { Mppx, tempo } from "mppx/client";
const mppx = Mppx.create({
polyfill: false,
methods: [tempo({ account, getClient: () => walletClient })],
});
const res = await mppx.fetch("https://api.rungate.ai/v1/chat/completions", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
model: "deepseek/deepseek-v3.2",
messages: [{ role: "user", content: "Say hello." }],
}),
});
console.log(res.headers.get("payment-receipt"));