Skip to content

Soju06/codex-lb

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

898 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

codex-lb

English | 简体中文

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

dashboard accounts

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

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
requires_openai_auth = true # required for codex app
Logo Client Endpoint Guide
OpenAI Codex CLI / IDE http://127.0.0.1:2455/backend-api/codex Client setup → Codex CLI
OpenCode (Anomaly) OpenCode http://127.0.0.1:2455/v1 Client setup → OpenCode
OpenClaw OpenClaw http://127.0.0.1:2455/v1 Client setup → OpenClaw
Hermes Agent (Nous Research) Hermes Agent http://127.0.0.1:2455/v1 Client setup → Hermes Agent
Python 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/:

Development

# Docker
docker compose watch

# Local
uv sync && cd frontend && bun install && cd ..
uv run fastapi run app/main.py --reload        # backend :2455
cd frontend && bun run dev                     # frontend :5173

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Soju06
Soju06

💻 ⚠️ 🚧 🚇
Hwanmoo Yong
Hwanmoo Yong

💻 ⚠️
Jonas Kamsker
Jonas Kamsker

💻 🐛 🚧
Quack
Quack

💻 🐛 🚧 🎨
Jill Kok, San Mou
Jill Kok, San Mou

💻 ⚠️ 🚧 🐛
PARK CHANYOUNG
PARK CHANYOUNG

📖 💻 ⚠️
Choi138
Choi138

💻 🐛 ⚠️
LYA⚚CAP⚚OCEAN
LYA⚚CAP⚚OCEAN

💻 ⚠️
Diógenes Castro
Diógenes Castro

💻 ⚠️
Eugene Korekin
Eugene Korekin

💻 🐛 ⚠️
jordan
jordan

💻 🐛 ⚠️
DOCaCola
DOCaCola

🐛 ⚠️ 📖
JoeBlack2k
JoeBlack2k

💻 🐛 ⚠️
Peter A.
Peter A.

📖 💻 🐛
Hannah Markfort
Hannah Markfort

💻 ⚠️
mws-weekend-projects
mws-weekend-projects

💻 ⚠️
Quang Do
Quang Do

💻 ⚠️
Anand Aiyer
Anand Aiyer

🐛 💻 ⚠️
defin85
defin85

💻 🐛 ⚠️
Jacky Fong
Jacky Fong

💻 🐛 💬 🚧 ⚠️
flokosti96
flokosti96

💻 ⚠️
Woonggi Min
Woonggi Min

💻 ⚠️
Yigit Konur
Yigit Konur

🐛 💻
Ruben
Ruben

💻 ⚠️ 🐛
Steve Santacroce
Steve Santacroce

💻 ⚠️ 🐛
Hugh Do
Hugh Do

💻 ⚠️
Hubert Salwin
Hubert Salwin

💻 ⚠️
Teemu Koskinen
Teemu Koskinen

📖
Yu Peng Zheng
Yu Peng Zheng

📖 💻
embogomolov
embogomolov

💻 ⚠️
Renat Sharipov
Renat Sharipov

💻 ⚠️
Liu Rui
Liu Rui

📖 💻 ⚠️ 🐛
OverHash
OverHash

💻 ⚠️
Kazet
Kazet

💻 ⚠️
Bala Kumar
Bala Kumar

💻 ⚠️ 🤔
ihazgithub
ihazgithub

💻 ⚠️
Temirkhan
Temirkhan

💻 ⚠️ 📖 🐛
tobwen
tobwen

💻 ⚠️ 🐛
Rio
Rio

💻 🐛 ⚠️
Mika
Mika

💻 📖 ⚠️
Darafei Praliaskouski
Darafei Praliaskouski

💻 📖 ⚠️ 🐛
Maxim Feofilov
Maxim Feofilov

💻 ⚠️
JeffKandt
JeffKandt

⚠️ 👀
klaascommerce
klaascommerce

💻 ⚠️
ozpool
ozpool

🤔 📖 💻 ⚠️
Manu
Manu

⚠️ 👀
Wojtek Majewski
Wojtek Majewski

⚠️
Andrew Noble
Andrew Noble

💻 ⚠️
Josu Gorostegui
Josu Gorostegui

💻 ⚠️
Linus Mixson
Linus Mixson

💻 ⚠️
Lotfree
Lotfree

💻 ⚠️ 📖 🐛
timefox
timefox

💻 ⚠️
Nikhil
Nikhil

💻 ⚠️
Miha Orazem
Miha Orazem

💻 ⚠️
Steven (Minh) Dang
Steven (Minh) Dang

📖
onlysdesign-ui
onlysdesign-ui

💻 ⚠️
Mahir Taha Özdin
Mahir Taha Özdin

🤔 💻 ⚠️
hikki
hikki

💻 🎨
Nataprom
Nataprom

💻 ⚠️
Iweisc
Iweisc

💻 ⚠️
ram/haidar
ram/haidar

💻
Rudra Tiwari
Rudra Tiwari

💻
Wu Chao
Wu Chao

💻
zwd0313
zwd0313

💻
jhordanjw123
jhordanjw123

💻 ⚠️
mastertyko
mastertyko

💻 ⚠️
NeoClaw
NeoClaw

💻
abarsegov
abarsegov

💻
Akshay Kakatkar
Akshay Kakatkar

💻 ⚠️
softkleenex
softkleenex

💻 ⚠️
mercenarioZ
mercenarioZ

💻 ⚠️
plastictaste
plastictaste

💻 ⚠️ 📖
落叶
落叶

💻 📖 ⚠️ 🌍
n3crosis
n3crosis

💻 ⚠️
copilot
copilot

💻
geoHeil
geoHeil

💻 ⚠️
Jonáš Sivek
Jonáš Sivek

💻 ⚠️
Rubén Pérez Bachiller
Rubén Pérez Bachiller

💻 ⚠️ 🐛
Guanwei Chen
Guanwei Chen

💻 ⚠️
jawwadfirdousi
jawwadfirdousi

💻 ⚠️
Quang Do
Quang Do

💻 ⚠️
Abdullah Alzeiby
Abdullah Alzeiby

💻 ⚠️
zvladru
zvladru

💻 ⚠️
anime girl
anime girl

💻 ⚠️
evaldass
evaldass

💻 ⚠️
Claude
Claude

💻
Shawn
Shawn

💻
luawl
luawl

💻 ⚠️
knightcn1983
knightcn1983

💻 ⚠️
Hafiy
Hafiy

💻 ⚠️ 📖
Kevin van Zonneveld
Kevin van Zonneveld

💻
Choong Jun Jin
Choong Jun Jin

💻 ⚠️
Roman Leventov
Roman Leventov

💻
AliReza Tofighi
AliReza Tofighi

📖
DOMANHDUC
DOMANHDUC

💻
Kwan Perry
Kwan Perry

💻
James
James

💻 ⚠️

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

About

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

Topics

Resources

License

Contributing

Security policy

Stars

2.3k stars

Watchers

6 watching

Forks

Packages

 
 
 

Contributors