← 开源

Codex/ChatGPT multiple account load balancer & proxy with usage tracking, dashboard, and OpenCode-compatible endpoints

InfrastructureObservabilityGatewayPython
增长势头
+424 小时新增 Star+0.1%
3.45k
Star
564
Fork
+21
本周
100
贡献者
创建于 2026-01-07 · 更新于 2026-11-19 · 今日第 2628 名
主要开发者
README

codex-lb

English | 简体中文

Load balancer for ChatGPT accounts. Pool multiple accounts, track usage, manage API keys, view everything in a dashboard.

Documentation: https://soju06.github.io/codex-lb/ — getting started, client setup, configuration, deployment, troubleshooting, and more screenshots.

Features

Account Pooling
Load balance across multiple ChatGPT accounts
Usage Tracking
Per-account tokens, cost, 28-day trends
API Keys
Per-key rate limits by token, cost, window, model
Dashboard Auth
Password + optional TOTP
OpenAI-compatible
Codex CLI, OpenCode, any OpenAI client
Auto Model Sync
Available models fetched from upstream

Quick Start

# Docker (recommended)
docker volume create codex-lb-data
docker network inspect codex-lb-net >/dev/null 2>&1 || docker network create codex-lb-net
docker run -d --name codex-lb \
  --network codex-lb-net \
  -p 2455:2455 -p 1455:1455 \
  -v codex-lb-data:/var/lib/codex-lb \
  ghcr.io/soju06/codex-lb:latest

# or uvx
uvx codex-lb

# or nix
nix run github:Soju06/codex-lb

Open localhost:2455 → Add account → Done.

Accessing the dashboard remotely for the first time? You need a one-time bootstrap token — see Getting started.

Client Setup

Point any OpenAI-compatible client at codex-lb. For Codex CLI, ~/.codex/config.toml:

model = "gpt-5.6-sol"
model_reasoning_effort = "xhigh"
model_provider = "codex-lb"

[model_providers.codex-lb]
name = "openai"  # required — enables remote /responses/compact. Lowercase since Codex 2026-05-23; older "OpenAI" stops resolving gpt-5.5
base_url = "http://127.0.0.1:2455/backend-api/codex"
wire_api = "responses"
supports_websockets = true
supports_standalone_web_search = true # requires codex-lb >= 1.22.0
requires_openai_auth = true # required for codex app
Logo Client Endpoint Guide
Codex CLI / IDE http://127.0.0.1:2455/backend-api/codex Client setup → Codex CLI
OpenCode http://127.0.0.1:2455/v1 Client setup → OpenCode
OpenClaw http://127.0.0.1:2455/v1 Client setup → OpenClaw
Hermes Agent http://127.0.0.1:2455/v1 Client setup → Hermes Agent
OpenAI Python SDK http://127.0.0.1:2455/v1 Client setup → Python SDK

Remote clients need an API key created from the dashboard.

Configuration

Environment variables with CODEX_LB_ prefix or .env.local — see .env.example and the configuration guide. SQLite is the default database backend; PostgreSQL is optional via CODEX_LB_DATABASE_URL.

Data

Environment Path
Local / uvx ~/.codex-lb/
Docker /var/lib/codex-lb/

Backup this directory to preserve your data.

Documentation

Full docs live at https://soju06.github.io/codex-lb/:

Community companions

Independent projects that consume the dashboard API, maintained outside codex-lb (see the docs listing for access guidance):

  • Codex LB Status Bar — native macOS app: account status, quota details, account controls
  • codex-lb SwiftBar — read-only SwiftBar/Bun monitor for pool status and quota headroom
  • Codex LB Status — read-only Ubuntu tray monitor for pooled quota, account health, reset credits, and update state
  • Codex LB for Omarchy — read-only Linux/Omarchy Quattro bar plugin for account quotas, usage totals, reset times, and optional desktop alerts
  • Codex-LB Rates — Home Assistant integration for pool and per-account quota remaining sensors (5h / weekly / monthly)

Development

# Docker
docker compose watch

# Local
uv sync && cd frontend && bun install && cd ..
uv run codex-lb                              # backend :2455
cd frontend && bun run dev                   # frontend :5173

# Nix
nix run .
nix develop # enter dev environment

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Amin

💻

JanPlessow

💻

Alessandro Benassi

💻

ngallodev

💻

Max Kaplan

💻

Sezai Enes YILDIZHAN

💻

Shuhul

💻 ⚠️ 📖

Soju06

💻 ⚠️ 🚧 🚇

Jonas Kamsker

💻 🐛 🚧

Quack

💻 🐛 🚧 🎨

Jill Kok, San Mou

💻 ⚠️ 🚧 🐛

PARK CHANYOUNG

📖 💻 ⚠️

Choi138

💻 🐛 ⚠️

LYA⚚CAP⚚OCEAN

💻 ⚠️

Eugene Korekin

💻 🐛 ⚠️

jordan

💻 🐛 ⚠️

DOCaCola

🐛 ⚠️ 📖

JoeBlack2k

💻 🐛 ⚠️

Peter A.

📖 💻 🐛

Hannah Markfort

💻 ⚠️

mws-weekend-projects

💻 ⚠️

Quang Do

💻 ⚠️

Anand Aiyer

🐛 💻 ⚠️

defin85

💻 🐛 ⚠️

Jacky Fong

💻 🐛 💬 🚧 ⚠️

flokosti96

💻 ⚠️

Woonggi Min

💻 ⚠️

Yigit Konur

🐛 💻

Ruben

💻 ⚠️ 🐛

Steve Santacroce

💻 ⚠️ 🐛

Hugh Do

💻 ⚠️

Hubert Salwin

💻 ⚠️

Teemu Koskinen

📖

Yu Peng Zheng

📖 💻

embogomolov

💻 ⚠️

Renat Sharipov

💻 ⚠️

Liu Rui

📖 💻 ⚠️ 🐛

OverHash

💻 ⚠️

Kazet

💻 ⚠️

Bala Kumar

💻 ⚠️ 🤔

ihazgithub

💻 ⚠️

Temirkhan

💻 ⚠️ 📖 🐛

tobwen

💻 ⚠️ 🐛

Rio

💻 🐛 ⚠️

Mika

💻 📖 ⚠️

Darafei Praliaskouski

💻 📖 ⚠️ 🐛

Maxim Feofilov

💻 ⚠️

klaascommerce

💻 ⚠️

JeffKandt

⚠️ 👀

ozpool

🤔 📖 💻 ⚠️

Manu

⚠️ 👀

Wojtek Majewski

⚠️

Andrew Noble

💻 ⚠️

Josu Gorostegui

💻 ⚠️

Linus Mixson

💻 ⚠️

timefox

💻 ⚠️

Lotfree

💻 ⚠️ 📖 🐛

hikki

💻 🎨

Miha Orazem

💻 ⚠️

Nikhil

💻 ⚠️

onlysdesign-ui

💻 ⚠️

Steven (Minh) Dang

📖

Nataprom

💻 ⚠️

Iweisc

💻 ⚠️

Mahir Taha Özdin

🤔 💻 ⚠️

ram/haidar

💻

Rudra Tiwari

💻

Wu Chao

💻

zwd0313

💻

mastertyko

💻 ⚠️

Diógenes Castro

💻 ⚠️

jhordanjw123

💻 ⚠️

abarsegov

💻

Akshay Kakatkar

💻 ⚠️

NeoClaw

💻

plastictaste

💻 ⚠️ 📖

softkleenex

💻 ⚠️

n3crosis

💻 ⚠️

geoHeil

💻 ⚠️

copilot

💻

mercenarioZ

💻 ⚠️

Rubén Pérez Bachiller

💻 ⚠️ 🐛

Guanwei Chen

💻 ⚠️

Jonáš Sivek

💻 ⚠️

落叶

💻 📖 ⚠️ 🌍

jawwadfirdousi

💻 ⚠️

Quang Do

💻 ⚠️

zvladru

💻 ⚠️

Hwanmoo Yong

💻 ⚠️

Abdullah Alzeiby

💻 ⚠️

anime girl

💻 ⚠️

evaldass

💻 ⚠️

Claude

💻

luawl

💻 ⚠️

Shawn

💻

Hafiy

💻 ⚠️ 📖

Choong Jun Jin

💻 ⚠️

knightcn1983

💻 ⚠️

Kevin van Zonneveld

💻

Roman Leventov

💻

AliReza Tofighi

📖

DOMANHDUC

💻

Kwan Perry

💻

James

💻 ⚠️

SSY

💻 ⚠️ 📖

monsterlag

💻

Fatih Özbek

💻 ⚠️

Kushida

💻 ⚠️

Aidid Haiqal

💻 ⚠️

yshishenya

💻

alchemistkiv

💻 ⚠️

mhooooo

💻 ⚠️

crowscc

💻

Syakur Rahman

💻 ⚠️

cigro-manager

💻

Paul Eipper

💻 ⚠️ 📖

ret2basic.eth

💻 ⚠️

유영준

💻 ⚠️

mrnaturalmonopoly-prog

💻 ⚠️

mrunnaturalmonopoly-svg

💻 ⚠️

HulianBuligon

💻 ⚠️

joschi655

💻 ⚠️

daydreamer.jin

💻 ⚠️ 📖

rknightion

💻 ⚠️

glopyglerky

💻 ⚠️

Ahmad Maulana Iqbal

💻 ⚠️

Dvredin

💻

DuyBui

💻 ⚠️

Kevin Lin

💻 ⚠️

Borealin

💻 ⚠️

Nikita Maximilian Grimm

💻 📖 ⚠️

BrenticusMaximus

💻 ⚠️

Sakthimaran

💻 ⚠️

Evan

💻

Chao Xu

💻 ⚠️

zenasharp

💻 ⚠️ 📖

HanSu Lee

💻 ⚠️

Derek Pearson

💻

JustYannicc

💻 ⚠️ 📖

ygx

💻 ⚠️

Mustafa J

💻 ⚠️ 📖

Aarav

💻

Evan Haug

💻 ⚠️

Jason HONG

💻

kostazol

💻 ⚠️

Mohammad Saleh Mahdinejad

💻 ⚠️ 🐛 📖

Muhammad Ilham Dedi

💻 🐛 ⚠️

phuongdung160114-ux

💻 ⚠️ 📖

Victor Statko

📖

Nohj

💻 🐛 ⚠️

flameboy

📖

elmakus

💻 ⚠️ 🐛

Abaddollyon

💻 ⚠️

Markus Jakl

💻 ⚠️ 🐛

Felix Cake

💻

Tsury

💻 ⚠️ 📖

Uniskela

📖

nhdong1993

💻

Vincent Dev

💻

Younes Beriane

💻

⃟

💻 ⚠️ 📖

Justike001

💻 ⚠️

justikeVoltage

💻

alinne

💻

Hao-Liang Wen

💻 ⚠️

SantaDiegoKairos

💻

Smit Patel

💻 ⚠️ 📖

hanmin6

📖 💻 ⚠️

This project follows the all-contributors specification. Contributions of any kind welcome!

排名相邻
同类项目

AI Rank iPhone 版

随时追踪 AI 模型榜单

在 App Store 下载