> ## Documentation Index
> Fetch the complete documentation index at: https://composio-preview.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Gemini

> Comprehensive Gemini integration supporting Veo 3 video generation, Gemini Flash text generation (Nano Banana), chat completions, and multimodal AI capabilities via the Google Gemini API.

![Gemini logo](https://mintcdn.com/composio-preview/GL28i3tBlbEbBd-f/images/toolkits/gemini.svg?fit=max\&auto=format\&n=GL28i3tBlbEbBd-f\&q=85\&s=8067986c1eca721a6721fa9ee15ef821)

* **Category:** artificial intelligence
* **Auth:** NO\_AUTH, API\_KEY
* **Composio-managed OAuth available?** N/A
* **Tools:** 8
* **Triggers:** 0
* **Slug:** `GEMINI`
* **Version:** 20261101\_00
* **Instant:** Supported on the latest version. Support varies by tool.

## Frequently Asked Questions

> [accordion] How does Gemini shared quota work?
>
> Gemini no-auth toolkit calls use Composio-managed Gemini credentials at execution time, so provider quota is shared across usage on that runtime key. If you see Gemini 429 or `RESOURCE_EXHAUSTED` errors, reduce concurrency and retry with exponential backoff.
>
> Bring-your-own-key or custom-key quota isolation is not currently supported for this Gemini no-auth path. Support for custom Gemini API keys is being worked on.

> [accordion] How is Gemini no-auth toolkit usage logged?
>
> Gemini no-auth toolkit calls are logged like other toolkit calls and can be tracked in Composio tool logs. Treat Gemini usage as regular toolkit usage based on tool calls.

## Tools

> [accordion] Count Tokens (Gemini)
>
> **Slug:** `GEMINI_COUNT_TOKENS`
>
> Counts the number of tokens in text using Gemini tokenization. Useful for estimating costs, checking input limits, and optimizing prompts before making API calls.
>
> #### Input Parameters
>
> **text** `string` *required*
>
> Text to count tokens for
>
> **model** `string`
>
> Model to use for token counting. Must be a model that supports the countTokens method. Use the ListModels action to see available models and their supported methods.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Embed Content (Gemini)
>
> **Slug:** `GEMINI_EMBED_CONTENT`
>
> Generates text embeddings using Gemini embedding models. Converts text into numerical vectors for semantic search, similarity comparison, clustering, and classification tasks.
>
> #### Input Parameters
>
> **text** `string` *required*
>
> The text content to generate embeddings for.
>
> **model** `string`
>
> Embedding model to use. Options: 'text-embedding-004' (768 dimensions, default), 'gemini-embedding-001' (3072 dimensions, latest).
>
> **title** `string`
>
> Optional title for the content. Use with task\_type='RETRIEVAL\_DOCUMENT' to improve embedding quality for document search.
>
> **task\_type** `string`
>
> Specifies the intended use case to optimize the embedding. Options: 'RETRIEVAL\_QUERY' (search queries), 'RETRIEVAL\_DOCUMENT' (documents to be searched), 'SEMANTIC\_SIMILARITY' (text similarity), 'CLASSIFICATION' (categorization), 'CLUSTERING' (grouping), 'QUESTION\_ANSWERING' (question-document matching). Note: Some task types like 'CODE\_RETRIEVAL\_QUERY' may only be supported by certain models.
>
> **output\_dimensionality** `integer`
>
> Truncate the embedding to this number of dimensions. Only supported by 'gemini-embedding-001' model. Recommended values: 768, 1536, or 3072. Lower dimensions reduce storage but may affect quality.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Generate Content (Gemini)
>
> **Slug:** `GEMINI_GENERATE_CONTENT`
>
> Generates text content or speech audio from prompts using Gemini models. Supports text generation models (Gemini Flash, Pro) and text-to-speech models with configurable parameters. Generated text is nested at results\[i].response.data.text. Output may be wrapped in markdown fences (e.g., `html...`) or preceded by explanatory prose; strip these before file writing or rendering.
>
> #### Input Parameters
>
> **model** `string`
>
> Model to use for generation. Text generation models: 'gemini-2.5-flash' (default, fast & efficient), 'gemini-2.5-pro' (advanced reasoning), 'gemini-2.0-flash' (previous generation), 'gemini-2.0-flash-lite' (cost-optimized). Text-to-speech models: 'gemini-2.5-flash-preview-tts' (low latency), 'gemini-2.5-pro-preview-tts' (high quality). Note: TTS models require voice\_name parameter and return audio data instead of text.
>
> **top\_k** `integer`
>
> Top-k sampling parameter
>
> **top\_p** `number`
>
> Nucleus sampling parameter (0.0 to 1.0)
>
> **prompt** `string` *required*
>
> REQUIRED. The text prompt for content generation. This field must be provided. Example: 'Write a short poem about the ocean' or 'Explain quantum computing in simple terms'. For TTS models, include style instructions in the prompt (e.g., 'Say cheerfully: Hello!').
>
> **voice\_name** `string ("Achernar" | "Achird" | "Algenib" | "Algieba" | "Alnilam" | "Aoede" | "Autonoe" | "Callirrhoe" | "Charon" | "Despina" | "Enceladus" | "Erinome" | "Fenrir" | "Gacrux" | "Iapetus" | "Kore" | "Laomedeia" | "Leda" | "Orus" | "Puck" | "Pulcherrima" | "Rasalgethi" | "Sadachbia" | "Sadaltager" | "Schedar" | "Sulafat" | "Umbriel" | "Vindemiatrix" | "Zephyr" | "Zubenelgenubi")`
>
> Available prebuilt voices for text-to-speech generation.  Complete list of 30 official Gemini TTS voices as documented at: [https://ai.google.dev/gemini-api/docs/speech-generation](https://ai.google.dev/gemini-api/docs/speech-generation)
>
> **temperature** `number`
>
> Controls randomness (0.0 to 2.0)
>
> **stop\_sequences** `array`
>
> Sequences where generation should stop
>
> **safety\_settings** `array`
>
> Safety filter settings
>
> **max\_output\_tokens** `integer`
>
> Maximum number of tokens to generate If response finishReason='MAX\_TOKENS', output was truncated; narrow prompt scope or increase this value and regenerate.
>
> **system\_instruction** `string`
>
> System instruction to guide the model's behavior
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Generate Image (Nano Banana)
>
> **Slug:** `GEMINI_GENERATE_IMAGE`
>
> Generates a downloadable image from a text prompt, defaulting to Nano Banana 2 Lite on managed connections and Gemini 3 Pro Image Preview on other connections. Managed requests require a 1–1000 character prompt and default 1K square settings; a timeout can leave the provider outcome unknown.
>
> **Instant:** Supported on the latest version.
>
> **Instant pricing:** \$0.033 per 1K image, plus \$0.25/1M input and \$1.5/1M output tokens.
>
> #### Input Parameters
>
> **model** `string ("gemini-2.5-flash-image" | "gemini-3.1-flash-lite-image" | "gemini-3-pro-image-preview" | "gemini-2.0-flash-exp-image-generation")`
>
> Gemini models that support native image generation.  Models: GEMINI\_3\_1\_FLASH\_LITE\_IMAGE is the default. Some connections allow only this model; availability of the others depends on Google. - GEMINI\_3\_1\_FLASH\_LITE\_IMAGE: Nano Banana 2 Lite, 1K only - GEMINI\_2\_5\_FLASH\_IMAGE: Legacy Nano Banana image model - GEMINI\_3\_PRO\_IMAGE\_PREVIEW: Advanced model (Nano Banana Pro) - 4K resolution, thinking mode - GEMINI\_2\_0\_FLASH\_EXP\_IMAGE\_GENERATION: 2.0 Flash experimental image generation
>
> **top\_k** `integer`
>
> Top-k sampling parameter
>
> **top\_p** `number`
>
> Nucleus sampling parameter (0.0 to 1.0)
>
> **prompt** `string` *required*
>
> Text prompt for image generation Sensitive, trademarked, or explicit content triggers HTTP 400 (PROHIBITED\_CONTENT or IMAGE\_RECITATION) with no image returned — rephrase into neutral, policy-compliant language rather than retrying identical prompts.
>
> **timeout** `number`
>
> Request timeout in seconds. Default is 300 seconds (5 minutes). Increase for complex prompts or high-resolution images. Minimum 120 seconds, maximum 600 seconds.
>
> **image\_size** `string ("1K" | "2K" | "4K")`
>
> Output resolution. Nano Banana 2 Lite supports only 1K. Pro supports 1K/2K/4K; legacy Flash choices use their default output size.
>
> **temperature** `number`
>
> Controls randomness (0.0 to 2.0)
>
> **aspect\_ratio** `string ("1:1" | "2:3" | "3:2" | "3:4" | "4:3" | "4:5" | "5:4" | "9:16" | "16:9" | "21:9")`
>
> Aspect ratio. Values must be supported by the selected model; unsupported values are rejected. Connections limited to Nano Banana 2 Lite accept only '1:1'.
>
> **safety\_settings** `array`
>
> Safety filter settings. List of objects specifying content categories to filter and threshold levels. Each setting requires 'category' (HARM\_CATEGORY\_HARASSMENT, HARM\_CATEGORY\_HATE\_SPEECH, HARM\_CATEGORY\_SEXUALLY\_EXPLICIT, or HARM\_CATEGORY\_DANGEROUS\_CONTENT) and 'threshold' (BLOCK\_NONE, BLOCK\_LOW\_AND\_ABOVE, BLOCK\_MEDIUM\_AND\_ABOVE, or BLOCK\_ONLY\_HIGH).
>
> **max\_output\_tokens** `integer`
>
> Output token budget; valid limits and image token usage depend on the selected model. Connections limited to Nano Banana 2 Lite require the default, so omit this field there.
>
> **system\_instruction** `string`
>
> System instruction to guide image generation behavior
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Generate Videos (Veo)
>
> **Slug:** `GEMINI_GENERATE_VIDEOS`
>
> Submits a Veo 3.1 Lite video generation request and returns an operation handle for tracking; submission does not mean the video is ready, and a timeout can leave acceptance unknown. Managed requests require a 1–1000 character prompt, 720p and an explicit 4, 6 or 8 second duration.
>
> **Instant:** Supported on the latest version.
>
> **Instant pricing:** \$0.20, \$0.30 or \$0.40 per 4, 6 or 8-second 720p video.
>
> #### Input Parameters
>
> **seed** `integer`
>
> Seed value for reproducibility. Supported by the Veo 3.1 models.
>
> **model** `string ("veo-3.1-lite-generate-preview")`
>
> Video model. Only Veo 3.1 Lite ('veo-3.1-lite-generate-preview') is supported; omit this field or pass it explicitly. Legacy values 'veo-3.1-generate-preview' / 'veo-3.1-fast-generate-preview' are coerced to Lite on some connections and rejected on others.
>
> **prompt** `string` *required*
>
> Text prompt for Veo video generation. Must be a non-empty string describing the video to generate.
>
> **resolution** `string ("720p")`
>
> Video resolution. Only 720p is generated, at \$0.05 per second. Omit or pass 720p; on some connections legacy 1080p values are normalized to 720p, on others they are rejected.
>
> **aspect\_ratio** `string ("16:9" | "9:16")`
>
> Supported aspect ratios for video generation.
>
> **negative\_prompt** `string`
>
> Text describing content to avoid in the generated video (e.g., 'cartoon, drawing, low quality').
>
> **duration\_seconds** `integer ("4" | "6" | "8")`
>
> Video duration: integer 4, 6 or 8 seconds. Pass an explicit number; legacy enum names are accepted only on some connections.
>
> **person\_generation** `string ("allow_all")`
>
> Person generation safety setting (Veo 3.1 supports only ALLOW\_ALL).
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Get Videos Operation (Veo)
>
> **Slug:** `GEMINI_GET_VIDEOS_OPERATION`
>
> Checks an existing Veo operation without downloading media. Managed connections return status and next\_action while hiding provider media URLs; other connections can return the operation response and video URLs, and the same handle can be reused to check progress or retrieve the video.
>
> **Instant:** Supported on the latest version.
>
> **Instant pricing:** \$0 per request
>
> #### Input Parameters
>
> **operation\_name** `string` *required*
>
> Pass the exact operation\_name returned by GEMINI\_GENERATE\_VIDEOS unchanged. On some connections a full Google operation resource name or a bare operation ID (expanded to the default Lite model) is also accepted. Poll this same handle; do not submit another generation merely because the job is pending.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] List Models (Gemini API)
>
> **Slug:** `GEMINI_LIST_MODELS`
>
> Lists available Gemini and Veo models with their capabilities and limits. Useful for discovering supported models and their features before making generation requests.
>
> #### Input Parameters
>
> **page\_size** `integer`
>
> Maximum number of models to return per page (default 50, max 1000).
>
> **page\_token** `string`
>
> Token from a previous response's nextPageToken to retrieve the next page.
>
> **filter\_prefix** `string`
>
> Filter models by name prefix (client-side). Leave empty to get all models.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not

> [accordion] Wait and Download Video (Veo)
>
> **Slug:** `GEMINI_WAIT_FOR_VIDEO`
>
> Polls an existing Veo operation and downloads its MP4 when ready. Each call polls for a bounded time (about 20 seconds on some connections). pending=true with success=null means this call did not retrieve a terminal result; the job may still be running or may already have completed after a poll timeout. Reuse the exact returned operation\_name with this action or GEMINI\_GET\_VIDEOS\_OPERATION; do not resubmit a paid generation to continue. success=true includes video\_file, while success=false indicates terminal safety filtering. Provider errors fail the call. A new generation is a separate request and can incur another charge.
>
> **Instant:** Supported on the latest version.
>
> **Instant pricing:** \$0 per request
>
> #### Input Parameters
>
> **operation\_name** `string` *required*
>
> Pass the exact operation\_name returned by GEMINI\_GENERATE\_VIDEOS unchanged (a signed handle or a full Google resource name models/\<model>/operations/\<id>). Use the actual returned handle, never a placeholder. A pending result reuses this same handle; do not create a new paid generation to continue polling.
>
> #### Output
>
> **data** `string` *required*
>
> Data from the action execution
>
> **error** `string`
>
> Error if any occurred during the execution of the action
>
> **successful** `boolean` *required*
>
> Whether or not the action execution was successful or not
