> **Building with AI coding agents?** Install the authstack plugin with one command. This equips your agent with accurate Scalekit implementation patterns.
>
> **Recommended** (the `-y` flags skip prompts, so the command runs without an interactive terminal):
> ```bash
> npx -y @scalekit-inc/cli setup -y
> ```
>
> Global:
> ```bash
> npm install -g @scalekit-inc/cli
> scalekit setup -y
> ```
>
> Supports Claude Code, Cursor, GitHub Copilot, Codex + skills for other Agent Skills-compatible agents in `~/.agents/skills`.
> Skills: integrate-agentkit, implement-saaskit, add-mcp-oauth, implement-sso, implement-scim.
> [Full setup guide](https://docs.scalekit.com/dev-kit/build-with-ai/)

---

# Connect AI agents to Google Gemini

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.

**Authentication:** API Key
**Categories:** AI, Media
**Tools:** 26: 9 read, 13 write, 4 destructive
**Users sign in with:** API key
**Built by:** Scalekit connector
**Try it:** [Playground in the Scalekit dashboard](https://app.scalekit.com/ws/signup?sk_intent=playground&provider=GEMINI)

## Setup

1. ### Install the SDK

   **Node.js**

   ```bash
   npm install @scalekit-sdk/node dotenv
   ```

   **Python**

   ```bash
   pip install scalekit-sdk-python python-dotenv
   ```

2. ### Set your credentials

   Add your Scalekit credentials to your `.env` file. Find values in **[app.scalekit.com](https://app.scalekit.com)** > **Developers** > **API Credentials**.

   ```sh title=".env"
   SCALEKIT_ENVIRONMENT_URL=<your-environment-url>
   SCALEKIT_CLIENT_ID=<your-client-id>
   SCALEKIT_CLIENT_SECRET=<your-client-secret>
   ```

3. ### Create the Google Gemini connection

   In **AgentKit > Connections**, create a Google Gemini connection. The name you give it is the `connection_name` your code passes. See [Configure connections](/agentkit/connections/).

4. ### Authorize a user and make your first call

   **Node.js** (`quickstart.mts`)

   ```typescript
   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.actions

   const connector = 'gemini'
   const identifier = 'user_123'

   // Generate an authorization link for the user
   const { 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 call
   const result = await actions.executeTool({
     connector,
     identifier,
     toolName: 'gemini_list_batches',
     toolInput: {},
   })
   console.log(result)
   ```

   ```bash
   npx tsx quickstart.mts
   ```

   **Python** (`quickstart.py`)

   ```python
   import os
   from scalekit import ScalekitClient
   from dotenv import load_dotenv
   load_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.actions

   connection_name = "gemini"
   identifier = "user_123"

   # Generate an authorization link for the user
   link_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 call
   result = actions.execute_tool(
       tool_input={},
       tool_name="gemini_list_batches",
       connection_name=connection_name,
       identifier=identifier,
   )
   print(result)
   ```

   ```bash
   python quickstart.py
   ```

   Each user opens the link once and enters their Google Gemini credentials there. See [Authorize a user](/agentkit/tools/authorize/) for the full flow and statuses.

## Tools

Pass the exact name to `execute_tool`, with an input like each tool's example. To ask for a tool that's missing, use the [request form](https://scalekitsupport.portal.usepylon.com/forms/request-a-connector-tool).

**Node.js**

```typescript
const result = await actions.executeTool({
  toolName: 'gemini_get_batch',
  toolInput: {
    name: '<name>',
  },
  connector: 'gemini',
  identifier: 'user_123',
})
```

**Python**

```python
result = actions.execute_tool(
    tool_name="gemini_get_batch",
    tool_input={
        "name": "<name>",
    },
    connection_name="gemini",
    identifier="user_123",
)
```

`result.data` is the app's response as JSON, and `result.execution_id` (`executionId` in Node.js) is the ID of the call.

### `gemini_get_batch`

Get Batch · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `name` (`string`, required): Batch resource name in the form batches/{id}, as returned in the name field when the batch was created.

Example input: `{"name":"<name>"}`

### `gemini_get_cached_content`

Get Cached Content · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `name` (`string`, required): Cache resource name in the form cachedContents/{id}, as returned in the name field by gemini_create_cached_content or gemini_list_cached_contents.

Example input: `{"name":"<name>"}`

### `gemini_get_file`

Get File · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `name` (`string`, required): 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.

Example input: `{"name":"<name>"}`

### `gemini_get_interaction`

Get Interaction · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `interaction_id` (`string`, required): Interaction id, the id field returned by gemini_create_interaction or gemini_generate_video (for example v1_ChdhYmNk...).
- `include_input` (`boolean`, optional): Include the user_input steps in the returned interaction.

Example input: `{"interaction_id":"<interaction_id>"}`

### `gemini_get_model`

Get Model · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `model` (`string`, required): Model id without the models/ prefix, for example gemini-3.8-flash. Use gemini_list_models to see valid ids.

Example input: `{"model":"<model>"}`

### `gemini_list_batches`

List Batches · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `filter` (`string`, optional): Optional list filter in the standard Google list filter syntax.
- `page_size` (`integer`, optional): Maximum number of batches per page. Defaults to 50; the API caps it at 1000.
- `page_token` (`string`, optional): Page token from the nextPageToken field of the previous response. Leave empty for the first page.

Example input: `{}`

### `gemini_list_cached_contents`

List Cached Contents · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `page_size` (`integer`, optional): Maximum number of caches per page. Defaults to 100; the API caps it at 1000.
- `page_token` (`string`, optional): Page token from the nextPageToken field of the previous response. Leave empty for the first page.

Example input: `{}`

### `gemini_list_files`

List Files · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `page_size` (`integer`, optional): Maximum number of files per page. Defaults to 10; the API caps it at 100.
- `page_token` (`string`, optional): Page token from the nextPageToken field of the previous response. Leave empty for the first page.

Example input: `{}`

### `gemini_list_models`

List Models · Read-only

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.

Read only: yes. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `page_size` (`integer`, optional): Maximum number of models per page. Defaults to 50; the API caps it at 1000.
- `page_token` (`string`, optional): Page token from the nextPageToken field of the previous response. Leave empty for the first page.

Example input: `{}`

### `gemini_batch_embed_contents`

Batch Embed Contents · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `model` (`string`, required): Model id without the models/ prefix, for example gemini-embedding-001. Use an embedding model.
- `texts` (`array`, required): Texts to embed, one embedding each. Example: ["What is AI?", "How do magnets work?"].
- `output_dimensionality` (`integer`, optional): Truncate the embedding to this many dimensions, for example 768, 1536 or 3072. Leave empty for the model's full size.
- `task_type` (`string`, optional): 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_QUERY`, `RETRIEVAL_DOCUMENT`, `SEMANTIC_SIMILARITY`, `CLASSIFICATION`, `CLUSTERING`, `QUESTION_ANSWERING`, `FACT_VERIFICATION`, `CODE_RETRIEVAL_QUERY`.

Example input: `{"model":"<model>","texts":["What is AI?","How do magnets work?"]}`

### `gemini_cancel_batch`

Cancel Batch · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `name` (`string`, required): Batch resource name in the form batches/{id}, as returned in the name field when the batch was created.

Example input: `{"name":"<name>"}`

### `gemini_cancel_interaction`

Cancel Interaction · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `interaction_id` (`string`, required): Interaction id, the id field returned by gemini_create_interaction or gemini_generate_video (for example v1_ChdhYmNk...).

Example input: `{"interaction_id":"<interaction_id>"}`

### `gemini_count_tokens`

Count Tokens · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `model` (`string`, required): Model id without the models/ prefix, for example gemini-3.8-flash. Token counts differ between models.
- `contents` (`array`, optional): 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.
- `prompt` (`string`, optional): Single user text turn. Shortcut for contents when you only need to send text; ignored when contents is set.
- `system_instruction` (`string`, optional): System instruction that sets the model's role, tone or rules. Text only.
- `tools` (`array`, optional): 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": {}}].

Example input: `{"model":"<model>"}`

### `gemini_create_batch`

Create Batch · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `display_name` (`string`, required): Readable name for the batch.
- `model` (`string`, required): Model id without the models/ prefix, for example gemini-3.8-flash. Every request in the batch runs on this model.
- `input_file_name` (`string`, optional): 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.
- `priority` (`integer`, optional): Batch priority; higher values are processed first. Negative values are allowed. Default 0.
- `requests` (`array`, optional): 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.

Example input: `{"display_name":"<display_name>","model":"<model>"}`

### `gemini_create_cached_content`

Create Cached Content · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `model` (`string`, required): Model id without the models/ prefix, for example gemini-2.5-flash. The cache can only be used with this model.
- `contents` (`array`, optional): 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_name` (`string`, optional): Readable name for the cache, up to 128 characters.
- `expire_time` (`string`, optional): Absolute expiry time in UTC, RFC 3339, for example 2026-10-21T18:00:00Z. Set ttl or expire_time, not both.
- `system_instruction` (`string`, optional): System instruction that sets the model's role, tone or rules. Text only.
- `tool_config` (`object`, optional): 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.
- `tools` (`array`, optional): 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": {}}].
- `ttl` (`string`, optional): Time to live as seconds with an s suffix, for example 3600s for one hour. Set ttl or expire_time, not both.

Example input: `{"model":"<model>"}`

### `gemini_create_embeddings_batch`

Create Embeddings Batch · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `display_name` (`string`, required): Readable name for the batch.
- `model` (`string`, required): Model id without the models/ prefix, for example gemini-embedding-2. Use an embedding model.
- `input_file_name` (`string`, optional): 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.
- `priority` (`integer`, optional): Batch priority; higher values are processed first. Negative values are allowed. Default 0.
- `requests` (`array`, optional): Inline embed requests, used instead of texts. Each item is {"request": {"content": {"parts": [{"text": "..."}]}, "taskType": "RETRIEVAL_DOCUMENT"}, "metadata": {"key": "doc-1"}}.
- `texts` (`array`, optional): 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?"].

Example input: `{"display_name":"<display_name>","model":"<model>"}`

### `gemini_create_interaction`

Create Interaction · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `input` (`string`, required): 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": ""}. 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".
- `agent` (`string`, optional): 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_config` (`object`, optional): Agent-specific settings for the chosen agent, as documented for that agent.
- `background` (`boolean`, optional): Run in the background and return immediately; poll with gemini_get_interaction. Required for agents. Not allowed with store false.
- `generation_config` (`object`, optional): 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.
- `model` (`string`, optional): Model id, for example gemini-3.8-flash. Set exactly one of model or agent.
- `previous_interaction_id` (`string`, optional): Id of the previous interaction to continue the conversation from, so the server supplies the history.
- `response_format` (`object`, optional): Output format. For JSON output use {"type": "text", "mime_type": "application/json", "schema": {...JSON Schema...}}; for images {"type": "image", "aspect_ratio": "16:9"}.
- `response_modalities` (`array`, optional): Output modalities to request, from TEXT, IMAGE and AUDIO. Example: ["TEXT", "IMAGE"].
- `service_tier` (`string`, optional): Service tier: standard, flex (cheaper, best effort), priority, or deferred. One of: `standard`, `flex`, `priority`, `deferred`.
- `store` (`boolean`, optional): Whether to store the interaction (default true). Set false to keep nothing; this disables previous_interaction_id and background.
- `system_instruction` (`string`, optional): System instruction for this interaction. It is not carried over by previous_interaction_id.
- `tools` (`array`, optional): 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"}}}}].

Example input: `{"input":"Explain how AI works in a few words"}`

### `gemini_embed_content`

Embed Content · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `model` (`string`, required): Model id without the models/ prefix, for example gemini-embedding-2. Use an embedding model.
- `content` (`object`, optional): 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_dimensionality` (`integer`, optional): Truncate the embedding to this many dimensions, for example 768, 1536 or 3072. Leave empty for the model's full size.
- `task_type` (`string`, optional): 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_QUERY`, `RETRIEVAL_DOCUMENT`, `SEMANTIC_SIMILARITY`, `CLASSIFICATION`, `CLUSTERING`, `QUESTION_ANSWERING`, `FACT_VERIFICATION`, `CODE_RETRIEVAL_QUERY`.
- `text` (`string`, optional): Text to embed. Ignored when content is set.
- `title` (`string`, optional): Document title. Only used with task_type RETRIEVAL_DOCUMENT, where it improves retrieval quality.

Example input: `{"model":"<model>"}`

### `gemini_generate_content`

Generate Content · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `model` (`string`, required): Model id without the models/ prefix, for example gemini-3.8-flash. Use gemini_list_models to find models that support generateContent.
- `cached_content` (`string`, optional): 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.
- `contents` (`array`, optional): 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_config` (`object`, optional): 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"]}}.
- `prompt` (`string`, optional): Single user text turn. Shortcut for contents when you only need to send text; ignored when contents is set.
- `safety_settings` (`array`, optional): 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_tier` (`string`, optional): Service tier: standard (default), flex for cheaper best-effort capacity, or priority for higher-priority capacity where your project has it. One of: `standard`, `flex`, `priority`.
- `system_instruction` (`string`, optional): System instruction that sets the model's role, tone or rules. Text only.
- `tool_config` (`object`, optional): 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.
- `tools` (`array`, optional): 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": {}}].

Example input: `{"model":"<model>"}`

### `gemini_generate_image`

Generate Image · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `model` (`string`, required): 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`.
- `prompt` (`string`, required): Description of the image to create, or of the change to make to the input images.
- `aspect_ratio` (`string`, optional): 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:1`, `1:4`, `4:1`, `1:8`, `8:1`, `2:3`, `3:2`, `3:4`, `4:3`, `4:5`, `5:4`, `9:16`, `16:9`, `21:9`.
- `image_size` (`string`, optional): Output resolution: 512, 1K (default), 2K or 4K. Support varies by model. One of: `512`, `1K`, `2K`, `4K`.
- `images` (`array`, optional): 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_modalities` (`array`, optional): Output types to request: ["TEXT", "IMAGE"] for an image with optional text, or ["IMAGE"] for the image only. Leave empty for the model default.

Example input: `{"model":"gemini-nano-banana-2.1","prompt":"<prompt>"}`

### `gemini_generate_video`

Generate Video · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): no.

Inputs:

- `prompt` (`string`, required): Description of the video, including subject, action, camera movement and sound. For edits, describe the change.
- `aspect_ratio` (`string`, optional): 16:9 landscape (default) or 9:16 portrait. One of: `16:9`, `9:16`.
- `background` (`boolean`, optional): Run in the background and return immediately with status in_progress; poll with gemini_get_interaction.
- `delivery` (`string`, optional): 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: `inline`, `uri`.
- `images` (`array`, optional): 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>"}.
- `model` (`string`, optional): Video model id. Defaults to gemini-omni-1.1-flash. Default: `gemini-omni-1.1-flash`.
- `previous_interaction_id` (`string`, optional): Id of an earlier video interaction to refine or extend in a multi-turn edit.
- `resolution` (`string`, optional): Output resolution: 360p, 720p (default), 1080p or 4k. Higher resolutions take longer. One of: `360p`, `720p`, `1080p`, `4k`.
- `video_uri` (`string`, optional): 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.

Example input: `{"prompt":"<prompt>"}`

### `gemini_update_cached_content`

Update Cached Content · Write

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.

Read only: no. Destructive: no. Idempotent (safe to retry): yes.

Inputs:

- `name` (`string`, required): 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_time` (`string`, optional): Absolute expiry time in UTC, RFC 3339, for example 2026-10-21T18:00:00Z. Set ttl or expire_time, not both.
- `ttl` (`string`, optional): Time to live as seconds with an s suffix, for example 3600s for one hour. Set ttl or expire_time, not both.

Example input: `{"name":"<name>"}`

### `gemini_delete_batch`

Delete Batch · Destructive

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.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `name` (`string`, required): Batch resource name in the form batches/{id}, as returned in the name field when the batch was created.

Example input: `{"name":"<name>"}`

### `gemini_delete_cached_content`

Delete Cached Content · Destructive

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.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `name` (`string`, required): Cache resource name in the form cachedContents/{id}, as returned in the name field by gemini_create_cached_content or gemini_list_cached_contents.

Example input: `{"name":"<name>"}`

### `gemini_delete_file`

Delete File · Destructive

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.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `name` (`string`, required): 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.

Example input: `{"name":"<name>"}`

### `gemini_delete_interaction`

Delete Interaction · Destructive

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.

Read only: no. Destructive: yes. Idempotent (safe to retry): yes.

Inputs:

- `interaction_id` (`string`, required): Interaction id, the id field returned by gemini_create_interaction or gemini_generate_video (for example v1_ChdhYmNk...).

Example input: `{"interaction_id":"<interaction_id>"}`

## Related

Other AI connectors ([all 148](/agentkit/connectors/?category=ai)):

- [Chorus](/agentkit/connectors/chorus/): Scalekit connector, Username and password, 9 tools
- [Gong](/agentkit/connectors/gong/): Scalekit connector, OAuth, 69 tools
- [Jiminny](/agentkit/connectors/jiminny/): Scalekit connector, Access token, 27 tools


---

## More Scalekit documentation

| Resource | What it contains | When to use it |
|----------|-----------------|----------------|
| [/llms.txt](/llms.txt) | Structured index with routing hints per product area | Start here — find which documentation set covers your topic before loading full content |
| [/llms-full.txt](/llms-full.txt) | Complete documentation for all Scalekit products in one file | Use when you need exhaustive context across multiple products or when the topic spans several areas |
| [sitemap-0.xml](https://docs.scalekit.com/sitemap-0.xml) | Full URL list of every documentation page | Use to discover specific page URLs you can fetch for targeted, page-level answers |
