claude-code-proxy
claude-code-proxy copied to clipboard
feat: Add Google Gemini and OpenRouter providers
This PR adds support for Google Gemini and OpenRouter as additional LLM providers for the claude-code-proxy.
🚀 Changes
New Providers Added
- Google Gemini - Full integration with Google's Gemini API
- OpenRouter - Access to 100+ models through a single API
Implementation Details
- ✅ Added
gemini.goprovider with Anthropic-to-Gemini request/response conversion - ✅ Added
openrouter.goprovider supporting all OpenRouter models - ✅ Updated config structure to support new providers
- ✅ Added environment variable support:
GEMINI_API_KEY,GEMINI_BASE_URLOPENROUTER_API_KEY,OPENROUTER_BASE_URL
- ✅ Updated
config.yaml.examplewith new provider configurations - ✅ Full support for both streaming and regular responses
💡 Benefits
- Enables routing Claude Code subagents to Gemini models (gemini-1.5-pro, gemini-1.5-flash)
- Access to all OpenRouter-supported models (GPT-4, Claude, Llama, Mistral, etc.)
- More flexibility in model selection for different tasks
- Cost optimization by routing to different providers based on task requirements
📝 Example Configuration
```yaml providers: gemini: api_key: "YOUR_GEMINI_KEY"
openrouter: api_key: "YOUR_OPENROUTER_KEY"
subagents: enable: true mappings: code-reviewer: "gpt-4o" data-analyst: "gemini-1.5-pro" doc-writer: "openrouter/claude-3-haiku" ```
✅ Testing
- Compiled and tested locally
- No API keys included in the code
- All provider implementations follow existing patterns
📚 Documentation
Updated config.yaml.example with comprehensive examples and environment variable documentation.