The Web3 Stripe for APIs. Create payment channels or streams, make API calls, payments happen automatically. No API keys, no gas fees per request, just use your wallet and start building.
PipeGate transforms how APIs handle payments by replacing traditional API keys with stablecoin payments and clever cryptography. Instead of managing countless API keys and dealing with complex billing systems, developers can simply connect their wallet and pay for API usage through payment channels, streams, or one-time transactions.
As of version 0.6.0, PipeGate implements the x402 payment protocol, providing standardized payment headers and seamless integration across different payment schemes. This means better interoperability and a unified payment experience.
Detailed documentation: docs.pipegate.xyz
The protocol consists of three main components:
- A client-side middleware that automatically handles payment channel creation, request signing, and payment management
- A server-side middleware that verifies signatures and manages state with minimal integration effort
- A smart contract for a new payment channel creation
What you get:
- Pay-per-call pricing without gas fees for each request
- Multiple payment options: channels, streams, or one-time payments
- No API key management - just connect your wallet
- Real-time usage tracking and automatic payments
- Self-service onboarding for both providers and consumers
Problems solved:
- Too many API keys for each product
- Complex API & Authentication infrastructure for providers
- High payment processor fees eating into margin
PipeGate is built with a focus on developer experience and standards compliance, implementing the x402 payment protocol for maximum interoperability.
Core Components:
-
- Unified
PaymentsLayersupporting all payment schemes (v0.6.0+) - x402-compliant header parsing and verification
- Automatic scheme detection (one-time, streams, channels)
- WASM compatibility for browser environments
- Legacy per-scheme middleware for backward compatibility
- Unified
-
- Single
withPaymentInterceptorfunction for all payment types - Automatic 402 Payment Required handling and retry logic
- x402 standard compliant payment headers
- Axios interceptors with state management
- Legacy interceptors available for migration
- Single
-
- Payment Channel Factory with provider registration
- Efficient channel contracts using Beacon Proxy pattern
- Integration with Superfluid for streaming payments
- One-time payment verification through transaction logs
Payment Schemes Supported:
- Payment Channels: Gasless microtransactions with off-chain state updates
- Superfluid Streams: Continuous payment flows for subscription-like access
- One-time Payments: Simple pay-per-request using on-chain transactions
x402 Integration:
All payment schemes follow the x402 standard with unified X-Payment headers containing { x402Version, network, scheme, payload }, making PipeGate compatible with other x402-compliant services.
PipeGate implements the x402 payment protocol for standardized API payment flows:
Payment Flow:
- Client requests API endpoint
- Server responds with
402 Payment Requiredcontaining accepted payment schemes - Client automatically selects scheme, signs payment, and retries with
X-Paymentheader - Server verifies payment and processes request
Supported Schemes:
one-time: Pay-per-request using transaction hashesstream: Continuous payments via Superfluid streamschannel: Gasless microtransactions through payment channels
See our x402 implementation spec for detailed payment header formats.
Latest (v0.6.0+) - x402 Standard Support:
- Rust Crate - Unified server middleware
- TypeScript SDK - Universal client interceptor
Both libraries support all payment schemes through a single unified API, replacing the need for separate per-scheme implementations.
1. Add server middleware (Recommended - x402 unified approach)
use pipegate::middleware::{PaymentsLayer, PaymentsState, Scheme, SchemeConfig, MiddlewareConfig};
// Support multiple payment schemes with one middleware
let config = MiddlewareConfig::new(vec![
SchemeConfig::new(Scheme::OneTimePayments, "1".to_string()).await,
SchemeConfig::new(Scheme::SuperfluidStreams, "2".to_string()).await,
SchemeConfig::new(Scheme::PaymentChannels, "0.001".to_string()).await,
]);
let app = Router::new()
.route("/api", get(handler))
.layer(PaymentsLayer::new(PaymentsState::new(), config));2. Register your API (for payment channels)
- Add pricing info to the ChannelFactory contract
- Registration guide
x402 Unified Client (Recommended)
import { withPaymentInterceptor } from "pipegate-sdk";
// Works with any payment scheme
const client = withPaymentInterceptor(
axios.create({ baseURL: "https://api.example.com" }),
PRIVATE_KEY,
{ oneTimePaymentTxHash: "0x..." } // or streamSender, or channel
);
// Automatic payment handling
const response = await client.get("/api/endpoint");Legacy usage instructions and detailed setup guides are available in our documentation.
- Dhruv Agarwal - Server Side SDK & Smart Contract Development
- Kushagra Sarathe - CLient Side SDK