- Counts total_tokens from upstream usage (exact for both stream and
non-stream; stream sniffed via injected stream_options.include_usage)
- chars/4 estimate fallback when upstream omits usage
- Pre-check (used + prompt estimate) rejects with 429 once cap hit
- Counter persists to tempdir (survives app restart; container rebuild resets)
- DAILY_TOKEN_CAP env override; / and /health show today's usage
- Proxy was an open relay: anyone could spend the upstream Kimi quota
- Clients must send PROXY_KEY (space secret) as Bearer or x-api-key
- / and /health stay public for status checks; no upstream key material
is ever exposed in responses, headers, or error bodies
- Replace KAGGLE_TUNNEL_URL backend with Kimi for Coding API (api.kimi.com/coding)
- Auth via KIMI_API_KEY space secret (Bearer), base URL overridable via KIMI_BASE_URL
- Default model k3 when client omits one; streaming errors now surface real status codes
- Remove /update-tunnel endpoint (Kaggle-specific)
- Status page + /health now report Kimi reachability and model list