Ship logic.
Automate commerce.
RelayBill is the programmable settlement layer for the API economy. Provision any origin URL into a secured, monetized endpoint in under sixty seconds.
Zero Trust
SSRF protection and header scrubbing enforced at the network edge.
Atomic Finality
Balances are decremented in a single ACID transaction within our ledger.
Global Edge
Sub-10ms verification overhead via our distributed POP network.
Universal Payouts
Automatic 90% settlement to your connected bank via Stripe Express.
Quickstart
Go from a raw backend to a monetized API in sixty seconds.
Provision Relay
Enter your origin URL in the Merchant Dashboard. We'll generate a unique Relay ID instantly.
Configure Pricing
Set your unit price per 1,000 requests. Connect Stripe Express to enable live settlement.
Issue Keys
Send your hosted storefront link to customers. They purchase credits and receive secure keys.
Switch Traffic
Update your client-side fetch calls to point to our proxy. Revenue settles as traffic flows.
Stripe Setup
RelayBill utilizes Stripe Connect Express to manage global financial compliance and real-time payouts.
1. Onboarding
Navigate to your Merchant Dashboard and click "Connect Stripe". You will be redirected to Stripe to verify your identity and link your bank account.
2. Merchant of Record
With RelayBill, you are the Merchant of Record (MoR). Payments flow directly to your Stripe account. RelayBill acts as the infrastructure layer that facilitates the transaction and settlement.
3. Fees & Processing
We charge a flat 10% platform fee. This is inclusive of all Stripe merchant processing fees (typically 2.9% + $0.30) and payout costs. You keep exactly 90% of your gross volume.
Ensure your Stripe account information is complete to avoid payout delays. Payouts are usually processed on a 2-day rolling basis.
Authentication
RelayBill uses a secure header-based authentication protocol. All requests must include a valid x-api-key.
API keys are generated using cryptographically secure random bytes and are stored using one-way hashing. They are only displayed once upon purchase.
Edge Lifecycle
In-Memory Shielding
Requests are filtered by an LRU Cache rate-limiter to prevent DDoS and abusive bursts before hitting the database.
SSRF Protection
Target URLs are validated against private IP blacklists to protect internal infrastructure.
Cryptographic Lookup
The x-api-key is verified against the project configuration in a single, optimized PostgreSQL query.
Atomic Settlement
The customer's balance is decremented and the transaction is logged within a Prisma $transaction.
Header Scrubbing
Non-whitelisted client headers are stripped. Only safe, standard headers are forwarded to your origin server.
Response Decoration
We return your origin's response but inject X-Relay-Duration and X-Relay-Credits-Remaining headers.
Origin Security
To prevent users from discovering and bypassing the RelayBill paywall, you should verify the Shared Secret in your origin backend.
The x-relaybill-secret Header
RelayBill injects a unique secret header into every request forwarded to your origin. Your server should reject any request that does not contain this secret.
if (request.headers['x-relaybill-secret'] !== process.env.RELAYBILL_SECRET) {
return response.status(403).send('Forbidden');
}CORS Policy
RelayBill supports direct browser integration. Our gateway handles CORS pre-flight requests automatically, allowing you to call your monetized APIs directly from any frontend.
const response = await fetch('https://relaybill.com/v1/relay/ID', {
headers: { 'x-api-key': 'rlb_live_...' }
});
const data = await response.json();Error Handling
Structured JSON errors returned when a request fails protocol verification.
RLB_BAD_GATEWAYThe origin server is unreachable or offline.
RLB_GATEWAY_TIMEOUTThe origin server took >15s to respond.
RLB_INSUFFICIENT_CREDITSThe API key has a zero balance.
RLB_INVALID_KEYThe x-api-key is incorrect or revoked.
Response Codes
Testing
We recommend testing your Relay integration with a live credit purchase before distributing keys to customers.
Test Keys: Native sandbox keys (`rlb_test_...`) are currently under development and will be available in a future update. For now, use a live key with a minimal credit balance for verification.
Header Policy
Forwarded
- Content-Type
- Accept
- User-Agent
- X-Forwarded-For
Scrubbed
- Authorization
- Cookie
- x-api-key
- Set-Cookie
Python (FastAPI)
from fastapi import FastAPI, Request
app = FastAPI()
@app.get("/data")
async def get_secure_data(request: Request):
# Auth + Billing already verified at edge
return {"status": "success", "payload": "monetized_content"}Node.js (Express)
const express = require('express');
const app = express();
app.post('/v1/process', (req, res) => {
// Edge gateway handled all auth and billing
res.json({ status: 'paid', payload: '...' });
});
app.listen(3000);Go (Gin)
package main
import "github.com/gin-gonic/gin"
func main() {
r := gin.Default()
r.GET("/data", func(c *gin.Context) {
c.JSON(200, gin.H{"status": "monetized"})
})
r.Run()
}cURL
Test your Relay instantly from the command line.
curl -X GET https://relaybill.com/v1/relay/YOUR_RELAY_ID \
-H "x-api-key: rlb_live_..." \
-H "Content-Type: application/json"User Guide
Purchasing Credits
Access the creator's hosted Relay storefront to purchase API credits. Upon successful checkout via Stripe, your unique `x-api-key` will be displayed once.
Managing Keys
Store your keys securely. RelayBill does not store raw keys; if lost, you must purchase new credits or contact the creator for a manual override.
Usage Tracking
Monitor your remaining balance via the `X-Relay-Credits-Remaining` header returned with every successful API response.
Security Best Practices
Never commit your API keys to public repositories. Use environment variables or secret management tools to protect your balance.
Economics
RelayBill takes a flat 10% platform fee which covers all Stripe processing, merchant fees, and edge infrastructure costs.
Net payout to your bank. No hidden transaction taxes.
Covers Stripe fees, global edge, and compute.
No Monthly Minimums
Unlike enterprise API gateways, we only earn when you do. There are no setup fees, monthly minimums, or hidden infrastructure costs. See Stripe Setup for detailed settlement info.