Skip to content

Commit 0f41f6d

Browse files
authored
Add Gemini base URL setup instructions to README (#34)
## Summary - Replace the commented-out Gemini section with concrete code examples for both `@google/genai` (v1.x) and `@google/generative-ai` (v0.x) - Add missing `ANTHROPIC_API_KEY=mock-key` to the env block ## Test plan - [x] README renders correctly - [x] Code examples use correct constructor APIs for both SDK versions 🤖 Generated with [Claude Code](https://claude.com/claude-code)
2 parents e75918a + efa4318 commit 0f41f6d

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

README.md

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,29 @@ OPENAI_API_KEY=mock-key
117117
118118
# Or for Anthropic Claude:
119119
ANTHROPIC_BASE_URL=http://localhost:5555/v1
120+
ANTHROPIC_API_KEY=mock-key
120121
121-
# Or for Google Gemini — point at the base URL:
122-
# http://localhost:5555/v1beta
122+
# Or for Google Gemini (set baseUrl in code — see below):
123+
GOOGLE_API_KEY=mock-key
124+
```
125+
126+
For Google Gemini, the SDK doesn't support a base URL env var — pass it in code:
127+
128+
```typescript
129+
// @google/genai (v1.x)
130+
import { GoogleGenAI } from "@google/genai";
131+
const ai = new GoogleGenAI({
132+
apiKey: process.env.GOOGLE_API_KEY,
133+
httpOptions: { baseUrl: "http://localhost:5555" },
134+
});
135+
136+
// @google/generative-ai (v0.x)
137+
import { GoogleGenerativeAI } from "@google/generative-ai";
138+
const genAI = new GoogleGenerativeAI(process.env.GOOGLE_API_KEY!);
139+
const model = genAI.getGenerativeModel(
140+
{ model: "gemini-2.0-flash" },
141+
{ baseUrl: "http://localhost:5555" },
142+
);
123143
```
124144

125145
### JSON Fixture Files

0 commit comments

Comments
 (0)