Pool multiple OpenAI Codex accounts into one unified endpoint. Automatic request routing. Real-time quota monitoring.
scrollOpenAI enforces rate limits per subscription account. With 3–5 Codex accounts (Pro, Plus, Team), you have to juggle them manually.
Manual switching when quota runs out
Don't know which account has remaining capacity
No way to aggregate throughput
For a team of 5–10 sharing a gateway, this problem multiplies.
Each Codex/ChatGPT account becomes a separate named provider. GoClaw stores refresh tokens and handles token refresh automatically.
Pick one provider as the owner, add others to codex_pool.extra_provider_names.
Configure how requests are distributed: primary first, round robin, or priority order.
Set override_mode: "inherit" — agent automatically inherits pool config from provider.
| Strategy | Behavior |
|---|---|
primary_first | Always use owner first, failover to members on error |
round_robin | Round-robin across all accounts in the pool |
priority_order | Use in priority order, auto-switch on account errors |
Agents inherit routing config from the provider — configure once, all agents benefit automatically.
override_mode: "custom"GoClaw calls the OpenAI Usage API to fetch quota for each account in the pool.
The gateway tracks health per account via tracing data. When an account fails repeatedly, the routing engine switches to another automatically.
Only admin/operator can manage pool
Viewer: dashboard read-only
Tenant isolation — no cross-tenant leak
Badge needs_reauth when token expires
round_robininheritcodex-heavy (Pro) → heavy tasks agentcodex-light (Plus) → casual chat agent| Component | File | Role |
|---|---|---|
| Pool Validation | chatgpt_oauth_pool_validation.go | Validate graph: no cycles, no dual-ownership |
| Pool HTTP API | agents_codex_pool.go | CRUD pool config, activity, health |
| Quota Fetcher | oauth/openai_quota.go | OpenAI Usage API, parse quota windows |
| Quota Transport | oauth/openai_quota_transport.go | HTTP transport + auth injection |
| Token Mgmt | oauth/token.go | Refresh token, metadata backfill |
| Routing | agent/resolver.go | Resolve provider by strategy |
| Store Types | store/agent_store.go | Constants, routing config structs |
| Dashboard | agent-codex-pool-page.tsx | Pool management UI |
| Quota UI | chatgpt-oauth-quota-*.tsx | Bars, badges, readiness |