Machine-to-machine payments for HTTP and AI agents.

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.

Highlights

icon

X402
Protocol

Full x402 protocol support with client-side automatic 402 handling, server-side payment verification and settlement via facilitator services, and route-level X402Security.

icon

Machine
Payments Protocol

Flexible payment protocol with pluggable payment methods. No facilitator needed - implement MppSigner and MppVerifier directly for any provider including Stripe and crypto.

icon

MCP
Integration

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.

icon

Client
Filters

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.

icon

Server
Filters

Protect any endpoint with payment requirements. Verify and settle payments before allowing access. One filter wrapping your handler - no changes to business logic.

icon

Route
Security

X402Security and MppSecurity integrate with http4k’s routing DSL for fine-grained, per-route payment protection. Different prices for different endpoints.

icon

Testable
Fakes

Built-in FakeX402Facilitator for testing payment flows without real transactions. Test your entire payment integration in-memory with no external services.

icon

Transactional
Outbox

(Coming soon) Reliable message delivery with database consistency. Ensure payment events, notifications, and downstream messages are never lost, even when services fail.

Getting started with Internet Payments

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.

License

http4k Internet Payments Pack is available under the http4k Commercial License. Free usage is granted for qualifying small businesses (<$1m ARR), non-commercial, non-profit, and research activities.

Pricing

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.

Let's talk

Contact us
pumb
scarf