Skip to content

feat: add passthrough_auth option for OAuth bearer token forwarding - #1219

Open
kenaroik wants to merge 1 commit into
musistudio:mainfrom
kenaroik:feature/oauth-passthrough
Open

kenaroik wants to merge 1 commit into
musistudio:mainfrom
kenaroik:feature/oauth-passthrough

Conversation

@kenaroik

Copy link
Copy Markdown

Summary

This PR adds a passthrough_auth option for provider configuration, enabling
Claude Code users with Anthropic Max subscriptions (OAuth authentication) to use
Claude Code Router.

Previously, providers without an api_key were silently skipped during
registration, making it impossible to route requests to Anthropic's API when
using OAuth bearer tokens instead of API keys.

Changes

  • api_key is now optional when passthrough_auth: true
  • Incoming auth headers (Authorization, x-api-key, anthropic-version,
    anthropic-beta) are forwarded to the upstream provider
  • No breaking changes to existing api_key-based authentication

Related issues

Built and tested with the help of Claude Code on a hybrid local/cloud setup.

Enables providers without api_key (e.g. Anthropic Max subscription with OAuth)
by forwarding the incoming Authorization, x-api-key, anthropic-version, and
anthropic-beta headers to the upstream provider when passthrough_auth is true.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants