Observed since 21 Oct, 09:01 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Multi-provider LLM gateway with unified API, dashboard, and key rotation
Multi-provider LLM gateway with unified OpenAI-compatible API, key rotation, real-time dashboard, and budget tracking.
npm install -g @0xki/kirouter
kirouter
Dashboard: http://localhost:8090
/v1/chat/completions for all providerskirouter # Start on port 8090
kirouter --port 3000 # Start on custom port
kirouter --update # Check for updates and install
kirouter --version # Show version
kirouter --help # Show help
npm i -g @0xki/kirouter@latest --prefer-online
curl http://localhost:8090/v1/chat/completions \
-H "Authorization: Bearer $(cat ~/.kirouter/.gateway_key)" \
-H "Content-Type: application/json" \
-d '{
"model": "openai/gpt-4o",
"messages": [{"role": "user", "content": "Hello!"}]
}'
Model format: {provider}/{model_id} — e.g., openai/gpt-4o, anthropic/claude-opus-4-6, grok/grok-chat-fast
Data is stored in ~/.kirouter/ (auto-created):
~/.kirouter/
├── .gateway_key # Auto-generated API/admin key (chmod 600)
├── providers.json # Provider configs and API keys
├── provider-key-stats.json # Provider-key usage and budget state
└── ki-gateway.db # SQLite request and audit logs
| Variable | Default | Description |
|---|---|---|
KIGW_PORT | 8090 | Gateway port (--port sets this) |
KIGW_DATA_DIR | ~/.kirouter | Mutable state directory |
PORT | — | Legacy port alias; KIGW_PORT wins |
KIGW_HOST | 127.0.0.1 | Listen address |
KI_DATA_DIR | — | Legacy data-directory alias |
KI_GATEWAY_VERSION | package version | Version string |
KIGW_SESSION_TTL_MS | 86400000 | Admin-session lifetime in milliseconds |
KIGW_MAX_ADMIN_SESSIONS | 100 | Maximum concurrent in-memory admin sessions (oldest idle session is evicted) |
KIGW_TRUST_PROXY | 0 | Trust sanitized X-Forwarded-Host/X-Forwarded-Proto from a controlled reverse proxy |
KIGW_FORCE_SECURE_COOKIES | 0 | Force Secure admin cookies behind a trusted HTTPS proxy |
KIGW_ALLOW_SESSION_NO_ORIGIN | 0 | Allow session mint/write without Origin only for controlled local tools/tests |
KIGW_CHAT_BODY_LIMIT | 2097152 | Maximum /v1/chat/completions JSON body (2 MiB) |
KIGW_ADMIN_BODY_LIMIT | 1048576 | Maximum normal admin JSON body (1 MiB) |
KIGW_RESTORE_BODY_LIMIT | 8388608 | Maximum restore JSON body (8 MiB) |
KIGW_ALLOW_PRIVATE_NETWORKS | 0 | Explicitly allow custom private/loopback upstreams and proxies; keep disabled unless trusted |
The browser exchanges the gateway master key for an opaque, server-side admin session. The master key is not persisted in localStorage, cookies, or SSE URLs. Mutating dashboard requests require both a CSRF token and a matching same-origin Origin/Referer; logout revokes the server session.
Configuration backups use schema version 2 and redact provider keys, credential-bearing proxy URLs, and error details. Plaintext secret export is unsupported. Restore validates the full document and reuses redacted keys that already exist on the same instance; it does not migrate secrets to a fresh host. Provider configuration and key statistics are staged together; an on-disk restore journal completes an interrupted two-file replacement on the next startup.
KiRouter defaults to port 8090. Port 20128 is reserved for 9router in Ki’s stack and is not used as the KiRouter default.
Custom provider and proxy URLs are restricted to public HTTP(S) destinations by default to reduce SSRF risk. Private, loopback, link-local, metadata, multicast, and reserved destinations require the explicit KIGW_ALLOW_PRIVATE_NETWORKS=1 opt-in. DNS is checked and pinned for direct requests, redirects are revalidated, and proxied redirects are rejected. The default local grok2api upstream therefore also requires this opt-in.
When an upstream is reached through a remote HTTP(S) proxy, KiRouter validates both the configured upstream and proxy endpoint before dispatch, but the remote proxy ultimately resolves the CONNECT destination itself. End-to-end DNS pinning therefore applies only to direct requests. Use only trusted remote proxies with their own private-network/metadata egress controls.
git clone https://github.com/0xKii/kirouter.git
cd kirouter
npm install
npm install -g .
kirouter
MIT © 2026 0xki
Download counts and popularity will appear here as the collector receives them.
This describes our collected data; it is not a security assessment.
Observed since 21 Oct, 09:01 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:21f86262bd7474f78c74e60b426a4c2e6ecf232169fde263b58b00f08da77d3e