The Google Gemini connector lets your AI agent act in each user's Google Gemini account. Each user connects their own Google Gemini API key once, and Scalekit sends it with every call, so your agent never handles credentials. It comes with 26 tools.
- Tools
- 26
- What they doRead · write · destructive
- 9 · 13 · 49 read13 write4 destructive
- Users sign in with
- API key
Setup
Install the SDK
Terminal window npm install @scalekit-sdk/node dotenvTerminal window pip install scalekit-sdk-python python-dotenvSet your credentials
Add your Scalekit credentials to your
.envfile. Find values in app.scalekit.com > Developers > API Credentials..env SCALEKIT_ENVIRONMENT_URL=<your-environment-url>SCALEKIT_CLIENT_ID=<your-client-id>SCALEKIT_CLIENT_SECRET=<your-client-secret>Create the Google Gemini connection
In AgentKit > Connections, create a Google Gemini connection. The name you give it is the
connection_nameyour code passes. See Configure connections.Authorize a user and make your first call
quickstart.mts import { ScalekitClient } from '@scalekit-sdk/node'import 'dotenv/config'import { createInterface } from 'node:readline/promises'const scalekit = new ScalekitClient(process.env.SCALEKIT_ENVIRONMENT_URL,process.env.SCALEKIT_CLIENT_ID,process.env.SCALEKIT_CLIENT_SECRET,)const actions = scalekit.actionsconst connector = 'gemini'const identifier = 'user_123'// Generate an authorization link for the userconst { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })console.log('Authorize Google Gemini:', link)const rl = createInterface({ input: process.stdin, output: process.stdout })await rl.question('Press Enter after authorizing...')rl.close()// Make your first callconst result = await actions.executeTool({connector,identifier,toolName: 'gemini_list_batches',toolInput: {},})console.log(result)Terminal window npx tsx quickstart.mtsquickstart.py import osfrom scalekit import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENVIRONMENT_URL"),client_id=os.getenv("SCALEKIT_CLIENT_ID"),client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),)actions = scalekit_client.actionsconnection_name = "gemini"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize Google Gemini:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={},tool_name="gemini_list_batches",connection_name=connection_name,identifier=identifier,)print(result)Terminal window python quickstart.pyEach user opens the link once and enters their Google Gemini credentials there. See Authorize a user for the full flow and statuses.
Tools
Pass the exact name toexecute_toolgemini_get_batchGet a batch job's status and, once finished, its results.Read-onlyGet Batch
Get a batch job's status and, once finished, its results. Returns name, done, metadata (state such as BATCH_STATE_RUNNING or BATCH_STATE_SUCCEEDED, batchStats counts, output) and response; inline batches carry inlinedResponses, file batches carry a responsesFile name in the Files API. Use to poll a batch from gemini_create_batch or gemini_create_embeddings_batch until done is true. Use gemini_list_batches to find batch names.
Inputs
namestringrequired- Batch resource name in the form batches/{id}, as returned in the name field when the batch was created.
gemini_get_cached_contentGet one context cache's metadata.Read-onlyGet Cached Content
Get one context cache's metadata. Returns name, model, displayName, createTime, updateTime, expireTime and usageMetadata.totalTokenCount. Cached content itself is not returned. Use to check when a cache expires. Use gemini_list_cached_contents to find cache names.
Inputs
namestringrequired- Cache resource name in the form cachedContents/{id}, as returned in the name field by gemini_create_cached_content or gemini_list_cached_contents.
gemini_get_fileGet one Files API file's metadata.Read-onlyGet File
Get one Files API file's metadata. Returns name, displayName, mimeType, sizeBytes, sha256Hash, createTime, expirationTime, state, uri, downloadUri, videoMetadata and any processing error. File bytes are not returned. Use to check that a file is ACTIVE before passing its uri to gemini_generate_content, or to follow a video delivered by uri. Use gemini_list_files to find file names.
Inputs
namestringrequired- File resource name in the form files/{id}, as returned in the name field by gemini_list_files. This is not the file's uri.
gemini_get_interactionGet a stored interaction by id, including background runs still in progress.Read-onlyGet Interaction
Get a stored interaction by id, including background runs still in progress. Returns id, status, model or agent, created and updated times, steps (thoughts, tool calls, model_output with text, images or video) and usage. Use to poll a background interaction or video render until status is completed, or to reread a past result. Use gemini_create_interaction to start one.
Inputs
interaction_idstringrequired- Interaction id, the id field returned by gemini_create_interaction or gemini_generate_video (for example v1_ChdhYmNk...).
include_inputboolean- Include the user_input steps in the returned interaction.
gemini_get_modelGet one Gemini API model's details.Read-onlyGet Model
Get one Gemini API model's details. Returns name, baseModelId, version, displayName, description, input and output token limits, supportedGenerationMethods, thinking support and default temperature, topP and topK. Use to check a model's limits or supported methods. Use gemini_list_models to browse all models.
Inputs
modelstringrequired- Model id without the models/ prefix, for example gemini-3.8-flash. Use gemini_list_models to see valid ids.
gemini_list_batchesList batch jobs in the API key's project, both generateContent and embedding batches.Read-onlyList Batches
List batch jobs in the API key's project, both generateContent and embedding batches. Returns operations, each with name (batches/{id}), metadata (model, displayName, state, batchStats, createTime) and done, plus nextPageToken. Use to find batches and their states. Use gemini_get_batch for one batch's results.
Inputs
filterstring- Optional list filter in the standard Google list filter syntax.
page_sizeinteger- Maximum number of batches per page. Defaults to 50; the API caps it at 1000.
page_tokenstring- Page token from the nextPageToken field of the previous response. Leave empty for the first page.
gemini_list_cached_contentsList the explicit context caches in the API key's project.Read-onlyList Cached Contents
List the explicit context caches in the API key's project. Returns cachedContents with name, model, displayName, createTime, updateTime, expireTime and usageMetadata.totalTokenCount, plus nextPageToken. Cached content itself is not returned. Use to find a cache name to reuse or clean up. Use gemini_get_cached_content for one cache.
Inputs
page_sizeinteger- Maximum number of caches per page. Defaults to 100; the API caps it at 1000.
page_tokenstring- Page token from the nextPageToken field of the previous response. Leave empty for the first page.
gemini_list_filesList files stored in the Gemini Files API for the API key's project (uploaded files are kept for 48 hours).Read-onlyList Files
List files stored in the Gemini Files API for the API key's project (uploaded files are kept for 48 hours). Returns files with name, displayName, mimeType, sizeBytes, createTime, expirationTime, state (PROCESSING, ACTIVE, FAILED), source and uri, plus nextPageToken. Use to find a file's uri to reference in prompts. Use gemini_get_file for one file. Uploading files is not supported by this connector.
Inputs
page_sizeinteger- Maximum number of files per page. Defaults to 10; the API caps it at 100.
page_tokenstring- Page token from the nextPageToken field of the previous response. Leave empty for the first page.
gemini_list_modelsList the Gemini API models available to the API key.Read-onlyList Models
List the Gemini API models available to the API key. Returns each model's name (models/{id}), displayName, description, inputTokenLimit, outputTokenLimit, supportedGenerationMethods and default sampling settings, plus nextPageToken. Use to discover valid model ids and which methods each supports. Use gemini_get_model for one model.
Inputs
page_sizeinteger- Maximum number of models per page. Defaults to 50; the API caps it at 1000.
page_tokenstring- Page token from the nextPageToken field of the previous response. Leave empty for the first page.
gemini_batch_embed_contentsCreate embeddings for several texts in one synchronous call, one vector per text.WriteBatch Embed Contents
Create embeddings for several texts in one synchronous call, one vector per text. Returns embeddings, an array of {values} in the same order as the input texts. Use for up to about 100 short texts. Use gemini_embed_content for one input, and gemini_create_embeddings_batch for large asynchronous jobs at lower cost.
Inputs
modelstringrequired- Model id without the models/ prefix, for example gemini-embedding-001. Use an embedding model.
textsarrayrequired- Texts to embed, one embedding each. Example: ["What is AI?", "How do magnets work?"].
output_dimensionalityinteger- Truncate the embedding to this many dimensions, for example 768, 1536 or 3072. Leave empty for the model's full size.
task_typestring- What the embedding is for, which tunes it: RETRIEVAL_QUERY, RETRIEVAL_DOCUMENT, SEMANTIC_SIMILARITY, CLASSIFICATION, CLUSTERING, QUESTION_ANSWERING, FACT_VERIFICATION or CODE_RETRIEVAL_QUERY. Honoured by gemini-embedding-001; for text with gemini-embedding-2 Google recommends a task prefix in the text instead.one of
RETRIEVAL_QUERYRETRIEVAL_DOCUMENTSEMANTIC_SIMILARITYCLASSIFICATIONCLUSTERINGQUESTION_ANSWERINGFACT_VERIFICATIONCODE_RETRIEVAL_QUERY
gemini_cancel_batchCancel a pending or running batch job; requests not yet processed are dropped.WriteCancel Batch
Cancel a pending or running batch job; requests not yet processed are dropped. Returns an empty object on success; the batch state then becomes BATCH_STATE_CANCELLED. Use to stop a batch you no longer need. Use gemini_delete_batch to remove a batch record.
Inputs
namestringrequired- Batch resource name in the form batches/{id}, as returned in the name field when the batch was created.
gemini_cancel_interactionCancel a background interaction that is still running.WriteCancel Interaction
Cancel a background interaction that is still running. Returns the interaction with its updated status. Use to stop a background run or video render you no longer need. Use gemini_delete_interaction to remove a stored interaction.
Inputs
interaction_idstringrequired- Interaction id, the id field returned by gemini_create_interaction or gemini_generate_video (for example v1_ChdhYmNk...).
gemini_count_tokensCount the input tokens a prompt uses on a Gemini model, including any system instruction and tool declarations you pass.WriteCount Tokens
Count the input tokens a prompt uses on a Gemini model, including any system instruction and tool declarations you pass. Returns totalTokens, cachedContentTokenCount and per-modality promptTokensDetails. Use before gemini_generate_content to check a prompt fits the model's inputTokenLimit or to estimate cost. Counting is free.
Inputs
modelstringrequired- Model id without the models/ prefix, for example gemini-3.8-flash. Token counts differ between models.
contentsarray- Conversation turns, oldest first. Each turn has a role (user or model) and a parts array. A part is one of: text ({"text": "..."}); inline media as base64 ({"inlineData": {"mimeType": "image/png", "data": "<base64>"}}), for images, audio, video or PDF up to the request size limit; or a file reference ({"fileData": {"mimeType": "video/mp4", "fileUri": "https://generativelanguage.googleapis.com/v1beta/files/abc-123"}}) for a file already in the Files API or a public YouTube URL. Function results go back as {"functionResponse": {"name": "...", "response": {...}}}. Example: [{"role": "user", "parts": [{"text": "Summarize this in one line."}]}]. Use prompt instead for a single text turn.
promptstring- Single user text turn. Shortcut for contents when you only need to send text; ignored when contents is set.
system_instructionstring- System instruction that sets the model's role, tone or rules. Text only.
toolsarray- Tools the model may use. Each entry is one tool object: {"googleSearch": {}} grounds the answer in Google Search; {"urlContext": {}} lets the model read URLs in the prompt; {"codeExecution": {}} lets it run Python; {"fileSearch": {"fileSearchStoreNames": ["fileSearchStores/my-store"]}} searches a File Search store; {"functionDeclarations": [{"name": "get_weather", "description": "Get the weather", "parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}}]} declares functions the caller runs. Example: [{"googleSearch": {}}].
gemini_create_batchCreate an asynchronous batch job that runs many generateContent requests on one model at a lower price, from inline requests or a JSONL file in the Files API.WriteCreate Batch
Create an asynchronous batch job that runs many generateContent requests on one model at a lower price, from inline requests or a JSONL file in the Files API. Returns a batch operation: name (batches/{id}) and metadata with state BATCH_STATE_PENDING. Use for large, non-urgent workloads (target turnaround is 24 hours). Poll with gemini_get_batch, which returns inline responses or a responsesFile when done. Use gemini_generate_content for a single immediate request. Charges apply to the API key's Google Cloud project at batch rates.
Inputs
display_namestringrequired- Readable name for the batch.
modelstringrequired- Model id without the models/ prefix, for example gemini-3.8-flash. Every request in the batch runs on this model.
input_file_namestring- Name of a JSONL input file already in the Files API (files/{id}), one request per line. Set requests or input_file_name, not both.
priorityinteger- Batch priority; higher values are processed first. Negative values are allowed. Default 0.
requestsarray- Inline requests. Each item is {"request": <generateContent request body>, "metadata": {"key": "<your id>"}}. Example: [{"request": {"contents": [{"parts": [{"text": "Describe photosynthesis."}]}]}, "metadata": {"key": "request-1"}}]. Keep the whole call under about 20 MB; use input_file_name for more.
gemini_create_cached_contentCreate an explicit context cache holding large, reused input (documents, media file URIs, a system instruction or tools) for one model, so later requests send only the new part.WriteCreate Cached Content
Create an explicit context cache holding large, reused input (documents, media file URIs, a system instruction or tools) for one model, so later requests send only the new part. Returns the cache: name (cachedContents/{id}), model, displayName, createTime, expireTime and usageMetadata.totalTokenCount. Use when many requests share a long prefix; pass the returned name as cached_content to gemini_generate_content. Gemini 2.5 and newer also cache implicitly with no setup. Explicit caching is not available for Gemini 4 Argon and later models, and the cached input must meet the model's minimum token count. Charges apply for cached tokens and storage time to the API key's Google Cloud project.
Inputs
modelstringrequired- Model id without the models/ prefix, for example gemini-2.5-flash. The cache can only be used with this model.
contentsarray- Content to cache, in the same format as gemini_generate_content contents: turns with a role and parts (text, inlineData base64 or fileData file URIs). Example: [{"role": "user", "parts": [{"fileData": {"mimeType": "application/pdf", "fileUri": "https://generativelanguage.googleapis.com/v1beta/files/abc-123"}}]}].
display_namestring- Readable name for the cache, up to 128 characters.
expire_timestring- Absolute expiry time in UTC, RFC 3339, for example 2026-10-21T18:00:00Z. Set ttl or expire_time, not both.
system_instructionstring- System instruction that sets the model's role, tone or rules. Text only.
tool_configobject- Tool configuration. Use {"functionCallingConfig": {"mode": "ANY", "allowedFunctionNames": ["get_weather"]}} to force a function call, mode AUTO to let the model decide, or NONE to forbid calls.
toolsarray- Tools the model may use. Each entry is one tool object: {"googleSearch": {}} grounds the answer in Google Search; {"urlContext": {}} lets the model read URLs in the prompt; {"codeExecution": {}} lets it run Python; {"fileSearch": {"fileSearchStoreNames": ["fileSearchStores/my-store"]}} searches a File Search store; {"functionDeclarations": [{"name": "get_weather", "description": "Get the weather", "parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}}]} declares functions the caller runs. Example: [{"googleSearch": {}}].
ttlstring- Time to live as seconds with an s suffix, for example 3600s for one hour. Set ttl or expire_time, not both.
gemini_create_embeddings_batchCreate an asynchronous batch job that embeds many inputs with a Gemini embedding model at a lower price, from texts, inline requests or a JSONL file in the Files API.WriteCreate Embeddings Batch
Create an asynchronous batch job that embeds many inputs with a Gemini embedding model at a lower price, from texts, inline requests or a JSONL file in the Files API. Returns a batch operation: name (batches/{id}) and metadata with its state. Use for large embedding jobs. Poll with gemini_get_batch. Use gemini_batch_embed_contents for a short list that should return immediately. Charges apply to the API key's Google Cloud project at batch rates.
Inputs
display_namestringrequired- Readable name for the batch.
modelstringrequired- Model id without the models/ prefix, for example gemini-embedding-2. Use an embedding model.
input_file_namestring- Name of a JSONL input file already in the Files API (files/{id}), one request per line. Set requests or input_file_name, not both.
priorityinteger- Batch priority; higher values are processed first. Negative values are allowed. Default 0.
requestsarray- Inline embed requests, used instead of texts. Each item is {"request": {"content": {"parts": [{"text": "..."}]}, "taskType": "RETRIEVAL_DOCUMENT"}, "metadata": {"key": "doc-1"}}.
textsarray- Texts to embed, one embedding each; the tool wraps each as a request with metadata key text-<index>. Example: ["What is AI?", "How do magnets work?"].
gemini_create_interactionCreate an interaction on the Gemini Interactions API (beta): run a model or a managed agent such as Deep Research on text or multimodal input, with optional server-side conversation state, tools, structured output and background execution.WriteCreate Interaction
Create an interaction on the Gemini Interactions API (beta): run a model or a managed agent such as Deep Research on text or multimodal input, with optional server-side conversation state, tools, structured output and background execution. Non-streaming. Returns the interaction: id, status (completed, in_progress, requires_action, failed and so on), model or agent, steps (thoughts, tool calls and the model_output content) and usage. Use for agents, background or long-running jobs, and multi-turn chats continued with previous_interaction_id. Use gemini_generate_content for a single stateless request, and gemini_get_interaction to poll a background run. Charges apply to the API key's Google Cloud project; interactions are stored (55 days on paid tier, 1 day on free tier) unless store is false.
Inputs
inputstringrequired- The input: a plain string, or an array of content blocks such as {"type": "text", "text": "..."}, {"type": "image", "mime_type": "image/png", "data": "<base64>"}, or {"type": "image", "uri": "<Files API uri>"}. To answer a function call, send a step list such as [{"type": "function_result", "call_id": "<id from the function_call step>", "name": "get_weather", "result": {"temp_c": 21}}] with previous_interaction_id. Example: "Explain how AI works in a few words".
agentstring- Managed agent to run instead of a model, for example deep-research-preview-04-2026 or deep-research-max-preview-04-2026. Agents need background set to true.
agent_configobject- Agent-specific settings for the chosen agent, as documented for that agent.
backgroundboolean- Run in the background and return immediately; poll with gemini_get_interaction. Required for agents. Not allowed with store false.
generation_configobject- Generation settings: temperature, top_p, max_output_tokens, stop_sequences, seed, thinking_level (minimal, low, medium, high), thinking_summaries (auto, none), tool_choice, image_config.
modelstring- Model id, for example gemini-3.8-flash. Set exactly one of model or agent.
previous_interaction_idstring- Id of the previous interaction to continue the conversation from, so the server supplies the history.
response_formatobject- Output format. For JSON output use {"type": "text", "mime_type": "application/json", "schema": {...JSON Schema...}}; for images {"type": "image", "aspect_ratio": "16:9"}.
response_modalitiesarray- Output modalities to request, from TEXT, IMAGE and AUDIO. Example: ["TEXT", "IMAGE"].
service_tierstring- Service tier: standard, flex (cheaper, best effort), priority, or deferred.one of
standardflexprioritydeferred storeboolean- Whether to store the interaction (default true). Set false to keep nothing; this disables previous_interaction_id and background.
system_instructionstring- System instruction for this interaction. It is not carried over by previous_interaction_id.
toolsarray- Tools for this interaction, each with a type, for example [{"type": "google_search"}], [{"type": "url_context"}], [{"type": "code_execution"}], or [{"type": "function", "name": "get_weather", "description": "Get the weather", "parameters": {"type": "object", "properties": {"city": {"type": "string"}}}}].
gemini_embed_contentCreate one embedding vector from text or multimodal content with a Gemini embedding model.WriteEmbed Content
Create one embedding vector from text or multimodal content with a Gemini embedding model. Returns embedding.values, an array of floats. Use for a single input. Use gemini_batch_embed_contents for a list of texts in one call, and gemini_create_embeddings_batch for large asynchronous jobs.
Inputs
modelstringrequired- Model id without the models/ prefix, for example gemini-embedding-2. Use an embedding model.
contentobject- Content to embed, for multimodal input: a parts array of text and inline base64 media. With gemini-embedding-2 all parts are combined into one embedding. Example: {"parts": [{"text": "A red bicycle"}, {"inlineData": {"mimeType": "image/png", "data": "<base64>"}}]}.
output_dimensionalityinteger- Truncate the embedding to this many dimensions, for example 768, 1536 or 3072. Leave empty for the model's full size.
task_typestring- What the embedding is for, which tunes it: RETRIEVAL_QUERY, RETRIEVAL_DOCUMENT, SEMANTIC_SIMILARITY, CLASSIFICATION, CLUSTERING, QUESTION_ANSWERING, FACT_VERIFICATION or CODE_RETRIEVAL_QUERY. Honoured by gemini-embedding-001; for text with gemini-embedding-2 Google recommends a task prefix in the text instead.one of
RETRIEVAL_QUERYRETRIEVAL_DOCUMENTSEMANTIC_SIMILARITYCLASSIFICATIONCLUSTERINGQUESTION_ANSWERINGFACT_VERIFICATIONCODE_RETRIEVAL_QUERY textstring- Text to embed. Ignored when content is set.
titlestring- Document title. Only used with task_type RETRIEVAL_DOCUMENT, where it improves retrieval quality.
gemini_generate_contentSend a prompt or conversation to a Gemini model and get the next response (non-streaming), with optional system instruction, multimodal inputs (inline base64 or file URIs), tools such as Google Search grounding, URL context, code execution and function calling, structured JSON output, thinking settings and a context cache.WriteGenerate Content
Send a prompt or conversation to a Gemini model and get the next response (non-streaming), with optional system instruction, multimodal inputs (inline base64 or file URIs), tools such as Google Search grounding, URL context, code execution and function calling, structured JSON output, thinking settings and a context cache. Returns candidates (content.parts with text, functionCall, inlineData or executableCode, finishReason, safetyRatings, groundingMetadata with sources), promptFeedback and usageMetadata token counts. Use for text, chat, analysis of images, audio, video and documents, and structured output. Use gemini_generate_image for a simple image request, gemini_create_interaction for server-side conversation state or agents, and gemini_create_batch for many requests at half price. Charges apply to the API key's Google Cloud project for tokens used.
Inputs
modelstringrequired- Model id without the models/ prefix, for example gemini-3.8-flash. Use gemini_list_models to find models that support generateContent.
cached_contentstring- Name of a context cache to reuse as the prompt prefix, in the form cachedContents/{id}. The cache must have been created for the same model.
contentsarray- Conversation turns, oldest first. Each turn has a role (user or model) and a parts array. A part is one of: text ({"text": "..."}); inline media as base64 ({"inlineData": {"mimeType": "image/png", "data": "<base64>"}}), for images, audio, video or PDF up to the request size limit; or a file reference ({"fileData": {"mimeType": "video/mp4", "fileUri": "https://generativelanguage.googleapis.com/v1beta/files/abc-123"}}) for a file already in the Files API or a public YouTube URL. Function results go back as {"functionResponse": {"name": "...", "response": {...}}}. Example: [{"role": "user", "parts": [{"text": "Summarize this in one line."}]}]. Use prompt instead for a single text turn.
generation_configobject- Generation settings. Common keys: temperature, topP, topK, maxOutputTokens, stopSequences, candidateCount, seed; thinkingConfig ({"thinkingLevel": "LOW"} or {"thinkingBudget": 1024}, {"includeThoughts": true}); structured output with responseMimeType "application/json" plus responseJsonSchema (a JSON Schema) or responseSchema (OpenAPI subset); responseModalities such as ["TEXT", "IMAGE"] and imageConfig ({"aspectRatio": "16:9"}) for image models. Example: {"responseMimeType": "application/json", "responseJsonSchema": {"type": "object", "properties": {"title": {"type": "string"}}, "required": ["title"]}}.
promptstring- Single user text turn. Shortcut for contents when you only need to send text; ignored when contents is set.
safety_settingsarray- Safety thresholds, at most one per category. Each entry has a category (HARM_CATEGORY_HARASSMENT, HARM_CATEGORY_HATE_SPEECH, HARM_CATEGORY_SEXUALLY_EXPLICIT, HARM_CATEGORY_DANGEROUS_CONTENT or HARM_CATEGORY_CIVIC_INTEGRITY) and a threshold (BLOCK_LOW_AND_ABOVE, BLOCK_MEDIUM_AND_ABOVE, BLOCK_ONLY_HIGH, BLOCK_NONE or OFF). Example: [{"category": "HARM_CATEGORY_HARASSMENT", "threshold": "BLOCK_ONLY_HIGH"}].
service_tierstring- Service tier: standard (default), flex for cheaper best-effort capacity, or priority for higher-priority capacity where your project has it.one of
standardflexpriority system_instructionstring- System instruction that sets the model's role, tone or rules. Text only.
tool_configobject- Tool configuration. Use {"functionCallingConfig": {"mode": "ANY", "allowedFunctionNames": ["get_weather"]}} to force a function call, mode AUTO to let the model decide, or NONE to forbid calls.
toolsarray- Tools the model may use. Each entry is one tool object: {"googleSearch": {}} grounds the answer in Google Search; {"urlContext": {}} lets the model read URLs in the prompt; {"codeExecution": {}} lets it run Python; {"fileSearch": {"fileSearchStoreNames": ["fileSearchStores/my-store"]}} searches a File Search store; {"functionDeclarations": [{"name": "get_weather", "description": "Get the weather", "parameters": {"type": "object", "properties": {"city": {"type": "string"}}, "required": ["city"]}}]} declares functions the caller runs. Example: [{"googleSearch": {}}].
gemini_generate_imageGenerate or edit an image from a text prompt with a Gemini image model (Nano Banana), optionally from input images given as base64.WriteGenerate Image
Generate or edit an image from a text prompt with a Gemini image model (Nano Banana), optionally from input images given as base64. Returns candidates whose content.parts hold the image as inlineData (mimeType and base64 data), sometimes with accompanying text, plus usageMetadata. Use for text-to-image and image editing. Use gemini_generate_content for full control of contents and generation settings, and gemini_generate_video for video. Charges apply per generated image to the API key's Google Cloud project.
Inputs
modelstringrequired- Model id without the models/ prefix, for example gemini-nano-banana-2.1. Use an image model such as gemini-nano-banana-2.1, gemini-3.1-flash-image or gemini-3-pro-image.default
gemini-nano-banana-2.1 promptstringrequired- Description of the image to create, or of the change to make to the input images.
aspect_ratiostring- Aspect ratio of the output image. Leave empty to let the model choose (it matches an input image when there is one).one of
1:11:44:11:88:12:33:23:44:34:55:49:1616:921:9 image_sizestring- Output resolution: 512, 1K (default), 2K or 4K. Support varies by model.one of
5121K2K4K imagesarray- Input images as base64, for editing, style transfer or combining images. Each item is {"mimeType": "image/png", "data": "<base64>"} (image/png, image/jpeg or image/webp). Example: [{"mimeType": "image/png", "data": "iVBORw0KGgoAAAANSUhEUg=="}].
response_modalitiesarray- Output types to request: ["TEXT", "IMAGE"] for an image with optional text, or ["IMAGE"] for the image only. Leave empty for the model default.
gemini_generate_videoGenerate or edit a short video with audio from a text prompt using Gemini Omni Flash on the Interactions API, optionally guided by base64 images (start frame, or first and last frame) or an existing video file to edit.WriteGenerate Video
Generate or edit a short video with audio from a text prompt using Gemini Omni Flash on the Interactions API, optionally guided by base64 images (start frame, or first and last frame) or an existing video file to edit. Returns the interaction: id, status and steps; the model_output step holds the video as base64 data (delivery inline) or as a Files API uri to fetch later (delivery uri). Use for video generation. Set background to true for long renders and poll with gemini_get_interaction. Pass previous_interaction_id to refine a video you generated earlier. Charges apply per second of generated video to the API key's Google Cloud project.
Inputs
promptstringrequired- Description of the video, including subject, action, camera movement and sound. For edits, describe the change.
aspect_ratiostring- 16:9 landscape (default) or 9:16 portrait.one of
16:99:16 backgroundboolean- Run in the background and return immediately with status in_progress; poll with gemini_get_interaction.
deliverystring- How the video is returned: inline puts base64 MP4 data in the response (the API default); uri returns a Files API uri instead and is needed for videos over 4 MB. The uri is downloaded with the API key and is not fetched by this tool.one of
inlineuri imagesarray- Images to animate, as base64. One image is used as a guide or start frame; two images are treated as the first and last frame. Each item is {"mime_type": "image/jpeg", "data": "<base64>"}.
modelstring- Video model id. Defaults to gemini-omni-1.1-flash.default
gemini-omni-1.1-flash previous_interaction_idstring- Id of an earlier video interaction to refine or extend in a multi-turn edit.
resolutionstring- Output resolution: 360p, 720p (default), 1080p or 4k. Higher resolutions take longer.one of
360p720p1080p4k video_uristring- URI of a video to edit or extend, from the Files API (10 seconds or shorter for uploaded videos). Example: https://generativelanguage.googleapis.com/v1beta/files/abc-123.
gemini_update_cached_contentChange when a context cache expires, by a new ttl or an absolute expire_time.WriteUpdate Cached Content
Change when a context cache expires, by a new ttl or an absolute expire_time. Nothing else about a cache can be changed. Returns the updated cache with its new expireTime. Use to keep a cache alive longer or let it expire sooner. Use gemini_delete_cached_content to remove it now.
- Idempotent
Inputs
namestringrequired- Cache resource name in the form cachedContents/{id}, as returned in the name field by gemini_create_cached_content or gemini_list_cached_contents.
expire_timestring- Absolute expiry time in UTC, RFC 3339, for example 2026-10-21T18:00:00Z. Set ttl or expire_time, not both.
ttlstring- Time to live as seconds with an s suffix, for example 3600s for one hour. Set ttl or expire_time, not both.
gemini_delete_batchDelete a batch job record.DestructiveDelete Batch
Delete a batch job record. A running batch is not cancelled by deletion. Returns an empty object on success. Use to clean up finished batches. Use gemini_cancel_batch to stop a running batch first.
- Idempotent
Inputs
namestringrequired- Batch resource name in the form batches/{id}, as returned in the name field when the batch was created.
gemini_delete_cached_contentDelete a context cache so it stops incurring storage charges.DestructiveDelete Cached Content
Delete a context cache so it stops incurring storage charges. Returns an empty object on success. Use when a cache is no longer needed. Use gemini_update_cached_content to change its expiry instead.
- Idempotent
Inputs
namestringrequired- Cache resource name in the form cachedContents/{id}, as returned in the name field by gemini_create_cached_content or gemini_list_cached_contents.
gemini_delete_fileDelete a file from the Gemini Files API before its automatic 48-hour expiry.DestructiveDelete File
Delete a file from the Gemini Files API before its automatic 48-hour expiry. Returns an empty object on success. Use to remove a file that is no longer needed. Use gemini_list_files to find file names.
- Idempotent
Inputs
namestringrequired- File resource name in the form files/{id}, as returned in the name field by gemini_list_files. This is not the file's uri.
gemini_delete_interactionDelete a stored interaction by id.DestructiveDelete Interaction
Delete a stored interaction by id. Returns an empty object on success. Use to remove stored conversation data before its retention period ends. Use gemini_cancel_interaction to stop a running background interaction.
- Idempotent
Inputs
interaction_idstringrequired- Interaction id, the id field returned by gemini_create_interaction or gemini_generate_video (for example v1_ChdhYmNk...).
No tools match.