Skip to content
Scalekit Docs
Talk to an Engineer Dashboard

Connect AI agents to Google Gemini

Scalekit connector
Open markdown

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

Setup

  1. Install the SDK

    Terminal window
    npm install @scalekit-sdk/node dotenv
  2. Set your credentials

    Add your Scalekit credentials to your .env file. 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>
  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.

  4. 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.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)
    Terminal window
    npx tsx quickstart.mts

    Each 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 to execute_tool
Try in PlaygroundRequest a tool
  • gemini_get_batchGet a batch job's status and, once finished, its results.Read-only

    Get 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-only

    Get 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-only

    Get 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-only

    Get 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-only

    Get 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-only

    List 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-only

    List 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-only

    List 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.