Skip to content

[Bug]: 400 "Multiple authentication credentials received" when using Gemini via OpenAI Provider shim #713

Description

@Durannd

Summary

When attempting to use Gemini models (gemini-2.5-flash) routed through the OpenAI provider compatibility layer, the application crashes immediately with an API Error 400.

The Google API returns Multiple authentication credentials received. Please pass only one.. This indicates that OpenClaude is likely attaching the API key in both the HTTP headers (e.g., Authorization: Bearer or x-goog-api-key) AND as a query parameter in the URL (?key=...) simultaneously, causing the Google endpoint to reject the request.

Steps to Reproduce

  1. Clean OS installation (no previous global keys configured).
  2. Configured the key by provider configuration.
  3. Set the configuration as follows:
    • Provider: Google Gemini
    • Model: gemini-2.5-flash
    • Endpoint: https://generativelanguage.googleapis.com/v1beta/openai/
  4. Type any prompt in the chat (e.g., "a").
  5. The request instantly fails with the 400 error.

Expected Behavior

The application should pass the authentication credential using only one method (preferably following the specific endpoint's standard) so the Google API accepts the request.

Actual Behavior

The execution immediately aborts with the following error:

API Error: 400 [{"error":{"code":400,"message":"Multiple authentication credentials received. Please pass only one.","status":"INVALID_ARGUMENT"}}]

Environment

  • OpenClaude version: v0.3.0
  • OS: WSL (Ubuntu) on Windows
  • Terminal: Bash
  • Provider Configured: Google Gemini
  • Model: gemini-2.5-flash

Logs / Screenshots

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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