Skip to main content

Codex load balancer and proxy for ChatGPT accounts with usage dashboard

Project description

codex-lb

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

Screenshots

Main Dashboard View

main dashboard view

Accounts View

Accounts list and details

Quick Start

Docker

docker run -d --name codex-lb \
  -p 2455:2455 -p 1455:1455 \
  -v ~/.codex-lb:/var/lib/codex-lb \
  ghcr.io/soju06/codex-lb:latest

If you expect high traffic (60+ requests/min), prefer a Docker volume for the data directory to reduce SQLite I/O errors on some hosts.

docker volume create codex-lb-data
docker run -d --name codex-lb \
  -p 2455:2455 -p 1455:1455 \
  -v codex-lb-data:/var/lib/codex-lb \
  ghcr.io/soju06/codex-lb:latest

uvx

uvx codex-lb

Open localhost:2455 → Add account → Done.

Codex CLI & Extension Setup

Add to ~/.codex/config.toml:

model = "gpt-5.2-codex"
model_reasoning_effort = "xhigh"
model_provider = "codex-lb"

[model_providers.codex-lb]
name = "OpenAI"  # MUST be "OpenAI" - enables /compact endpoint
base_url = "http://127.0.0.1:2455/backend-api/codex"
wire_api = "responses"
chatgpt_base_url = "http://127.0.0.1:2455"
requires_openai_auth = true  # Required: enables model selection in Codex IDE extension

OpenCode Setup

Run:

opencode auth login

Then select OpenAI -> Manually enter API Key and enter any value.

Add the following to ~/.config/opencode/opencode.json:

{
  ...
  "provider": {
    "openai": {
      "options": {
        "baseURL": "http://127.0.0.1:2455/v1"
      }
    },
    ...
  }
}

Configuration

All settings use the CODEX_LB_ prefix and can be set via environment variables or .env.local.

Dashboard TOTP

Protect the dashboard with TOTP two-factor authentication.

  1. Set CODEX_LB_DASHBOARD_SETUP_TOKEN to any secret string:
CODEX_LB_DASHBOARD_SETUP_TOKEN=my-secret-token
  1. Open the dashboard and go to Settings to enable TOTP.
  2. Scan the QR code with your authenticator app and confirm.

Once enabled, the dashboard requires a TOTP code on every login. TOTP can be disabled from Settings while logged in.

Data

Data storage locations:

  • Local/uvx: ~/.codex-lb/
  • Docker: /var/lib/codex-lb/

Files:

  • store.db – accounts, usage logs
  • encryption.key – encrypts tokens (auto-generated)

Backup this directory to preserve your accounts.

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Soju06
Soju06

💻 ⚠️ 🚧 🚇
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

💻 ⚠️

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

codex_lb-0.6.0.tar.gz (847.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

codex_lb-0.6.0-py3-none-any.whl (156.7 kB view details)

Uploaded Python 3

File details

Details for the file codex_lb-0.6.0.tar.gz.

File metadata

  • Download URL: codex_lb-0.6.0.tar.gz
  • Upload date:
  • Size: 847.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for codex_lb-0.6.0.tar.gz
Algorithm Hash digest
SHA256 ba45763ad84bb159eb7d72489623e847c590728cc387d942c03f69bad6a41976
MD5 aeefdb3254bb73450e73fb75a5e6d98a
BLAKE2b-256 029e8b5302281d9b5cfa11c350a7692a20034596eb22d01d4a0330c5daa63875

See more details on using hashes here.

Provenance

The following attestation bundles were made for codex_lb-0.6.0.tar.gz:

Publisher: release.yml on Soju06/codex-lb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file codex_lb-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: codex_lb-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 156.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for codex_lb-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f660059729b922371d54161a217bd531e90815286e07457f5993ac1d7cdb72bb
MD5 297d897acfd29414e5c3409d39526777
BLAKE2b-256 e720447d498280b6797f0b7013b76fe55bd1c8e95463d65996a5e0fe480f6e90

See more details on using hashes here.

Provenance

The following attestation bundles were made for codex_lb-0.6.0-py3-none-any.whl:

Publisher: release.yml on Soju06/codex-lb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page