Relay docs

Run it locally

This walks through running Relay on a developer machine.

#Prerequisites

  • .NET 9 SDK
  • SQL Server reachable with a connection string (LocalDB, a container, or a shared dev server).
  • Qdrant (only if you use knowledge bases / RAG).
  • ClickStack / ClickHouse (only if you want telemetry dashboards).

Windows note: localhost resolves to IPv6 ::1, but containers (Docker/Podman) publish on IPv4. If a local service won't connect, use 127.0.0.1 instead of localhost.

#1. Apply the database schema

Schema is a DACPAC (not EF migrations). Publish Application.Database to your relay_gateway database (via SqlPackage or Visual Studio's Publish). The apps do not run Database.Migrate() at startup.

#2. Configure connection strings and secrets

Set at least the gateway SQL connection. Use user-secrets or environment variables — never commit real secrets. See Configuration & secrets.

dotnet user-secrets --project Application.Api set "ConnectionStrings:GatewayDb" "Server=127.0.0.1;Database=relay_gateway;..."

#3. Run the apps

Each app runs independently. Build in Release with --no-restore (running instances can lock Debug DLLs):

# Public gateway API  → http://localhost:5300
dotnet run --project Application.Api -c Release

# Control panel (host + WASM) → its own port
dotnet run --project Application -c Release

# This documentation site → http://localhost:5400
dotnet run --project Application.Doc -c Release

#4. Seed providers and models

In the control panel, add a Provider (e.g. OpenAI) — its secret is referenced by a config key name, not stored in the DB — then add Models whose public alias maps to the provider's model id. See Providers and The panel, page by page.

#5. Issue an API key and make a call

Create a key under API Keys (the full key is shown once). Then:

curl http://localhost:5300/v1/chat/completions \
  -H "Authorization: Bearer $RELAY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "model": "gpt-4o", "messages": [{ "role": "user", "content": "Hello!" }] }'

That's it — you're through the gateway. Next, explore the API overview.