added router details to usage endpoint

This commit is contained in:
William Stuckey
2026-03-27 11:04:42 -05:00
parent c8777b45ff
commit c01e1a6e87
2 changed files with 345 additions and 0 deletions
+9
View File
@@ -675,12 +675,21 @@ const server = createServer(async (req, res) => {
notes.push("Anthropic has no public balance API — check console.anthropic.com");
notes.push("Z.ai is flat-rate; no balance API available");
// Build routing summary (the 3 Claude Code / Roo Code tiers)
const routing = {
sonnet: { provider: "zai", model: "glm-4.7", description: "Daily workhorse (Z.ai flat-rate)" },
opus: { provider: "anthropic", model: "claude-opus-4-6", description: "Complex tasks (Anthropic pay-per-token)" },
haiku: { provider: "deepseek", model: "deepseek-chat", description: "Trivial/fast tasks (DeepSeek cheap tier)" },
default: { provider: "zai", model: "glm-4.7", description: "Unknown models fall back here" },
};
res.writeHead(200, { "content-type": "application/json" });
res.end(
JSON.stringify({
service: "ein-ai-proxy",
generatedAt: new Date().toISOString(),
currentPeriod,
routing,
providers,
totals: {
...totals,