Nexus

Documentation

Build with Nexus.

The full reference. Quickstart, concepts, deployment, and the API.

Quickstart

Five minutes from git clone to your first request.

install.sh
# 1. Clone
git clone https://github.com/fun-fx/ffx_nexus.git
cd ffx_nexus

# 2. Start the dev stack
docker compose -f deploy/docker-compose.dev.yml up -d

# 3. Wait for the console to be ready (~30s)
curl -fsS http://localhost:8081/healthz
first-call.sh
# 4. Create a virtual key from the CLI
docker exec -it nexus nexus keys create \
  --name "my-first-key" \
  --model gemini-2.5-flash

# 5. Make a request
curl http://localhost:8080/v1/chat/completions \
  -H "Authorization: Bearer nxs_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "model": "gemini-2.5-flash",
    "messages": [{"role": "user", "content": "hi"}]
  }'

Concepts

Virtual key

The credential a user or app presents to Nexus, formatted as nxs_live_.... Each virtual key carries policy: allowed models, RPM limit, monthly budget, owner. It is the only credential the user ever sees.

BYOK vs. platform credentials

With BYOK, each user brings their own OpenAI/Gemini key and pays the provider directly. With platform credentials (Enterprise), your IT team holds the provider key and your users only see virtual keys. Both modes are first-class in Nexus.

Org & multi-tenancy

Each org is an isolated tenant. Separate Postgres schema, separate encryption keys, separate ClickHouse database, separate SSO realm. Cross-tenant queries are impossible by design.

Deployment

Helm chart, Docker Compose, or air-gapped install. Pick the one that fits your org.

Helm chart (production)

helm repo add nexus https://fun-fx.github.io/ffx_nexus
helm install nexus nexus/nexus \
  --namespace tenant-nexus \
  --create-namespace

Docker Compose (dev)

git clone https://github.com/fun-fx/ffx_nexus.git
cd ffx_nexus
docker compose -f deploy/docker-compose.dev.yml up -d

API reference

Nexus is OpenAI-compatible. Point your existing OpenAI / Anthropic / Vercel AI SDK at https://nexus.ffx.ai/v1 and you're done.

from openai import OpenAI

client = OpenAI(
    base_url="https://nexus.ffx.ai/v1",
    api_key="nxs_live_...",
)

resp = client.chat.completions.create(
    model="gemini-2.5-flash",
    messages=[{"role": "user", "content": "hi"}],
    stream=True,
)
for chunk in resp:
    print(chunk.choices[0].delta.content or "", end="")

Full reference → github.com/fun-fx/ffx_nexus/docs

Need more?

We are happy to help you self-host.