Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 28 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

**Use Google Gemini models through OpenAI & Anthropic compatible APIs**

*Unlock Gemini 3 Pro, Gemini 2.5 Pro, Gemini 2.5 Flash and more with Claude Code, Aider, and your favorite AI tools!*
*Unlock Gemini 1.5 Pro, Gemini 1.5 Flash, and more with Claude Code, Aider, and your favorite AI tools!*

</div>

Expand All @@ -19,12 +19,12 @@
| Feature | Description |
|---------|-------------|
| πŸ”Œ **Dual API Compatibility** | OpenAI and Anthropic API endpoints in one server |
| 🧠 **Gemini 3 Support** | Full support for `gemini-3-pro-preview` and `gemini-3-flash-preview` |
| 🧠 **Gemini 1.5 Support** | Full support for `gemini-1.5-pro-preview` and `gemini-1.5-flash-preview` |
| πŸ€” **Extended Thinking** | Native thinking/reasoning support (like Claude's thinking blocks) |
| πŸ”„ **Auto Model Switching** | Automatic fallback on rate limits |
| 🌐 **Google Search Tool** | Native Google Search grounding support |
| πŸ”§ **Tool Calling** | Full function/tool calling support |
| 🎯 **Custom Model Aliases** | Use `gemini-3-pro-high[1m]` and similar suffixes |
| 🎯 **Custom Model Aliases** | Use `gemini-1.5-pro-high[1m]` and similar suffixes |
| πŸ” **OAuth Authentication** | Uses Gemini CLI credentials automatically |

---
Expand All @@ -47,7 +47,7 @@ Google Gemini CodeAssist offers a generous free tier:

```bash
# Clone the repository
git clone https://github.com/emrullahakclk/gemini-cli-proxy.git
git clone https://github.com/nurujjamanpollob/gemini-cli-proxy.git
cd gemini-cli-proxy

# Install dependencies
Expand All @@ -71,7 +71,7 @@ npm start

```bash
# Install globally from GitHub
npm install -g github:emrullahakclk/gemini-cli-proxy
npm install -g github:nurujjamanpollob/gemini-cli-proxy

# Then run anywhere
gemini-cli-proxy
Expand Down Expand Up @@ -128,21 +128,18 @@ The proxy uses Google OAuth2 authentication:

| Alias | Maps To |
|-------|---------|
| `gemini-3-pro-high` | `gemini-3-pro-preview` |
| `gemini-3-pro` | `gemini-3-pro-preview` |
| `gemini-3-flash` | `gemini-3-flash-preview` |
| `gemini-3` | `gemini-3-flash-preview` |
| `gemini-2.5-pro` | `gemini-2.5-pro` |
| `gemini-2.5-flash` | `gemini-2.5-flash` |
| `gemini-2.5-flash-lite` | `gemini-2.5-flash-lite-preview` |
| `gemini-1.5-pro-high` | `gemini-1.5-pro-preview` |
| `gemini-1.5-pro` | `gemini-1.5-pro-preview` |
| `gemini-1.5-flash` | `gemini-1.5-flash-preview` |
| `gemini-1.5` | `gemini-1.5-flash-preview` |

### Thinking Budget

You can specify a thinking budget using the `[Xm]` suffix:

```
gemini-3-pro-high[1m] β†’ 1 million thinking tokens
gemini-3-pro[512k] β†’ 512k thinking tokens
gemini-1.5-pro-high[1m] β†’ 1 million thinking tokens
gemini-1.5-pro[512k] β†’ 512k thinking tokens
```

---
Expand All @@ -162,11 +159,11 @@ Add to your `.claude/settings.json`:
"env": {
"ANTHROPIC_AUTH_TOKEN": "not-needed",
"ANTHROPIC_BASE_URL": "http://localhost:3456/anthropic",
"ANTHROPIC_MODEL": "gemini-3-pro-high[1m]",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "gemini-3-pro-high[1m]",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "gemini-3-pro-high[1m]",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "gemini-3-flash[1m]",
"CLAUDE_CODE_SUBAGENT_MODEL": "gemini-3-pro-high[1m]",
"ANTHROPIC_MODEL": "gemini-1.5-pro-high[1m]",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "gemini-1.5-pro-high[1m]",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "gemini-1.5-pro-high[1m]",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "gemini-1.5-flash[1m]",
"CLAUDE_CODE_SUBAGENT_MODEL": "gemini-1.5-pro-high[1m]",
"ENABLE_TOOL_SEARCH": "true"
}
}
Expand All @@ -182,7 +179,7 @@ export OPENAI_API_KEY=not-needed
# For Anthropic-compatible tools
export ANTHROPIC_BASE_URL=http://localhost:3456/anthropic
export ANTHROPIC_AUTH_TOKEN=not-needed
export ANTHROPIC_MODEL=gemini-3-pro-high
export ANTHROPIC_MODEL=gemini-1.5-pro-high
```

### Aider
Expand All @@ -194,7 +191,7 @@ npx gemini-cli-proxy
# In another terminal
export OPENAI_API_BASE=http://localhost:3456/openai
export OPENAI_API_KEY=not-needed
aider --model gemini-3-pro-high
aider --model gemini-1.5-pro-high
```

### Zed Editor
Expand All @@ -208,13 +205,13 @@ Add to Zed settings:
"api_url": "http://localhost:3456/openai",
"available_models": [
{
"name": "gemini-3-pro-high",
"display_name": "Gemini 3 Pro (via Proxy)",
"name": "gemini-1.5-pro-high",
"display_name": "Gemini 1.5 Pro (via Proxy)",
"max_tokens": 1000000
},
{
"name": "gemini-3-flash",
"display_name": "Gemini 3 Flash (via Proxy)",
"name": "gemini-1.5-flash",
"display_name": "Gemini 1.5 Flash (via Proxy)",
"max_tokens": 1000000
}
]
Expand All @@ -231,9 +228,9 @@ Add to `.continue/config.json`:
{
"models": [
{
"title": "Gemini 3 Pro",
"title": "Gemini 1.5 Pro",
"provider": "openai",
"model": "gemini-3-pro-high",
"model": "gemini-1.5-pro-high",
"apiBase": "http://localhost:3456/openai",
"apiKey": "not-needed"
}
Expand All @@ -248,7 +245,7 @@ Add to `.continue/config.json`:
### Setup

```bash
git clone https://github.com/your-username/gemini-cli-proxy.git
git clone https://github.com/nurujjamanpollob/gemini-cli-proxy.git
cd gemini-cli-proxy
npm install
```
Expand All @@ -269,14 +266,8 @@ npm install
```
src/
β”œβ”€β”€ auth/ # Google OAuth authentication
β”œβ”€β”€ gemini/ # Gemini API client & mappers
β”‚ β”œβ”€β”€ client.ts # Core API client
β”‚ β”œβ”€β”€ mapper.ts # Model & schema mapping
β”‚ β”œβ”€β”€ openai-mapper.ts # OpenAI format conversion
β”‚ └── anthropic-mapper.ts # Anthropic format conversion
β”œβ”€β”€ gemini/ # Gemini API client & mppers
β”œβ”€β”€ routes/ # Express route handlers
β”‚ β”œβ”€β”€ openai.ts # /openai/* endpoints
β”‚ └── anthropic.ts # /anthropic/* endpoints
β”œβ”€β”€ types/ # TypeScript definitions
└── utils/ # Utility functions & constants
```
Expand All @@ -288,7 +279,7 @@ src/
### Rate Limiting (429 Error)

```
RESOURCE_EXHAUSTED: Rate limited on gemini-3-pro-preview
RESOURCE_EXHAUSTED: Rate limited on gemini-1.5-pro-preview
```

**Solutions:**
Expand Down Expand Up @@ -330,7 +321,7 @@ Apache 2.0 - See [LICENSE](LICENSE) for details.

- [Google Gemini](https://deepmind.google/technologies/gemini/) for the amazing models
- [Gemini CLI](https://github.com/google-gemini/gemini-cli) for the authentication flow
- Original project by [uur](https://github.com/AshishKatale)
- Original project by [uur](https://github.com/uurnik)

---

Expand Down
Loading