#openai-codex account rotation

1 messages · Page 1 of 1 (latest)

random frigate
#

can my agent rotate the openai-codex auth order automatically when the usage hit the limit?

fluid furnaceBOT
brisk pulsarBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> âś… Mark Solution

fluid furnaceBOT
river tokenBOT
#

Let me verify this against the docs and code so I don’t make up config keys.

#

Yes, if you have multiple openai-codex auth profiles for that agent.

OpenClaw can automatically fail over when one profile hits a usage/rate limit. It does not permanently rewrite auth.order, it marks the limited profile in cooldown and tries the next healthy profile.

Main gotchas:

  • Works only if the session is not user-pinned to one profile via /model ...@openai-codex:<profileId>
  • If you set explicit auth.order.openai-codex, that stays the preferred order, but cooldowned profiles still get pushed to the end
  • If all Codex profiles are limited, then model fallbacks are the next step

For Codex specifically, messages like “hit your ChatGPT usage limit” are treated as rate_limit, and there is extra Codex-specific cooldown handling.

Useful docs:

If you want, paste these and I can check whether your setup should rotate correctly:

#
openclaw --version
openclaw models auth order get --provider openai-codex
openclaw models status --json
random frigate
river tokenBOT
#

Not by default.

If your goal is:

  • use all openai-codex auth profiles first
  • only switch models after all Codex profiles are exhausted

then keep the fallback models config. That’s already the normal order.

I’d only remove per-agent fallbacks if you want a strict policy like:

  • “Codex only, fail if all Codex accounts are limited”
  • “Never silently switch to another provider/model”
  • “Avoid surprise cost/behavior changes”

So, short version:

#
  • Keep fallbacks for resilience
  • Remove fallbacks for strict Codex-only behavior

One caveat: if you user-pin a specific auth profile with /model ...@profileId, OpenClaw stays locked to that profile and may jump to the next model fallback instead of rotating profiles.

Docs: https://docs.openclaw.ai/concepts/model-failover

If you want, I can suggest a good per-agent setup depending on whether you want max uptime or strict Codex-only behavior.

random frigate
#

this is the config of one of my agents:

"workspace": "/home/ubuntu/.openclaw/workspace",
        "model": {
          "primary": "openai-codex/gpt-5.4",
          "fallbacks": [
            "blockrun/free/nemotron-3-super-120b"
          ]
        },

please give me a good per-agent setup depending on whether you want max uptime or strict Codex-only behavior.

river tokenBOT
#

I’m just checking the exact config shape before I suggest a snippet.

river tokenBOT
# random frigate this is the config of one of my agents: ``` "workspace": "/home/ubuntu/.openclaw...

There’s one important tuning knob here: by default, OpenClaw only does 1 same-provider profile rotation on rate limits before it tries the model fallback. I’m tailoring the examples around that. Yep. Given that config, I’d set it up like this:

1) Max uptime

Use Codex first, rotate across Codex accounts, then fall back to another model only if Codex is exhausted.

Per-agent

model: {
  primary: "openai-codex/gpt-5.4",
  fallbacks: ["blockrun/free/nemotron-3-super-120b"],
}

Important: the profile-rotation limit is not per-agent, it’s global under auth.cooldowns.

If you have:

#
  • 2 Codex profiles total: default is already okay
  • 3+ Codex profiles: raise rateLimitedProfileRotations

Example:

auth: {
  cooldowns: {
    rateLimitedProfileRotations: 2, // example: enough to try 3 Codex profiles total
  },
}

Optional, but nice: set a per-agent auth order override so Codex accounts are tried in the order you want:

openclaw models auth order set --agent <agentId> --provider openai-codex <profile1> <profile2> <profile3>
#

2) Strict Codex-only

If you never want it to leave Codex:

Per-agent

model: {
  primary: "openai-codex/gpt-5.4",
}

Then keep multiple Codex auth profiles for that agent, and optionally set the per-agent auth order.

If you have 3+ Codex profiles, you’ll still probably want the same global tweak:

#
auth: {
  cooldowns: {
    rateLimitedProfileRotations: 2,
  },
}

That way it tries the other Codex accounts before giving up.

My recommendation

  • If this agent should stay alive no matter what: keep your current fallback model
  • If this agent must behave like Codex only and you’d rather fail than switch personalities/providers: remove the fallback list

One honest caveat: blockrun/free/nemotron-3-super-120b is fine for uptime, but I’d expect noticeably different behavior from Codex when the fallback kicks in.

random frigate
river tokenBOT
#

Let me verify the exact config file path so I don’t send you to the wrong place.

#

Edit the main OpenClaw config file, not the agent workspace.

Usually that is:

~/.openclaw/openclaw.json

If you’re using a profile, it becomes:

~/.openclaw-<profile>/openclaw.json

If you’re not sure which file is active, run:

#
openclaw config file

Then add this at the top level of the config:

{
  auth: {
    cooldowns: {
      rateLimitedProfileRotations: 2,
    },
  },
}

So, not inside the agent block, and not in the workspace files.