Gemini (Native Mode)
Use the Google Gemini API with Enterprise Router
Setup
Install the Google Generative AI SDK:
Configure the client to use your gateway:
Basic generation
Streaming
Multi-turn conversation
Using REST directly
If you prefer raw HTTP, Gemini’s REST API works through the gateway. The model name goes in the URL path:
For streaming, use the streamGenerateContent method with alt=sse:
Notes
- Model in URL path: Unlike OpenAI and Anthropic, Gemini identifies the model in the URL path (
/models/{model}:generateContent), not in the request body. - Auth header: The gateway uses the
x-goog-api-keyheader for Gemini authentication.
Supported models
gemini-2.5-pro,gemini-2.5-flash,gemini-2.5-flash-litegemini-3.1-pro-preview,gemini-3-flash-preview
New Gemini models work automatically.