Categories
Self-Hosted LLM Gateway Load Balancer AI Developer Tools Usage Analytics API Proxy OpenAI Compatible Codex CLIStars
Forks
Watchers
Developer links
codex-lb
codex-lb turns a handful of ChatGPT accounts into one dependable endpoint for Codex CLI, OpenCode, OpenClaw, Hermes Agent, and any OpenAI-compatible client. Accounts join through an OAuth flow, and the dashboard shows each one's 5-hour and weekly quota as percent remaining, with reset times, plan, and a seven-day trend. Eight routing strategies, including capacity weighted, round robin, and sequential drain, pick an account per request, and sticky threads keep a session on the same account to preserve warm prompt caches. API keys carry expiry dates, model allowlists, reasoning-effort policies, per-account scoping, and token or cost limits per day, week, or month. Overview cards chart requests, tokens, cached share, estimated cost, error rate, and a weekly credit pace, and a searchable request log lists the model, transport, status, tokens, and cost of every call. A cost report breaks spend down by day, model, user agent, and account, with time to first token and tokens per second charts. Dashboard access is protected by a password with optional TOTP, a read-only guest mode, roles, and invites. Settings cover reset-credit handling, upstream proxy pools, model sources, a firewall, and a quota planner, and light and dark themes are built in. Running on a dedicated VPS on RepoCloud with guaranteed CPU, RAM, and SSD, full root SSH access, and a browser serial console. MIT licensed.
Benefits
- Never Stall On One Quota
- Requests spread across every pooled account by quota headroom and reset timing, so a long coding session keeps moving when a single account hits its 5-hour limit.
- One Endpoint For Every Client
- Point Codex CLI, OpenCode, OpenClaw, Hermes Agent, or the OpenAI Python SDK at the same base URL, and each tool shares the pool without separate logins.
- See Exactly What You Spend
- Dashboards and cost reports total requests, tokens, cached share, and estimated dollars per day, model, user agent, and account, so heavy users and error spikes are easy to find.
- Scoped Keys For Teammates
- Issue API keys with expiry dates, model allowlists, reasoning-effort policies, and token or cost caps, and bind a key to chosen accounts so shared access stays predictable.
Features
- Quota-Aware Routing
- Choose from eight routing strategies, keep sticky threads for cache locality, and prefer accounts that reset sooner, all changed live from the dashboard without a restart.
- Account Pool Manager
- Add accounts through OAuth, then search, filter, and sort them by status or reset credits, and inspect usage, trends, and proxy bindings for each one.
- Request Log Explorer
- Filter calls by account, API key, model, or status, and read tokens, cached tokens, cost, transport, and error details for every proxied request.
- Cost And Speed Reports
- Compare cost, tokens, requests, time to first token, and tokens per second across seven, thirty, or ninety days, with filters for accounts, keys, models, and user agents.
- Secure Dashboard Access
- Protect the dashboard with a password and optional TOTP, share a read-only guest view, and manage roles, invites, and a first-run bootstrap token for remote setup.