relaybill
ProtocolSolutionsWorkflowPricingDocs
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 the RelayBill ledger.

Global Edge

Gateway-level verification, rate limiting, and settlement on every request.

Universal Payouts

Stripe Connect checkout and payout routing for connected merchants.

Quickstart

Go from a raw backend to a monetized API in sixty seconds.

01

Provision Relay

Enter your origin URL in the Merchant Dashboard. RelayBill generates 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 the RelayBill proxy. Revenue settles as traffic flows.

Stripe Setup

RelayBill utilizes Stripe Connect Express for merchant onboarding, checkout routing, and payout workflows.

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. Stripe Connect Settlement

Payments are processed through Stripe Connect and routed to your connected account. Confirm merchant-of-record, tax, refund, and compliance obligations with your own counsel before public launch.

3. Fees & Processing

RelayBill charges a flat 10% platform fee. This includes Stripe merchant processing fees (typically 2.9% + $0.30) and payout costs. Merchants keep exactly 90% of 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, scoped to a customer and relay, and can be revoked or rotated from the dashboard.

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

RelayBill returns the origin response and injects 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.

Origin Bypass Protection

Until per-origin shared-secret headers are enabled, protect sensitive origins with your own upstream authorization or an unguessable shared secret in the configured origin URL.

if (request.query.relay_secret !== process.env.RELAY_SECRET) { return response.status(403).send('Forbidden'); }

CORS Policy

RelayBill supports direct browser integration. The RelayBill gateway handles CORS pre-flight requests automatically, allowing monetized APIs to be called directly from any frontend.

Client Example
const response = await fetch('https://relaybill.com/api/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

RelayBill recommends testing each 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/api/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, gateway operations, and compute.

No Monthly Minimums

Unlike enterprise API gateways, RelayBill only earns when merchants earn. 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. RelayBill turns raw endpoints into paid, metered products 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
  • Pricing
  • Sign In
  • Privacy
  • Terms

Copyright 2026 RelayBill Networks Inc. All rights reserved.

LinkedInTwitterGitHub