Security fix
- Admin path guard could be bypassed with capital letters or a trailing slash. Express matches routes case-insensitively and ignores a trailing slash, but the request guard and the WebUI password check compared the raw path. So requests like
/API/accounts,/HEALTHor/account-limits/reached the admin endpoints without the Host/Origin checks, the loopback-only rule or the WebUI password. This closes a gap left by the fix for GHSA-24gg-9fgv-3495 in 3.1.3. Everyone on 3.1.3 or older should upgrade.
What's New
- Google web search: Anthropic's
web_searchtool now maps to Google Search grounding, so Claude Code's WebSearch returns real results. Search-only requests run on a Gemini model even when a Claude model is picked, because Claude models through Cloud Code ignore the search tool. Grounding links are resolved throughHTTPS_PROXY, andtool_choice: noneturns web search off (#421) - Usage limits panel on the dashboard: shows each account's 5-hour and weekly limits per model group, with how much is left and when it resets (#390)
GET /v1/account-quotas: reports each account's 5-hour and weekly quota for external dashboards. It's protected by the API key or, when no key is set, by the same request guard and WebUI password as the admin endpoints (#419)- Per-account model lists: models are only routed to accounts whose tier offers them, so a model that only some accounts have is no longer rejected as "Invalid model". Each account's model list is loaded in the background at startup and every 30 minutes (
modelCatalogRefreshMs), and saved lists older than 6 hours are ignored (#420) - Keep-alive pings for slow first replies: when Google is silent for more than 10 seconds before the first token (long prompts at high effort), the proxy now sends headers and SSE pings so Claude Code doesn't time out and resend the same request. New options:
streamHeaderGraceMsandstreamPingIntervalMs(#423) - Cancel on client disconnect: when Claude Code drops a request, the upstream request is cancelled right away instead of running to the end (#423)
Fixes
- HTTPS proxy: Google API calls and token refresh now go through
HTTPS_PROXYon every Node version.HTTPS_PROXYwins overHTTP_PROXYfor https URLs, andNO_PROXYis honoured (#337) - Network errors no longer show up as quota errors: Node now prefers IPv4 (override with
DNS_RESULT_ORDER), so broken IPv6 networks no longer time out. Network errors no longer put accounts on cooldown or end in a fakeRESOURCE_EXHAUSTED; you get a clear 503 "Network error" instead, including when a token refresh can't reach Google. A 400 that only mentions "timeout" is no longer treated as a network error (#384) - Gemini structured output:
output_config.formatis handled based on what each Gemini model supports. Claude Code's streamed side queries (hooks, classifiers) no longer fail with 400 on Gemini, and a reply is no longer rejected after a fallback to Claude (#422) - Gemini thought signatures: trailing Gemini text signatures are kept and restored correctly when Claude Code replays the conversation (#397)
- Gemini non-streaming tool calls: non-streamed tool calls now return
stop_reason: "tool_use"instead of"end_turn" - Disabled accounts and 503 capacity errors: disabled or invalid accounts no longer cause endless waits. On 503 capacity errors the proxy retries up to 5 times on the same account to keep the prompt cache warm, then moves on (#378)
- Streaming retries: a request is never retried once part of the reply has been sent to the client, so replies are no longer duplicated or garbled
acc start: the server starts with the running Node binary, so version-manager shims (Volta, nvm-windows) can't make it exit silently. It reports when the port is already in use or the server exits right after launch. npm and README links now point to this repository (#409)
Contributors
Thanks to:
- @mbl9898 for the disabled-account wait and 503 capacity retry fix (#378)
- @sean0407 for preserving trailing Gemini thought signatures (#397)
- @rikbrown for
GET /v1/account-quotas(#419) and keep-alive pings with cancel on disconnect (#423) - @snowarch for Google web search grounding (#421)
- @newtonsart for Gemini structured output support (#422)