LaunchKit · 2026
Back to Skills

codex-multi-subscription-auth-fallbacks

Set up OpenClaw multi-provider auth with OpenAI Codex OAuth fallback profiles and automatic model switching.

2
511 downloads
by @markeljan

Setup & Installation

openclaw skills install @markeljan/codex-multi-subscription-auth-fallbacks

Or with the ClawHub CLI, for registry-managed skill folders outside a full OpenClaw workspace:

npx clawhub install codex-multi-subscription-auth-fallbacks

Version History

v1.1.0Feb 17, 2026 - Version note by skill developer:

### Safety & Reliability - Interactive confirmation before clearing `~/.codex/auth.json` — script now prompts `Continue? [y/N]` so you can abort - Trap handler automatically restores Codex CLI auth if the script is interrupted mid-run (EXIT/INT/TERM) - Backup verification — script checks that backup files were actually created before proceeding - Security & Safety section added to SKILL.md documenting exactly which files are accessed, how, and why ### Dependencies - Dropped `python3` and `jq` — the inline script now uses `node` (already present via the codex npm package), eliminating two external dependencies. Only `codex` is required. ### Metadata - SKILL.md frontmatter now declares `requires`, `files_read`, and `files_write` per OpenClaw review requirements ### Documentation - Cron job marked as optional — Step 4 heading and description now make clear that auto-switch is entirely optional, with a "before enabling" checklist - UUID/epoch helpers in config templates updated to use `node -e` instead of `python3 -c`

What This Skill Does

Configures multiple OpenAI Codex OAuth profiles in OpenClaw and sets up automatic failover between them when a provider hits a rate limit. Includes a script for device-flow login that imports tokens into OpenClaw's auth-profiles store without exposing them externally. An optional cron job can auto-switch the active model when a provider enters cooldown.

Eliminates manual account switching by letting OpenClaw fail over to a backup Codex profile automatically when one account is rate-limited.

When to use it

  • Adding a second OpenAI Codex account to avoid rate limit interruptions
  • Rotating between Codex profiles during heavy coding sessions
  • Setting failover priority order across multiple OpenAI accounts
  • Automating model switching when a Codex session hits cooldown
  • Importing fresh OAuth tokens into OpenClaw without manual JSON editing

Example Workflow

Here's how your AI assistant might use this skill in practice.

INPUT

User asks: add my second OpenAI account as a fallback Codex profile named 'work'

AGENT
  1. 1Runs codex-add-profile.sh work to start the import process
  2. 2Creates timestamped backups of ~/.codex/auth.json and auth-profiles.json
  3. 3Clears Codex CLI auth and triggers device-flow login via browser
  4. 4Extracts access token, refresh token, and expiry from the new session
  5. 5Writes the new 'work' profile into auth-profiles.json and restores original Codex auth
OUTPUT

OpenClaw auth-profiles.json updated with a second Codex OAuth profile named 'work', ready for failover

Requirements

Accounts, API keys, or tools you or your AI assistant may need to set up while using this skill.

OpenAI account with Codex accessOpenAI Codex CLI installed (npm i -g @openai/codex)