Kaixu Gateway
Admin dashboard · virtual keys · sub-keys · spend caps · SSE · Stripe
Admin login
Password comes from ADMIN_PASSWORD.
v5 adds universal caps, per-device seats, allowlists, exports, invoice snapshots, Stripe top-ups, and stronger rate limiting.
Customers
| ID | Plan | Monthly cap | Active | Active keys | Created |
|---|
Click a customer row to prefill Customer ID for Keys/Usage.
Create customer + issue master key
Key (copy now)
Shown once. Store securely.
Keys (Sub-keys / Rotate / Revoke)
Tip: pick a customer from the dropdown so you don’t have to type IDs.
No keys found for this customer yet. Create one below ("Create sub-key").
| ID | Last4 | Label | Cap override | RPM override | Max devices | Require install | Allowed providers | Allowed models | Revoked | Created | Actions |
|---|
Create sub-key
Sub-key (copy now)
Shown once. Store securely.
Rotate = create a new key with same settings and revoke the old key. Revoke = immediate cutoff.
Usage
Cap
$0
Extra
$0
Spent
$0
Tokens
0
| Time | Provider | Model | Input | Output | Cost (cents) |
|---|
SSE endpoint: POST /.netlify/functions/gateway-stream
Billing & Controls
Customer policy
Top-ups
Manual top-ups credit extra_cents. Stripe checkout requires Stripe env vars + webhook.
Invoice snapshot
—
Devices
| Key | Install ID | First seen | Last seen | Revoked | User-Agent | Action |
|---|
Exports & Invoices
Downloads use your admin password header, so they fetch and save locally.
Integration
Non-stream
POST /.netlify/functions/gateway-chat
Streaming (SSE)
POST /.netlify/functions/gateway-stream
Client opens EventSource-like stream via fetch and reads SSE frames (event/meta/delta/done).
Normalized request
{
"provider": "openai" | "anthropic" | "gemini",
"model": "...",
"messages": [{"role":"user","content":"Hello"}],
"max_tokens": 256,
"temperature": 0.7
}
SSE events
event: meta
data: {"provider":"openai","model":"gpt-4o-mini","month":{"month":"2026-02","cap_cents":2000,"spent_cents":0,"key_cap_cents":500,"key_spent_cents":12}}
event: delta
data: {"text":"Hel"}
event: delta
data: {"text":"lo!"}
event: done
data: {"usage":{"input_tokens":12,"output_tokens":18,"cost_cents":1},"month":{"month":"2026-02","cap_cents":2000,"spent_cents":1,"key_cap_cents":500,"key_spent_cents":13}}
This build is Netlify DB-native (Neon) and uses an in-house DB-backed rate limiter (no Redis required).