Everything You Need for Enterprise AI
Aliases That Do Not Go Stale
fast, balanced and best are constraints, not pins — capability, context window and price, re-resolved against the live catalogue. A chain hardcoded to last year's model decays; a constraint does not.
Circuit Breaker & Failover
Ordered fallback chains, key rotation inside a provider on a 429, and a breaker scoped to one tenant, provider and model — so an outage costs one timeout rather than every caller's.
Provider Keys Never Leave
Your application holds a cg- key. The upstream credential is returned by no route, written to no disk, and printed in no log line.
True Multi-Tenancy
Per-tenant providers, aliases, routing rules, quotas, rate limits and usage — with the admin plane separated from the data plane by the key itself, not by the address.
OpenAI, Gemini, Claude and the rest
Register a key. Gemini and Claude need nothing else: their endpoints are built in. One adapter covers OpenAI, Together, Groq, Fireworks, OpenRouter, Azure OpenAI, vLLM, Ollama and LM Studio. Pool several keys and they rotate.
Usage You Can Bill From
Every served request metered to PostgreSQL — tokens, cost, provider, model, fallback depth — buffered through an analytics outage and idempotent on retry.
Polyglot Design for Maximum Performance
Two processes, one job each. The gateway is Go 1.26 on Fiber: it authenticates, routes, meters and relays, holding its own configuration in memory so the request path never waits on a database. The analytics engine is Java 25 on Spring Boot 4.1 with virtual threads, and owns the one thing a restart must not lose — usage.
curl -X POST http://localhost:8080 /v1/chat/completions \
-H 'Authorization: Bearer cg-abc123' \
-d '{
"model": "gpt-4",
"messages": [{
"role": "user",
"content": "Hello, CogniGate!"
}]
}'
Up and Running in One Command
Prerequisites: Docker and Docker Compose. No Java or Go installation needed.
Install & Start
# Linux/macOS: curl -sSL https://cognigate.vkrishna04.me/install.sh | bash # Windows PowerShell: irm https://cognigate.vkrishna04.me/install.ps1 | iex
Create a Tenant
# CG_ADMIN is GATEWAY_BOOTSTRAP_KEY from the generated .env
curl -X POST http://localhost:8080/admin/v1/tenants \
-H "Authorization: Bearer $CG_ADMIN" \
-H "Content-Type: application/json" \
-d '{"name":"my-org"}'
# → {"id":"ten_9f2c41ab77d0","name":"my-org","status":"active",...}Mint a Key, Register a Provider
# the cg- key your application will hold
curl -X POST http://localhost:8080/admin/v1/tenants/ten_9f2c41ab77d0/keys \
-H "Authorization: Bearer $CG_ADMIN" \
-H "Content-Type: application/json" \
-d '{"name":"laptop"}'
# the provider credential, which stays in the deployment
curl -X POST http://localhost:8080/admin/v1/tenants/ten_9f2c41ab77d0/providers \
-H "Authorization: Bearer $CG_ADMIN" \
-H "Content-Type: application/json" \
-d '{"name":"openai","base_url":"https://api.openai.com/v1","keys":["sk-..."]}'Start Routing AI Traffic
curl -X POST http://localhost:8080/v1/chat/completions \
-H "Authorization: Bearer $CG_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"fast","messages":[{"role":"user","content":"Hello!"}]}'
# fast is an alias: X-CogniGate-Served-By says what it resolved to