Everything You Need to Monetize APIs
A fullstack SDK for JavaScript. From one-line integration to enterprise security, Atomic Rail handles the complexity so you can focus on building.
Core Features
Everything you need to monetize APIs with crypto payments
One-Line Integration
Wrap any Next.js API route with withUsageGate and start accepting payments immediately. No complex setup, no payment processor integrations.
Real-Time Metering
Every paid request is tracked instantly with payer address, price, timestamp, and status. See your revenue as it happens.
HMAC-Signed Events
Tamper-proof usage records with cryptographic signatures. We verify before storing, ensuring audit trails you can trust.
Analytics Dashboard
Real-time insights into revenue, success rates, unique payers, and usage patterns. Filter by action, time range, or wallet.
Direct Wallet Payments
Payments flow directly to your wallet via x402. No intermediaries, no payment processors, no chargebacks. Keep 100%.
Multi-Project Support
Manage multiple projects with separate credentials, usage tracking, and analytics. Perfect for agencies and platforms.
Multi-Chain Support
Accept payments on your users' preferred blockchain
Base
EVMEthereum
EVMArbitrum
EVMOptimism
EVMPolygon
EVMSolana
SolanaMore chains coming soon. Request your preferred chain on GitHub.
Deep Dive into Features
Explore how each feature works under the hood
Seamless Payment Flow
The x402 protocol handles payment negotiation automatically. Users pay directly to your wallet - no intermediaries, no chargebacks, instant settlement.
- Automatic 402 Payment Required responses
- Direct wallet-to-wallet transfers
- Support for USDC and native tokens
- Built-in payment verification
- Works with any x402-compatible client
User calls /api/premium
x402 returns 402 Payment Required
User pays → Your wallet
API responds with premium content
Track Every Request in Real-Time
Non-blocking event emission means zero latency impact on your API. Events are signed, verified, and stored with full audit trails.
- Sub-millisecond event emission
- Automatic idempotency handling
- Payer wallet attribution
- Custom metadata support
- Export data via API
{
"eventId": "evt_1a2b3c...",
"projectId": "proj_abc123",
"actionId": "premium-api",
"price": "0.001",
"payerAddress": "0x742d...",
"status": "success",
"timestamp": 1702847293,
"signature": "hmac-sha256..."
}Cryptographically Verified Events
Every usage event is signed with HMAC-SHA256 using your project's secret key. Invalid signatures are rejected before storage.
- HMAC-SHA256 event signing
- Per-project secret rotation
- Timing-safe signature comparison
- Immutable audit logs
- SOC 2 compliant infrastructure
HMAC-SHA256
Payload Signature
Insights That Drive Growth
Understand your API usage patterns, identify top payers, track conversion rates, and optimize your pricing strategy.
- Real-time event streaming
- Revenue by endpoint breakdown
- Unique payer analytics
- Success/failure rate tracking
- Custom date range filtering
Total Events
12,847
Success Rate
99.2%
Revenue
$1,284
Your API's Control Plane
Manage your infrastructure without redeploying code. The Action Registry lets you control unit economics, networks, and status from a single UI.
- Dynamic pricing updates
- Multi-network configuration
- Emergency 'Kill Switch'
- Ghost action auto-discovery
- Idempotency TTL management
Action Registry
premium-generate
Detected 2 mins ago
image-upscale
$0.05 • Base Mainnet
Update Price
Verify Before You Deploy
Test your integration end-to-end without real funds. The Playground simulates the full x402 lifecycle to ensure your HMAC signing and ingestion are perfect.
- Real-time simulation logs
- HMAC signature verification
- Request/Response inspection
- Bypass payment with headers
- Zero-cost integration testing
Simple to Integrate, Powerful to Scale
See how easy it is to add usage gating to your API
Create a central gate instance for your project
import { AtomicGate } from "@atomic-rail/usage-gate";
export const gate = new AtomicGate({
projectId: process.env.METER_PROJECT_ID!,
hmacSecret: process.env.METER_HMAC_SECRET!,
sellerWallet: "0x...",
debug: true,
});Why Atomic Rail?
See how we compare to other API monetization solutions
Get Started in Minutes
From zero to monetized API in 4 simple steps
Install the Package
Add usage-gate and x402-next to your Next.js project.
bun add @atomic-rail/usage-gate x402-nextCreate a Project
Sign up and create a project to get your credentials.
Configure Your Route
Wrap your API handler with withUsageGate.
export const GET = withUsageGate(config, handler);Start Earning
Deploy and watch payments flow to your wallet.