Account pooling. Pooling several upstream accounts behind one endpoint may conflict with the terms of the upstream services, so confirm you are allowed to do this before you add accounts.
Credentials. The dashboard stores upstream account data and API keys in the data volume, so protect that volume and the admin port.
Who it is forA developer or small team that wants one local endpoint for Codex and OpenAI-compatible clients, backed by several upstream accounts they control.
The problemSingle upstream accounts hit quota limits or drop long Codex sessions, and each client needs its own setup.
The outcomeA running gateway at localhost:2455 with accounts added, an API key created, and a persistent SQLite data volume.
What you need first
- Docker installed and running, or uv installed for running from source
- Upstream ChatGPT accounts you are authorized to use, to add in the dashboard
- A browser to open the dashboard at localhost:2455
- Codex CLI, desktop, or IDE integration, or another OpenAI-compatible client, if you plan to connect one
Steps
- Create the Docker network if it does not exist:
docker network inspect codex-lb-net >/dev/null 2>&1 || docker network create codex-lb-net - Create the data volume:
docker volume create codex-lb-enhanced-data - Start the container:
docker run -d --name codex-lb-enhanced --restart unless-stopped -e CODEX_LB_HTTP_RESPONSES_SESSION_BRIDGE_AMBIGUOUS_CONTINUATION_RECOVERY_MODE=server_indefinite_recovery --network codex-lb-net -p 2455:2455 -p 1455:1455 -v codex-lb-enhanced-data:/var/lib/codex-lb ghcr.io/aafqaq/codex-lb-enhanced:1.25.3(inferred, check the README) - Open http://localhost:2455, complete initialization, and add your accounts.
- Create an API key in the dashboard and save it for your clients.
Prompt for your agent
In the aafqaq/codex-lb-enhanced repo, run the Docker quick start to start the gateway as the container named codex-lb-enhanced, using the target directory <workdir>. Report the container status from `docker ps` and confirm that http://localhost:2455 responds. Verify that the data volume codex-lb-enhanced-data exists before you finish.
Caveat. The README says account-pool switching can still occasionally fail to recover, so check important sessions instead of trusting failover blindly.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for aafqaq/codex-lb-enhanced and "Run a self-hosted Codex account-pool gateway with Docker"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer