Skip to main content

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 session payments

Add acceptSessions: true to payMiddleware on any route that should support session payments. The session ID is returned in the X-PRUDRA-SESSION-ID response header on the first request. Subsequent requests include this header to reuse the session without paying again.
Dashboard support for session payment configuration is coming soon. Use the SDK to enable sessions on your routes.

Parameters

payMiddleware with sessions

ParameterTypeRequiredDescription
pricestringYesPayment amount in USD for the first request
descriptionstringNoHuman-readable description
acceptSessionsbooleanYesMust be true to enable session payments

Request headers

HeaderRequiredDescription
X-PRUDRA-SESSION-IDNoInclude on subsequent requests to reuse an existing session
If X-PRUDRA-SESSION-ID is absent or invalid, the request is treated as a new payment request (402 is returned).

Response fields

FieldTypeDescription
vaultIdstringThe shared vault for this session. Same on every session request.
sessionIdstringThe session ID. Include in X-PRUDRA-SESSION-ID on subsequent requests.
The X-PRUDRA-SESSION-ID response header is also set on the first request.

Error handling

ErrorStatusCause
session-not-found402Session ID invalid or expired — agent must pay again
session-payments-not-available429Hobby plan doesn’t support session payments
vault-quota-exceeded429Active vault limit reached

Next steps