Skip to content

fix: use x-goog-api-key header instead of URL query parameter for Gemini (#70) - #1

Open
saurabhhhcodes wants to merge 2 commits into
mainfrom
fix-70-gemini-api-key-header
Open

fix: use x-goog-api-key header instead of URL query parameter for Gemini (#70)#1
saurabhhhcodes wants to merge 2 commits into
mainfrom
fix-70-gemini-api-key-header

Conversation

@saurabhhhcodes

Copy link
Copy Markdown
Owner

The Gemini API key was appended to the request URL as a query
parameter (key=...), exposing it in network logs, browser
history, and error messages. Changed to use the x-goog-api-key
HTTP header which is the recommended approach.

Fixes Ruthwik000#70

Saurabh Kumar Bajpai added 2 commits July 8, 2026 11:59
…on (Ruthwik000#67)

Anthropic's Messages API uses hyphens (claude-opus-4-5), not
dots (claude-opus-4.5). The dot-notation IDs in pricingRegistry
caused all Claude 4.5 requests to silently cost /bin/zsh.

Fixes Ruthwik000#67
…ini (Ruthwik000#70)

The Gemini API key was appended to the request URL as a query
parameter (key=...), exposing it in network logs, browser
history, and error messages. Changed to use the x-goog-api-key
HTTP header which is the recommended approach.

Fixes Ruthwik000#70
@coderabbitai

coderabbitai Bot commented Jul 20, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@saurabhhhcodes, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 56 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 5f7a13cd-286d-4f53-afad-89442b2c1956

📥 Commits

Reviewing files that changed from the base of the PR and between 0a55b9a and 0070736.

📒 Files selected for processing (3)
  • src/core/pricingRegistry.ts
  • src/introspection/modelLister.ts
  • src/router/providerHeaders.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix-70-gemini-api-key-header

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@saurabhhhcodes

Copy link
Copy Markdown
Owner Author

🔔 Friendly ping @saurabhhhcodes — this real fix has passing CI and references an approved GSSoC issue. Ready for review/merge. Thanks!

1 similar comment
@saurabhhhcodes

Copy link
Copy Markdown
Owner Author

🔔 Friendly ping @saurabhhhcodes — this real fix has passing CI and references an approved GSSoC issue. Ready for review/merge. Thanks!

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.

Bug: Gemini API key is appended to the request URL as a query parameter, exposing it in network logs and error messages

1 participant