Quick Start (3 minutes)

Snodus is an AI gateway that exposes a single endpoint for Anthropic, OpenAI, and Ollama, with virtual API keys, budget, rate limiting, dashboard, and smart routing.

1. Sign up

curl -X POST https://snodus.ai/signup \
  -H "Content-Type: application/json" \
  -d '{"email":"you@company.com","name":"Name","company":"Company","plan":"basic"}'

2. Save your API key

The response contains api_key starting with sk-. Save it — it will not be shown again.

3a. Use with Claude Code

export ANTHROPIC_BASE_URL="https://snodus.ai"
export ANTHROPIC_AUTH_TOKEN="sk-abc123..."
claude

3b. Or use curl directly

curl https://snodus.ai/v1/messages \
  -H "Authorization: Bearer sk-abc123..." \
  -H "Content-Type: application/json" \
  -H "anthropic-version: 2023-06-01" \
  -d '{"model":"auto","max_tokens":100,"messages":[{"role":"user","content":"Hello!"}]}'

4. View your usage

Open /admin/ to see spend, tokens, models used, keys, and teams.

Authentication

Every request to /v1/* requires a virtual API key Snodus (sk-*) in one of these headers:

Keys have: owner, rate limit (requests/min), monthly budget (cents), active/revoked status. The gateway replaces the virtual key with the real upstream provider API key.

For the Admin API (/admin/*): Basic auth with ADMIN_USERNAME:ADMIN_PASSWORD or a virtual key with role=admin.

POST /v1/messages

Main endpoint, Anthropic-compatible format. Auth: virtual key.

Request

{
  "model": "claude-sonnet-4-5",   // or "auto" if router enabled
  "max_tokens": 1024,
  "system": "You are...",
  "messages": [{"role": "user", "content": "..."}],
  "stream": false
}

Response headers

HeaderDescription
x-ratelimit-limitAllowed requests/minute
x-ratelimit-remainingRequests remaining in window
x-ratelimit-resetSeconds until window reset

Error codes

CodeWhen
401Missing or invalid key
402Monthly budget exceeded
403Key revoked, expired, or plan limit reached
429Rate limit exceeded (retry_after in body)
502Upstream provider error
504Upstream provider timeout

POST /v1/chat/completions

Native OpenAI endpoint — useful if your app already speaks OpenAI. Requires an OpenAI model (gpt-*, o1-*, o3-*, o4-*).

{
  "model": "gpt-4o-mini",
  "messages": [{"role": "user", "content": "hi"}]
}

POST /signup

Available on the hosted service only. Creates a team, admin user, and API key in one call.

{
  "email": "jane@company.com",
  "name": "Jane Smith",
  "company": "Acme Inc",
  "plan": "basic"
}

Rate limit: max 5 signups per hour per IP.

Admin API

MethodPathDescription
GET/admin/keysList virtual keys
POST/admin/keysCreate key (respects plan max_keys)
PATCH/admin/keys/{id}Update rate_limit / budget
POST/admin/keys/{id}/rotateRotate key, old expires in 24h
DELETE/admin/keys/{id}Revoke key
GET/admin/usersList users
POST/admin/usersCreate user (respects plan max_users)
GET/admin/teamsList teams
PATCH/admin/teams/{id}/planChange team plan
GET/admin/teams/{id}/accountAccount summary with progress
GET/admin/plansList available plans
GET/admin/providersList registered providers
GET/admin/analytics/{daily,models,users,recent,providers,routing}Dashboard data
GET/admin/analytics/exportCSV spend log

Smart Routing

Passing "model": "auto" in the body, the router picks the best model based on rules:

The routing decision is logged in spend_log.routed_from='auto' + routing_method='rules'.

Enable with env var SNODUS_ROUTER_ENABLED=true.

Real-world savings example: with a typical load of 80% short requests + 15% medium + 5% complex, routing reduces costs by ~65% compared to exclusive Opus usage.

Dashboard

Available at /admin/. Tabs: Spend (KPIs + charts), Activity (recent requests), Keys (CRUD), Users & Teams, Account (plan + progress). Auth: Basic auth with admin credentials.

Plans

PlanPriceTokens/monthUsersKeys
Free$0100K11
Basic$19/month1M13
Pro$49/month5M510
EnterpriseContact usUnlimitedUnlimitedUnlimited

Self-Hosting

Docker (recommended)

git clone https://github.com/42NE-Ltd/snodus
cd snodus
cp .env.example .env
# Edit .env: ANTHROPIC_API_KEY, ADMIN_PASSWORD
docker compose up -d

From source

cargo build --release
./target/release/snodus serve

Configuration (env vars)

VariableDescriptionDefault
DATABASE_URLPostgres connection string
ANTHROPIC_API_KEYReal Anthropic API key
OPENAI_API_KEYEnable OpenAI provider
OLLAMA_BASE_URLEnable local Ollama
ADMIN_PASSWORDAdmin bootstrap password
SNODUS_ROUTER_ENABLEDSmart router for model: "auto"false
SNODUS_FEATURES_SIGNUPEnable /signupfalse
SNODUS_FEATURES_PLANSEnable plan enforcementfalse
SNODUS_FEATURES_LANDINGEnable landing page at /false
SNODUS_WEBHOOK_URLURL for budget/rate limit notifications

CLI Reference

snodus serve                         # start gateway
snodus status                        # general summary
snodus providers                     # provider status
snodus plans                         # list plans
snodus budget                        # spend vs budget per team/key
snodus account --team-id UUID        # account summary with progress

snodus teams create --name "Company" --budget 5000
snodus teams update --id UUID --budget 10000
snodus users create --email x@y.com --name "Mario" --team-id UUID --role admin
snodus keys  create --user-id UUID --name "dev" --rate-limit 60 --budget 5000
snodus keys  rotate --id UUID         # generate new, old expires in 24h
snodus keys  revoke --id UUID

Snodus v0.1.0 — github.com/42NE-Ltd/snodus — MIT