Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors
TypeScript a2aai-agentsai-gatewayanthropicclaudeclaude-codeclinecodexcopilotcursordeepseekfree-aigeminikimillm-gatewaymcpopenaiopenai-proxyqwentoken-saver
#7778 hierarchical admission cleanup plan
- Lock the existing single-key semaphore contract and the new atomic multi-key contract with focused tests: no partial reservations, FIFO queueing, abort, timeout, queue-full, idempotent release, stats, and cleanup.
- Generalize the existing account semaphore in place. Keep
acquire()as a compatibility wrapper aroundacquireMany(); do not add a second scheduler or a dependency. - Replace the account-only acquisition in
chatCorewith one cumulative global/provider/account acquisition immediately beforewithRateLimit. Reacquire the whole set whenever account rotation changes the connection, and retain the release through streaming completion. - Extend the existing resilience settings pipeline (types, defaults, normalization, schema, API response, UI, and translations) with the global and provider caps. Relabel the old Bottleneck concurrency control as connection/quota-scope concurrency so its real scope is explicit.
- Run focused tests, lint, typecheck, static checks, and the full test suite; document the behavioral change in the changelog.
Behavior intentionally preserved: zero/null concurrency bypasses a gate,
account-only callers keep using acquire(), blocked-account controls retain
their key format and API, and provider rate-limit queue behavior remains
unchanged.