Self-hosting

The gateway is open source under FSL-1.1 and converts to Apache 2.0 two years after release. Run it on your own Cloudflare account; bring your own D1 + KV. The dashboard and Polar billing worker are not open — but you don't need them to run the gateway.

What's open vs closed

  • Open (FSL-1.1): apps/api, apps/mcp, packages/core, packages/db, packages/shared, packages/auth, packages/mcp-stdio.
  • Proprietary: apps/web (dashboard), apps/billing (Polar). You can build your own dashboard against the documented /api/* surface.

Prerequisites

  • A Cloudflare account with Workers + D1 + KV enabled.
  • node 20+, pnpm 9+, wrangler 3+.
  • An encryption key (32 random bytes, base64-encoded) for at-rest provider key encryption.

Setup

  1. git clone https://github.com/stephanelpaul/edgerouteai && cd edgerouteai
  2. pnpm install
  3. Provision a D1 database and a KV namespace from the Cloudflare dashboard. Note their IDs; paste them into apps/api/wrangler.toml.
  4. Apply migrations: cd apps/api && npx wrangler d1 migrations apply edgerouteai-db --remote
  5. Set the encryption key: npx wrangler secret put ENCRYPTION_KEY
  6. npx wrangler deploy

Configuration

Environment variables the worker reads:

wrangler.toml [vars]
[vars]
ENVIRONMENT = "production"
SMART_ROUTER_LLM = "1"   # opt in to LLM classifier (uses one of your BYOK keys)

Bindings:

  • DB — D1 (run migrations from packages/db/src/migrations).
  • RATE_LIMIT — KV namespace for rate-limit + health-tracker state.
  • CACHE — KV namespace for content-hash cache + classifier cache.

Secrets (set via wrangler secret put):

  • ENCRYPTION_KEY — 32 random bytes, base64.

Dashboard

The hosted dashboard is closed-source. You have two options for self-hosting:

  • Build your own UI against the /api/* endpoints (documented in API reference). Hono routes are simple and well-typed.
  • Skip a UI entirely and drive the gateway via API key + curl / jq. The CLI flow is enough for many self-hosters.
FSL converts to Apache 2.0 on 2028-04-22. Until then, the license permits non-competing internal and SaaS use; specifically prohibits offering EdgeRoute itself as a hosted commercial service.