Commit Graph

5 Commits

Author SHA1 Message Date
William Stuckey f31a89f10c fix: track usage for all providers, not just when tokens extracted
- Rewrote extractUsageFromSSE() to parse data: lines directly instead of
  buggy indexOf-based event/data pairing that silently failed for Z.ai
  and DeepSeek SSE formats
- Always call recordUsage() on successful responses even when token
  extraction yields 0 — ensures request counts are tracked
- Added console.warn when token extraction fails for debugging
2026-03-27 11:38:59 -05:00
William Stuckey c01e1a6e87 added router details to usage endpoint 2026-03-27 11:04:42 -05:00
William Stuckey c8777b45ff updated api return 2026-03-27 10:59:28 -05:00
William Stuckey e7fe5732b7 Add /usage endpoint with token tracking, live balances, and cost calculations 2026-03-26 19:43:34 -05:00
harrison 7fc0bafb01 Initial commit: ein-ai-proxy
Anthropic-compatible API proxy that routes requests to multiple
providers (Anthropic, Z.ai/GLM-4.7, DeepSeek V3.2) based on
model name. Zero dependencies, SSE streaming, bearer token auth.

Designed to run behind Caddy/nginx on a home server, enabling
Claude Code and Roo Code clients to connect from anywhere.
2026-03-26 13:54:22 -05:00