Install
openclaw skills install unknownshu-codex-account-switcherQuery OpenAI Codex OAuth account quotas in OpenClaw, switch the preferred account by email/profile id, and optionally auto-switch when 5h quota drops below a threshold. Use for OpenClaw model account management and quota-aware failover.
openclaw skills install unknownshu-codex-account-switcherUse the bundled scripts to manage openai-codex OAuth profiles without exposing tokens.
From this skill directory:
python3 scripts/openclaw-accounts-query.py
python3 scripts/openclaw-account-switch.py user@example.com --dry-run
python3 scripts/openclaw-account-switch.py user@example.com
python3 scripts/codex-cli-sync.py --dry-run
python3 scripts/codex-cli-sync.py
python3 scripts/openai-codex-auto-switch.py --dry-run
python3 scripts/openai-codex-quota-query.py --json
auth-state.json provider order for openai-codex.codex-cli-sync.py is advanced/explicit: it imports the current Codex CLI ~/.codex/auth.json login into OpenClaw and writes backups first.20%.export OPENCLAW_HOME="$HOME/.openclaw"
export OPENCLAW_AGENT_ID="main"
export OPENCLAW_CODEX_SWITCH_THRESHOLD=20
export OPENCLAW_CODEX_SWITCH_SUFFICIENT_THRESHOLD=20
For cron, use an absolute path to scripts/openai-codex-auto-switch.py and redirect output to logs.
Do not paste script output containing local paths into public places without review. Do not commit auth-state.json, auth-profiles.json, .env, logs, or screenshots containing account emails unless you intend to share them.