← 返回
未分类 中文

Codex Account Switcher

Query 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...
在 OpenClaw 中查询 OpenAI CodexOAuth 账户配额,按邮箱/档案 ID 切换首选账户,5 小时配额低于阈值时可自动切换。
unknown-shu unknown-shu 来源
未分类 clawhub v0.2.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 308
下载
💾 0
安装
1
版本
#accounts#auth#automation#latest#openai-codex#quota

概述

Codex Account Switcher

Use the bundled scripts to manage openai-codex OAuth profiles without exposing tokens.

Commands

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

Behavior

  • Reads OpenClaw auth profile metadata from the selected agent directory.
  • Queries quota directly from ChatGPT WHAM usage using each profile's OAuth access token.
  • Never prints access tokens, refresh tokens, API keys, or credential file contents.
  • Account switching only rewrites 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.
  • Auto-switch defaults to switching only when the active account's 5h remaining quota is below 20%.

Useful environment variables

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.

Safety

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.

版本历史

共 1 个版本

  • v0.2.0 当前
    2026-05-08 00:01 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

dev-programming

Github

steipete
使用 `gh` CLI 与 GitHub 交互,通过 `gh issue`、`gh pr`、`gh run` 和 `gh api` 管理议题、PR、CI 运行及高级查询。
★ 677 📥 325,899
ai-agent

self-improving agent

pskoett
捕获经验教训、错误及修正内容,以实现持续改进。适用于以下场景:(1)命令或操作意外失败;(2)用户纠正Claude(如“不,那不对……”“实际上……”);(3)用户请求的功能不存在;(4)外部API或工具出现故障;(5)Claude发现自身
★ 4,086 📥 814,753
ai-agent

Self-Improving + Proactive Agent

ivangdavila
自我反思+自我批评+自我学习+自组织记忆。智能体评估自身工作、发现错误并持续改进。
★ 1,385 📥 321,013