[FEATURE] Support auth fallback when primary provider returns 429

Resolved 💬 3 comments Opened Apr 12, 2026 by sukumaran1983 Closed Apr 15, 2026

Preflight Checklist

  • [x] I have searched existing requests and this feature hasn't been requested yet
  • [x] This is a single feature request (not multiple features)

Problem Statement

When using Claude Code behind an enterprise proxy that returns 429 when budget is exhausted, it would be useful to have automatic fallback to a secondary auth method without requiring a session restart.

Current behavior:

  • 429 from the enterprise auth provider blocks all requests
  • User must quit, restart with a different API key, and /resume

Desired behavior:

  • Configure a fallback API key via env var (e.g., CLAUDE_FALLBACK_API_KEY)
  • On 429 from primary auth, automatically switch to fallback mid-session
  • No restart needed — conversation context preserved

Current workaround:
Alias two launch commands with different env vars and manually quit + /resume when budget is hit.

Proposed Solution

Desired behavior:

  • Configure a fallback API key via env var (e.g., CLAUDE_FALLBACK_API_KEY)
  • On 429 from primary auth, automatically switch to fallback mid-session
  • No restart needed — conversation context preserved

Alternative Solutions

Current workaround:
Alias two launch commands with different env vars and manually quit + /resume when budget is hit.

Priority

Medium - Would be very helpful

Feature Category

API and model interactions

Use Case Example

_No response_

Additional Context

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗