r402-http
HTTP transport for the x402 payment protocol, part of the
r402 workspace.
Highlights
- Server
Paygate+X402Middleware— Axum layer enforcing payments viaResourceServer(verify/settle hooks, cancel on handler failure), three settlement modes (sequential, concurrent, background), and HTTP-onlyPaygateHooks(API keys / KYT). - Client
X402Client— thinreqwest_middlewareadapter overr402_core::PaymentClient: 402 → sign → retry, pluson_payment_responsewith one corrective recovery. - Remote
FacilitatorClient—/verify,/settle,/supportedwith 30s timeout, 429/5xx backoff, 10-minute/supportedcache. - CORS — exposes
Payment-RequiredandPayment-Response.
Cargo Features
| Feature | Surface |
|---|---|
client |
reqwest_middleware-based buyer middleware. |
server |
axum paygate / facilitator HTTP servers. |
facilitator |
FacilitatorClient for talking to a remote |
| facilitator. | |
telemetry |
OpenTelemetry tracing instrumentation. |
full |
All of the above. |
Documentation
- Crate docs: https://docs.rs/r402-http
- Project README:
../README.md.
License
Dual-licensed under MIT and Apache-2.0.