Quick Start
Add Provider in Model Catalog
1
Navigate to Model Catalog
Go to Model Catalog → Add Provider in Strata Cloud Manager.
2
Select Google Gemini
Find and select Google from the provider list.
3
Enter API Key
Get your API key from Google AI Studio and enter it in Model Catalog.
4
Save and Use
Save your configuration. Your provider slug will be
@google (or a custom name you specify).The AI Gateway supports the
system_instructions parameter for Google Gemini 1.5 - allowing you to control the behavior and output of your Gemini-powered applications with ease.Simply include your Gemini system prompt as part of the {"role":"system"} message within the messages array of your request body. AI Gateway will automatically transform your message to ensure seamless compatibility with the Google Gemini API.Gemini Capabilities
Function Calling
The AI Gateway supports function calling mode on Google’s Gemini Models. Explore this cookbook for a deep dive and examples: Function CallingAdvanced Multimodal Capabilities with Gemini
Gemini models are inherently multimodal, capable of processing and understanding content from a wide array of file types. The AI Gateway streamlines the integration of these powerful features by providing a unified, OpenAI-compatible API.The AI Gateway Advantage: A Unified Format for All MediaTo simplify development, the AI Gateway uses a consistent format for all multimodal requests. Whether you’re sending an image, audio, video, or document, you will use an object with
type: 'image_url' within the user message’s content array.AI Gateway intelligently interprets your request—based on the URL or data URI you provide—and translates it into the precise format required by the Google Gemini API. This means you only need to learn one structure for all your media processing needs.Image Processing
Gemini can analyze images to describe their content, answer visual questions, or identify objects.Gemini Image Understanding Docs
To upload files and get Google Files URLs, use the Files API. The URL format will be similar to:
https://generativelanguage.googleapis.com/v1beta/files/[FILE_ID]data:<MIME_TYPE>;base64,<YOUR_BASE64_DATA>
Supported Image MIME types:
image/png, image/jpeg, image/webp, image/heic, image/heifAudio Processing
Gemini can transcribe speech, summarize audio content, or answer questions about sounds.Gemini Audio Understanding Docs
Supported Audio MIME types:
audio/wav, audio/mp3, audio/aiff, audio/aac, audio/ogg, audio/flac, audio/pcm, audio/m4a, audio/mpeg, audio/mpga, audio/mp4, audio/webmVideo Processing
Gemini can summarize videos, answer questions about specific events, and describe scenes.Gemini Video Understanding Docs
Supported Video MIME types:
video/mp4, video/mpeg, video/mov, video/avi, video/webm, video/wmvDocument Processing (PDF)
Gemini’s vision capabilities excel at understanding the content of PDF documents, including text, tables, and images.Gemini Documents Understanding Docs
While you can send other document types like
.txt or .html, they will be treated as plain text. Gemini’s native document vision capabilities are optimized for the application/pdf MIME type.Important: For all file uploads (except YouTube videos), it’s recommended to use the Google Files API to upload your files first, then use the returned file URL in your requests. This approach provides better performance and reliability for larger files.
Media Resolution
Themedia_resolution parameter allows you to control token allocation for media inputs (images, videos, PDFs) when using Gemini models. This helps balance between processing detail and cost/speed.
Supported values
Top-level configuration
Apply media resolution globally to all media in the request:Per-part configuration (Gemini 3 only)
For Gemini 3 models, you can specify media resolution on individual media parts. Per-part settings take precedence over global settings when both are specified.Google Gemini Media Resolution Documentation
Code Execution Tool
Gemini can use a built-in code interpreter tool to solve complex computational problems, perform calculations, and generate code. To enable this, simply include thecode_execution tool in your request. The model will automatically decide when to invoke it.
Thought Signatures (Tool Calling Verification)
Set
x-portkey-strict-open-ai-compliance to false to receive Gemini-native thinking and thought fields (including thought_signature) in responses. These are not OpenAI-compatible response fields, so the AI Gateway omits them when strict OpenAI compliance is enabled. This header must be included in all requests when using thought signatures.thought_signature parameter in tool calling conversations for verifying the payload. This signature is returned by the model in the assistant’s tool call response and must be included when continuing multi-turn conversations.
Google Gemini Thought Signatures Documentation
Single turn conversation
In a single-turn conversation, you make a request with tools defined, and the model returns tool calls with thought signatures.Multi turn conversation
In multi-turn conversations, you must include thethought_signature field in the assistant’s tool call when continuing the conversation.
The
thought_signature is automatically generated by the model and returned in the tool call response. You must preserve this signature when including the assistant’s message in subsequent requests.Computer Use (Browser Automation) (Preview)
Set
strict_open_ai_compliance to false to use the Computer Use tool.Single turn conversation
Multi turn conversation
Grounding with Google Search
Vertex AI supports grounding with Google Search. This is a feature that allows you to ground your LLM responses with real-time search results. Grounding is invoked by passing thegoogle_search tool (for newer models like gemini-2.0-flash-001), and google_search_retrieval (for older models like gemini-1.5-flash) in the tools array.
Extended Thinking (Reasoning Models) (Beta)
The assistants thinking response is returned in the
response_chunk.choices[0].delta.content_blocks array, not the response.choices[0].message.content string.gemini-2.5-flash-preview-04-17 gemini-2.5-flash-preview-04-17 support extended thinking.
This is similar to openai thinking, but you get the model’s reasoning as it processes the request as well.
Note that you will have to set strict_open_ai_compliance=False in the headers to use this feature.
Single turn conversation
To disable thinking for gemini models like
gemini-2.5-flash-preview-04-17, you are required to explicitly set budget_tokens to 0.Gemini grounding mode may not work through the AI Gateway. Contact support for assistance.
Image Generation (nano banana 🍌)
Gemini models likegemini-3-pro-image-preview support native image generation capabilities. You can generate images by setting modalities to include "image" in your request.
You must set
strict_open_ai_compliance=False in the headers to use image generation, as the response format includes non-standard fields like content_parts.content_parts field of the response and can be used in multi-turn conversations for iterative image editing.
Image Generation with Text Response
You can also generate images along with text explanations by including both"text" and "image" in the modalities array:
Image Editing (Multi-turn)
You can edit generated images by continuing the conversation. Pass the image data from the previous response back in the messages:Next Steps
Add Metadata
Add metadata to your Gemini requests
Gateway Configs
Configure advanced gateway features
Request Tracing
Trace and monitor your Gemini requests
Setup Fallbacks
Create fallback configurations between providers

