Allow re-authentication or API key entry after reaching plan limits

Open 💬 3 comments Opened Sep 9, 2025 by dpolivaev

What feature would you like to see?

When the CLI session reaches plan limits (e.g. 5-hour or 7-day cap), it should not terminate completely. Instead, it should allow:

  • Entering a new API key, or
  • Logging in with a different account, without losing the current session context.

The /logout command should also not act like quit. Instead, it should return to a state where I can provide new credentials and continue in the same session.

Are you interested in implementing this feature?

_No response_

Additional information

Currently, hitting plan limits stops the CLI entirely, leaving code edits unfinished.
This is disruptive, especially when Codex has partially modified code and the process stops mid-flow, leaving files inconsistent.
Supporting credential re-entry within the same session would make the tool more resilient and usable in real workflows.

View original on GitHub ↗

3 Comments

dlukt · 11 months ago

Not re-entry but stored refresh tokens that could be rotated on demand.
id and refresh tokens are already stored in the auth.json file

deksden · 11 months ago

If OpenAI implements seamless continue with another account, it can sell more Plus accounts for users that require more usage, but did not want (yet) spend $200 on pro plan.

great for marketing, imho

3ld0ct0r · 7 months ago

Chunky Workaround via .bash_profile

_codex_with_profile() {
  export CODEX_HOME="$1"
  command codex "${@:2}"
}

# Personal profile (default)
codex() {
  _codex_with_profile "$HOME/.codex" "$@"
}

# Personal profile A
Acodex() {
  _codex_with_profile "$HOME/.codex-A" "$@"
}

# Personal profile B
Bcodex() {
  _codex_with_profile "$HOME/.codex-B" "$@"
}

# Personal profile C
Ccodex() {
  _codex_with_profile "$HOME/.codex-C" "$@"
}

# Personal profile D
Dcodex() {
  _codex_with_profile "$HOME/.codex-D" "$@"
}

# Personal profile E
Ecodex() {
  _codex_with_profile "$HOME/.codex-E" "$@"
}

You can use Acodex or Bcodex with different auths and different config.toml (s) independently in different profiles