Add payment gates to any HTTP endpoint or MCP tool with X402 and Machine Payments Protocol. Client and server filters, route-level security, testable fakes, and MCP integration - all with familiar http4k patterns.
Full x402 protocol support with client-side automatic 402 handling, server-side payment verification and settlement via facilitator services, and route-level X402Security.
Flexible payment protocol with pluggable payment methods. No facilitator needed - implement MppSigner and MppVerifier directly for any provider including Stripe and crypto.
Payment-gated MCP tools and resources. Add protocol-level and tool-level payment filters to your MCP servers for automated machine-to-machine commerce between AI agents.
Automatic 402 handling for both X402 and MPP. Your HTTP client detects payment-required responses, signs the challenge, and retries - transparent to your application code.
Protect any endpoint with payment requirements. Verify and settle payments before allowing access. One filter wrapping your handler - no changes to business logic.
X402Security and MppSecurity integrate with http4k’s routing DSL for fine-grained, per-route payment protection. Different prices for different endpoints.
Built-in FakeX402Facilitator for testing payment flows without real transactions. Test your entire payment integration in-memory with no external services.
(Coming soon) Reliable message delivery with database consistency. Ensure payment events, notifications, and downstream messages are never lost, even when services fail.
Add the X402 or MPP dependency. Protect a server endpoint with a payment filter - one line wrapping your handler.
Add the client filter to automatically handle 402 responses. Your client signs payment challenges and retries transparently.
Use X402Security or MppSecurity for per-route payment protection in your http4k routing DSL.
Test everything in-memory using the built-in FakeX402Facilitator. No real transactions, no external services, full-speed tests.
All http4k Pro modules are also automatically included as part of the Enterprise Edition. Need bulk developer seats, team licensing, or custom terms? Get in touch and we'll find the right fit - whether that's volume licensing for individual Pro modules or our full Enterprise Edition with LTS support and priority access to all Pro modules.
