Manually create a payment credential for a 402 response. Returns the headers to include in the retry request.
Parse the payment receipt from a successful response. Returns null if no receipt is present.
Optionalprotocol: ProtocolPolyfill globalThis.fetch to automatically handle 402 Payment Required responses.
After calling this, all fetch() calls will transparently pay for resources.
Wrap a fetch function to automatically handle 402 Payment Required responses. Returns a new fetch function that transparently pays for resources.
Optionalinit: RequestInitOptionalinit: RequestInit
OMPX client — automatically handles payments for both X402 and MPP services.
Example: Basic usage (global fetch polyfill)
Example: Manual control