Skip to content

Feature: Add Gemini model support #72

@weijiafu14

Description

@weijiafu14

Problem

This proxy currently only supports OpenAI-compatible backends. Users who want to use Gemini models (gemini-2.5-flash, gemini-3-pro, etc.) with Claude Code have no option here.

Given that Gemini offers free tier API access and competitive performance, Gemini support would be valuable.

Challenge

Gemini API is not OpenAI-compatible — it uses a completely different protocol (contents/parts instead of messages, functionCall/functionResponse instead of tool_calls, thoughtSignature for thinking mode, etc.). Simply pointing the OpenAI SDK at a Gemini endpoint won't work.

Possible approach

gemini-claude-bridge is an MIT-licensed library that handles the full Gemini ↔ Claude protocol conversion:

pip install gemini-claude-bridge
from gemini_claude_bridge import convert_claude_to_gemini, convert_gemini_to_claude, GeminiStreamConverter

It handles the tricky parts:

  • thoughtSignature persistence for multi-turn tool calls
  • Streaming tool arguments (partialArgs with jsonPath)
  • Image handling in tool results
  • JSON Schema cleaning for Gemini compatibility

Could be integrated as an optional backend alongside the existing OpenAI path, activated when the model name starts with gemini/.

Happy to help with a PR if there's interest.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions