GoClaw v2.34.0

Codex OAuth Pools

Pool multiple OpenAI Codex accounts into one unified endpoint. Automatic request routing. Real-time quota monitoring.

scroll

Rate limits per individual account

OpenAI enforces rate limits per subscription account. With 3–5 Codex accounts (Pro, Plus, Team), you have to juggle them manually.

1

Manual switching when quota runs out

2

Don't know which account has remaining capacity

3

No way to aggregate throughput

For a team of 5–10 sharing a gateway, this problem multiplies.

Four steps to set up

01

Register OAuth

Each Codex/ChatGPT account becomes a separate named provider. GoClaw stores refresh tokens and handles token refresh automatically.

02

Create Pool

Pick one provider as the owner, add others to codex_pool.extra_provider_names.

03

Choose Strategy

Configure how requests are distributed: primary first, round robin, or priority order.

04

Agent Inherit

Set override_mode: "inherit" — agent automatically inherits pool config from provider.

Pool Validation

No self-reference One pool per member Owner ≠ member All chatgpt_oauth type

Request pipeline

GoClaw Gateway — Request Flow
User Message
Agent Loop
Resolver
Routing Engine
Codex OAuth Pool
codex-pro-1
35%
healthy
codex-pro-2
85%
healthy
codex-team
10%
degraded

Three routing strategies

StrategyBehavior
primary_firstAlways use owner first, failover to members on error
round_robinRound-robin across all accounts in the pool
priority_orderUse in priority order, auto-switch on account errors

Inherited Routing Defaults

Agents inherit routing config from the provider — configure once, all agents benefit automatically.

Provider

"codex-main"
Pool owner
codex-backup
codex-team
round_robin
inherit

Agent

"assistant"
Provider: codex-main
Override: inherit
(no pool config needed)

Quota real-time

GoClaw calls the OpenAI Usage API to fetch quota for each account in the pool.

Pool Dashboard

Codex OAuth Pool

Live
codex-pro-1
65%healthy
5h: 35% remainweekly: 80% used
codex-pro-2
15%healthy
5h: 92% remainweekly: 25% used
codex-team
90%degraded
5h: resets in 2h 15mweekly: resets in 3d 4h
● 2 healthy   △ 1 degradedStrategy: round_robinLast → codex-pro-2 (2m ago)

Auto-failover tracking

The gateway tracks health per account via tracing data. When an account fails repeatedly, the routing engine switches to another automatically.

Success Rate
94%
Successful requests
Health Score
87
Composite score
Consec. Failures
0
Consecutive errors
State
OK
healthy

Access control

Only admin/operator can manage pool

Viewer: dashboard read-only

Tenant isolation — no cross-tenant leak

Badge needs_reauth when token expires

Real-world use cases

Team of 8, 3 Codex Pro accounts

Before v2.34.0
  • Admin manually rotates keys when quota runs out
  • Create 3 separate agents, users pick manually → bad UX
After v2.34.0
  1. 3 accounts OAuth → 3 named providers
  2. Pool round_robin
  3. Agent set inherit
  4. 8 users, 1 agent, auto-distributed evenly
  5. Real-time quota dashboard

Workload separation

Priority Order
  • codex-heavy (Pro) → heavy tasks agent
  • codex-light (Plus) → casual chat agent
  • Heavy first, fallback to light when quota runs out

Technical summary

ComponentFileRole
Pool Validationchatgpt_oauth_pool_validation.goValidate graph: no cycles, no dual-ownership
Pool HTTP APIagents_codex_pool.goCRUD pool config, activity, health
Quota Fetcheroauth/openai_quota.goOpenAI Usage API, parse quota windows
Quota Transportoauth/openai_quota_transport.goHTTP transport + auth injection
Token Mgmtoauth/token.goRefresh token, metadata backfill
Routingagent/resolver.goResolve provider by strategy
Store Typesstore/agent_store.goConstants, routing config structs
Dashboardagent-codex-pool-page.tsxPool management UI
Quota UIchatgpt-oauth-quota-*.tsxBars, badges, readiness
VI EN ZH JA