Gemini API

Give your agents access to Gemini API. Bring your own Gemini key, or skip the signup and pay per call from your Composio balance with Composio Instant.

Gemini logoGemini
Instant

Gemini is Google's multimodal AI platform for generating text, video, and rich chat completions. It's a one-stop shop for advanced AI content creation and intelligent automation.

8 Tools
COMPOSIO INSTANT

What is Composio Instant?

Composio Instant lets your agent use paid APIs like Gemini without a separate account or API key for each one. New accounts start with $2 of free credit.

No Gemini account or key

Your agent calls Gemini through Composio, so there is nothing to sign up for, store, or rotate.

Pay per call, at cost

$0.033 per 1K image, plus $0.25/1M input and $1.5/1M output tokens., paid from your Composio balance with zero markup.

Works in any agent

Claude, ChatGPT, Cursor, and other MCP clients, or your own code with the Composio SDK.

Works with your apps

Use Gemini with Gmail, Slack, Google Sheets, and 1,700+ other apps you connect.

AI ASSISTANTS

Connect the Gemini API to your AI assistant

Use Gemini from the AI assistant you already work in. Connect Composio once, then paste the prompt.

  1. 1

    Open the Connectors menu

    Use the button to open Claude's Add connector dialog with Composio filled in. Or click + in the message box, then Connectors, Add connector and Add custom connector.
    Add Composio to Claude
  2. 2

    Add the Composio MCP server

    Name it Composio, paste the MCP server URL and click Add.
    https://connect.composio.dev/mcp
  3. 3

    Authorize in your browser

    A browser window opens. Sign in to Composio to approve the connection.
  4. 4

    Paste the prompt

    Start a new chat and paste the prompt. Claude runs the call on Composio Instant.
  1. 1

    Install the Composio plugin

    Open Composio's plugin page in ChatGPT and click Install. Sign in to ChatGPT first if it asks.
    Install in ChatGPT
  2. 2

    Authorize in your browser

    Connect the plugin, then sign in to Composio to approve the connection.
  3. 3

    Turn on Composio in your chat

    In a new chat, click +, then More, and select Composio.
  4. 4

    Paste the prompt

    Paste the prompt into that chat. ChatGPT runs the call on Composio Instant.
  1. 1

    Install the Composio plugin

    Open Composio in the Cursor marketplace, click Install Composio Plugin for Cursor and approve the connection in your browser.
    Install in Cursor
  2. 2

    Paste the prompt

    Open the Agent chat and paste the prompt. Cursor runs the call on Composio Instant.
  1. 1

    Add the Composio plugin

    Open Composio's listing on x.ai and click Add to Grok Bot. When Grok Bot opens the plugin, click Add.
    Add to Grok Bot
  2. 2

    Authenticate

    Go to Installed, open Composio and click Authenticate. Sign in to Composio and click Authorize.
  3. 3

    Paste the prompt

    Paste the prompt into your bot's chat. Grok Bot runs the call on Composio Instant.
  1. 1

    Paste the setup prompt

    Copy this into your Hermes chat. Hermes adds the Composio MCP server for you.
    Set up Composio from composio.dev/hermes
  2. 2

    Authorize in your browser

    A browser window opens. Sign in to Composio to approve the connection.
  3. 3

    Paste the prompt

    Start a new chat and paste the prompt. Hermes runs the call on Composio Instant.
ClaudeNew chat

Paste this prompt

Use Gemini through Composio Instant to create a clean, colorful illustration of a small greenhouse filled with leafy plants at sunrise, with warm light coming through the glass. Return the generated image.

What success looks like

GEMINI_GENERATE_IMAGE

Your assistant runs Gemini and replies with a generated illustration of a sunlit greenhouse filled with leafy plants.

Runs on Composio Instant
SDK

Use the Gemini API in your code

Call Gemini from your own agent with the Composio SDK. Four steps and one tool call.

  1. 1

    Set up Composio

    Turn on Instant Toolkits in your project settings and check your prepaid balance in Billing. Then set your API key.
    export COMPOSIO_API_KEY="your_composio_api_key"
  2. 2

    Install the SDK

    The Python SDK needs Python 3.11 through 3.15.
    pip install composio
  3. 3

    Run the call

    Create a session that keeps Instant to this toolkit and reports the charge, then run the tool on the Instant account.
    GEMINI_GENERATE_IMAGE
  4. 4

    Read the response

    When the call runs on Instant, the response includes its charge: the amount as an exact USD decimal string, the currency and charged_by.
agent.py
from composio import Composio

composio = Composio()

session = composio.sessions.create(
    user_id="user_123",
    toolkits=["gemini"],
    instant={
        "toolkits": {"enable": ["gemini"]},
        "return_instant_charge": True,
    },
)

result = session.execute(
    "GEMINI_GENERATE_IMAGE",
    arguments={
        "prompt": "Create a clean, colorful illustration of a small greenhouse filled with leafy plants at sunrise, with warm light coming through the glass.",
        "aspect_ratio": "16:9",
    },
    account="instant_account",
)
print(result)
print("Instant charge:", result.instant_charge)
TOOLS

Available Gemini API tools

4 Gemini tools run on Instant, priced per call with no Gemini key. Tools marked Your key need your own Gemini account.

ActionTool slugWhat it doesAvailability
Generate ImageGEMINI_GENERATE_IMAGECreate a downloadable image from a text prompt.
Instant$0.033 per 1K image, plus $0.25/1M input and $1.5/1M output tokens.
Generate VideoGEMINI_GENERATE_VIDEOSSubmit a Veo video generation request and get an operation handle.
Instant$0.023, $0.07, $0.104 or $0.209 per second of 360p, 720p, 1080p or 4K video (3-15 seconds).
Download VideoGEMINI_WAIT_FOR_VIDEOCheck a Veo operation and download its MP4 when ready.
Instant$0 per request
Get Video Generation StatusGEMINI_GET_VIDEOS_OPERATIONChecks a Gemini Omni Flash video generation started by GEMINI_GENERATE_VIDEOS once, without waiting.
Instant$0 per request
Generate ContentGEMINI_GENERATE_CONTENTGenerate text or speech audio from a prompt with a Gemini model.Your key
Embed ContentGEMINI_EMBED_CONTENTCreate text embeddings with a Gemini embedding model.Your key

Instant prices are Gemini's list prices with 0% markup, paid from your Composio balance and updated every hour. Instant calls also count toward your plan's tool calls. See all plans on the pricing page.

USE CASES

Gemini API use cases and example prompts

Copy a prompt into your agent. Each one uses Gemini with apps you connect through Composio.

  • Create launch campaign visuals

    Use Gemini to generate a launch image for our new Acme analytics dashboard, with a clean product-focused design. Save the downloadable image in my Product Launch folder in Google Drive. Post the file link in Slack's #launch channel.

    Apps used: Gemini, Google Drive, Slack

  • Make a product overview video

    Use Gemini to create a short video introducing Acme's new reporting feature. Check the video request and download the MP4 when it is ready, then save it in my Product Launch folder in Google Drive. Post the file link in Slack's #launch channel.

    Apps used: Gemini, Google Drive, Slack

  • Turn release notes into an FAQ

    Use Gemini to turn the release notes in my Acme Launch Notes Google Doc into a customer FAQ. Save the FAQ as a page in my Product Help space in Notion.

    Apps used: Gemini, Google Docs, Notion

  • Draft outreach from account records

    Use Gemini to summarize the Acme company record in HubSpot into a brief outreach note using only details in the record. Create a Gmail draft for the Acme account with a subject line and body based on that note.

    Apps used: Gemini, HubSpot, Gmail

TROUBLESHOOTING

Gemini API troubleshooting

Still stuck? The Instant tools docs cover limits, charges and session settings.

Start with Gemini.It takes 30 seconds.

Managed auth, hosted MCP servers, and every Gemini tool your agent needs.Free to start.

Start building