You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+17-2Lines changed: 17 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,7 @@ A proxy server that lets you use Anthropic clients with Gemini, OpenAI, or Anthr
13
13
14
14
- OpenAI API key 🔑
15
15
- Google AI Studio (Gemini) API key (if using Google provider) 🔑
16
+
- Google Cloud Project with Vertex AI API enabled (if using Application Default Credentials for Gemini) ☁️
16
17
-[uv](https://github.com/astral-sh/uv) installed.
17
18
18
19
### Setup 🛠️
@@ -40,7 +41,10 @@ A proxy server that lets you use Anthropic clients with Gemini, OpenAI, or Anthr
40
41
41
42
*`ANTHROPIC_API_KEY`: (Optional) Needed only if proxying *to* Anthropic models.
42
43
*`OPENAI_API_KEY`: Your OpenAI API key (Required if using the default OpenAI preference or as fallback).
43
-
*`GEMINI_API_KEY`: Your Google AI Studio (Gemini) API key (Required if PREFERRED_PROVIDER=google).
44
+
*`GEMINI_API_KEY`: Your Google AI Studio (Gemini) API key (Required if `PREFERRED_PROVIDER=google` and `USE_VERTEX_AUTH=true`).
45
+
*`USE_VERTEX_AUTH` (Optional): Set to `true` to use Application Default Credentials (ADC) will be used (no static API key required). Note: when USE_VERTEX_AUTH=true, you must configure `VERTEX_PROJECT` and `VERTEX_LOCATION`.
46
+
*`VERTEX_PROJECT` (Optional): Your Google Cloud Project ID (Required if `PREFERRED_PROVIDER=google` and `USE_VERTEX_AUTH=true`).
47
+
*`VERTEX_LOCATION` (Optional): The Google Cloud region for Vertex AI (e.g., `us-central1`) (Required if `PREFERRED_PROVIDER=google` and `USE_VERTEX_AUTH=true`).
44
48
*`PREFERRED_PROVIDER` (Optional): Set to `openai` (default), `google`, or `anthropic`. This determines the primary backend for mapping `haiku`/`sonnet`.
45
49
*`BIG_MODEL` (Optional): The model to map `sonnet` requests to. Defaults to `gpt-4.1` (if `PREFERRED_PROVIDER=openai`) or `gemini-2.5-pro-preview-03-25`. Ignored when `PREFERRED_PROVIDER=anthropic`.
46
50
*`SMALL_MODEL` (Optional): The model to map `haiku` requests to. Defaults to `gpt-4.1-mini` (if `PREFERRED_PROVIDER=openai`) or `gemini-2.0-flash`. Ignored when `PREFERRED_PROVIDER=anthropic`.
@@ -151,7 +155,7 @@ GEMINI_API_KEY="your-google-key" # Needed if PREFERRED_PROVIDER=google
151
155
# SMALL_MODEL="gpt-4.1-mini" # Optional, it's the default
152
156
```
153
157
154
-
**Example 2: Prefer Google**
158
+
**Example 2a: Prefer Google (using GEMINI_API_KEY)**
155
159
```dotenv
156
160
GEMINI_API_KEY="your-google-key"
157
161
OPENAI_API_KEY="your-openai-key" # Needed for fallback
@@ -160,6 +164,17 @@ PREFERRED_PROVIDER="google"
160
164
# SMALL_MODEL="gemini-2.5-flash" # Optional, it's the default for Google pref
161
165
```
162
166
167
+
**Example 2b: Prefer Google (using Vertex AI with Application Default Credentials)**
168
+
```dotenv
169
+
OPENAI_API_KEY="your-openai-key" # Needed for fallback
170
+
PREFERRED_PROVIDER="google"
171
+
VERTEX_PROJECT="your-gcp-project-id"
172
+
VERTEX_LOCATION="us-central1"
173
+
USE_VERTEX_AUTH=true
174
+
# BIG_MODEL="gemini-2.5-pro" # Optional, it's the default for Google pref
175
+
# SMALL_MODEL="gemini-2.5-flash" # Optional, it's the default for Google pref
176
+
```
177
+
163
178
**Example 3: Use Direct Anthropic ("Just an Anthropic Proxy" Mode)**
0 commit comments