Gemini (Native Mode)
Gemini (Native Mode)
Use the Google Gemini API with Gateway AI
Gemini (Native Mode)
Install the Google Generative AI SDK:
Configure the client to use your gateway:
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:
/models/{model}:generateContent), not in the request body.x-goog-api-key, which the gateway accepts. You can also use Authorization: Bearer or x-api-key if making raw HTTP requests.gemini-2.5-pro, gemini-2.5-flash, gemini-2.5-flash-litegemini-3.1-pro-preview, gemini-3-flash-previewNew Gemini models work automatically.