Documentation Index
Fetch the complete documentation index at: https://docs.prudra.dev/llms.txt
Use this file to discover all available pages before exploring further.
Add MPP to an endpoint
payMiddleware generates MPP challenges by default as part of dual-protocol. No additional configuration is needed for basic MPP support. The configuration below shows the full middleware chain with notes on MPP-specific behaviour.
- Dashboard
- SDK
- cURL
Dashboard support for managing paid endpoints is coming soon. Use the SDK to configure MPP on your routes.
What the 402 response includes
When a request arrives without payment, the MPP challenge appears in theWWW-Authenticate header:
WWW-Authenticate header to get the MPP challenge parameters.
What the 200 response includes
After successful MPP payment:acceptSessions: true) and the agent is starting a new session, the response also includes the X-PRUDRA-SESSION-ID header and sessionId in the body.
payMiddleware options for MPP
| Parameter | Type | Required | Description |
|---|---|---|---|
price | string | Yes | Payment amount in USD |
description | string | No | Human-readable description |
acceptSessions | boolean | No | Enable session payments (Pro plan). Default: false |
Error handling
| Error | Status | Cause |
|---|---|---|
payment-verification-failed | 402 | HMAC mismatch or transaction not found on Tempo |
duplicate-payment | 409 | Same txHash used twice (replay blocked) |
challenge-expired | 402 | Challenge expired — agent must request a new one |
insufficient-payment | 402 | Transaction amount less than required price |
Next steps
- Test MPP payments — test the full MPP agent flow
- Handle the Authorization header — credential format details
- Add session payments — one MPP payment per multi-step workflow

