Conversation
… Anthropic passthrough When a configured API key is set for the Anthropic provider, the passthrough mode was previously sending both the configured x-api-key AND any Authorization header from the client request. This caused authentication failures with some proxies (like MegaLLM) that don't expect both headers. Changes: - Filter out both 'authorization' and 'x-api-key' headers from client requests when a configured API key is present - Only use the configured API key for authentication in this case - Preserve all headers (including client auth) when no API key is configured - Add debug logging to show filtered headers and final headers sent - Applied to both send_passthrough and stream_passthrough methods - Fix clippy warning in pricing.rs (identity_op) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #14 - Authentication failures when using configured API key with MegaLLM proxy
When a configured API key is set for the Anthropic provider, the passthrough mode was previously sending both the configured
x-api-keyAND anyAuthorizationheader from the client request. This caused authentication failures with some proxies (like MegaLLM) that don't expect both headers.Changes
authorizationandx-api-keyheaders from client requests when a configured API key is presentsend_passthroughandstream_passthroughmethodsAffected Components
crates/lunaroute-egress/src/anthropic.rs- Anthropic egress connector passthrough methodscrates/lunaroute-ui/src/pricing.rs- Clippy fixTesting
Behavior
Before
After
When no configured API key exists, all client headers are passed through unchanged (original behavior preserved).
🤖 Generated with Claude Code