Skip to content

Intermittent auth failures with Claude Code OAuth passthrough (mid-session) #1598

@YupeiChen94WiseRock

Description

@YupeiChen94WiseRock

Setup:

Issue:
Mid-session, Claude Code starts returning auth errors requiring re-login. Running /login or claude auth status shows we're still authenticated, but all API requests are rejected. Restarting the session doesn't fix it — only unsetting ANTHROPIC_BASE_URL resolves the issue.

Hypothesis:
When the OAuth bearer token is refreshed mid-session, the new token may not be forwarded correctly through the Portkey gateway, causing Anthropic to reject subsequent requests.

Expected behavior:
Portkey should transparently forward the OAuth bearer token (including refreshed tokens) to Anthropic on each request.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions