relaybill
ProtocolSolutionsWorkflowPricingMarketplaceDocs
Sign in

Overview

  • Architecture
  • Quickstart
  • Stripe Setup

Implementation

  • Authentication
  • Edge Lifecycle
  • Origin Security
  • CORS Policy
  • Error Handling
  • Response Codes
  • Testing

Policy

  • Header Policy

Integrations

  • Python (FastAPI)
  • Node.js (Express)
  • Go (Gin)
  • cURL

Customer

  • User Guide

Financials

  • Economics
PROTOCOL_DOCUMENTATION

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.

01_Client
Browser / App
02_Relay_Gateway
Settlement Edge
03_Origin
Private API

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.

01

Provision Relay

Enter your origin URL in the Merchant Dashboard. We'll generate a unique Relay ID instantly.

02

Configure Pricing

Set your unit price per 1,000 requests. Connect Stripe Express to enable live settlement.

03

Issue Keys

Send your hosted storefront link to customers. They purchase credits and receive secure keys.

04

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.

Requiredx-api-key
Formatrlb_live_[a-z0-9]{48}

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

/01

In-Memory Shielding

Requests are filtered by an LRU Cache rate-limiter to prevent DDoS and abusive bursts before hitting the database.

/02

SSRF Protection

Target URLs are validated against private IP blacklists to protect internal infrastructure.

/03

Cryptographic Lookup

The x-api-key is verified against the project configuration in a single, optimized PostgreSQL query.

/04

Atomic Settlement

The customer's balance is decremented and the transaction is logged within a Prisma $transaction.

/05

Header Scrubbing

Non-whitelisted client headers are stripped. Only safe, standard headers are forwarded to your origin server.

/06

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.

Client Example
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_GATEWAY

The origin server is unreachable or offline.

RLB_GATEWAY_TIMEOUT

The origin server took >15s to respond.

RLB_INSUFFICIENT_CREDITS

The API key has a zero balance.

RLB_INVALID_KEY

The x-api-key is incorrect or revoked.

Response Codes

402 Payment RequiredInsufficient customer balance
502 Bad GatewayOrigin server offline
504 Gateway TimeoutOrigin server too slow

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)

main.py
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)

server.js
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)

main.go
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.

Terminal
curl -X GET https://relaybill.com/v1/relay/YOUR_RELAY_ID \
     -H "x-api-key: rlb_live_..." \
     -H "Content-Type: application/json"
END_USER_DOCUMENTATION

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.

Merchant Share
90%

Net payout to your bank. No hidden transaction taxes.

Platform Fee
10%

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.

GET STARTED

Ready to provision?

Launch First Relay
relaybill

The global settlement layer for high-performance APIs. Provision your logic to global revenue in sixty seconds.

Systems_Optimal
Platform
  • Protocol
  • Security
  • Network
  • Workflow
  • Global Status
Solutions
  • Monetize AI
  • Data-as-a-Service
  • Micro-Utilities
  • Private Utility
  • All Solutions
Resources
  • Documentation
  • Case Study
  • Changelog
  • Support
Product
  • Marketplace
  • Pricing
  • Sign In
  • Privacy
  • Terms

© 2026 RelayBill Networks Inc. All rights reserved.

LinkedInTwitterGitHub