> ## Documentation Index
> Fetch the complete documentation index at: https://veryfront.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Gemini

> Generate text, images, embeddings, and token counts and manage uploaded files with Google Gemini models via the Gemini API

## At a glance

* **Availability**: Experimental ([how to enable](/cloud/integrations)).
* **Auth**: API key.
* **Connection**: The key from `GEMINI_API_KEY` is sent as the `x-goog-api-key` header.
* **Docs**: [https://ai.google.dev/gemini-api/docs/api-key](https://ai.google.dev/gemini-api/docs/api-key)

## Credentials

Set these per environment. See [Connect an integration](/cloud/integrations).

| Variable         | Required | Description                                                                                                    |
| ---------------- | -------- | -------------------------------------------------------------------------------------------------------------- |
| `GEMINI_API_KEY` | Yes      | Gemini API key from Google AI Studio (starts with AIza) [Docs](https://ai.google.dev/gemini-api/docs/api-key). |

## Setup

1. **Sign in to Google AI Studio**: Go to [https://aistudio.google.com](https://aistudio.google.com) and sign in with a Google account. The free tier works for testing without billing.
2. **Create an API key**: Open [https://aistudio.google.com/app/apikey](https://aistudio.google.com/app/apikey) and click 'Create API key'. Choose an existing Google Cloud project or let AI Studio create one for you.
3. **Store the key**: Copy the key and add it to your .env file as GEMINI\_API\_KEY=AIza...
4. **Verify access**: Run the List Models tool to confirm the key works. A 400 with API\_KEY\_INVALID means the key is wrong or restricted.

* This connector uses the Gemini Developer API key (x-goog-api-key header), not Google OAuth - do not use Google Cloud OAuth credentials here
* Free-tier keys are rate limited; attach a billing-enabled Google Cloud project for higher limits
* Generation and embedding calls are billed per token on paid tiers

Provider API reference: [https://ai.google.dev/api](https://ai.google.dev/api)

## Tools

| Tool                    | Access | Description                                                                                                                                                                                                                                                                               |
| ----------------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| List Models             | Read   | List the Gemini models available to the API key                                                                                                                                                                                                                                           |
| Get Model               | Read   | Get details about a specific Gemini model                                                                                                                                                                                                                                                 |
| Generate Content        | Write  | Generate a model response from text or multimodal content                                                                                                                                                                                                                                 |
| Embed Content           | Write  | Create an embedding vector for input text                                                                                                                                                                                                                                                 |
| Count Tokens            | Read   | Count the tokens a prompt would use for a given model                                                                                                                                                                                                                                     |
| Generate Image          | Write  | Generate or edit an image with a Nano Banana model via generateContent; the response returns image parts as base64 inlineData                                                                                                                                                             |
| Edit Image              | Write  | Edit an existing image with a Nano Banana model: send the source image as a base64 inlineData part plus a text instruction (add/remove/modify elements, change style, adjust color grading); the edited image is returned as base64 inlineData                                            |
| Generate Image (Imagen) | Write  | Generate text-to-image samples with an Imagen 4 model via the predict endpoint; returns base64-encoded images in predictions                                                                                                                                                              |
| Upload File             | Write  | Upload content to the Files API for use in later generateContent calls via its file URI; this simple media upload sends the decoded bytes directly as the request body (a custom displayName requires the multipart or resumable X-Goog-Upload protocol), and files expire after 48 hours |
| List Files              | Read   | List files uploaded to the Files API for this project                                                                                                                                                                                                                                     |
| Get File                | Read   | Get metadata for an uploaded file, including its uri and processing state                                                                                                                                                                                                                 |
| Delete File             | Write  | Delete an uploaded file before its automatic 48-hour expiry                                                                                                                                                                                                                               |

## Example prompts

* List the Gemini models available to my API key and summarize their token limits.
* Use Gemini to generate a response to a prompt I provide.
* Generate an image with a Nano Banana model from a description I provide.
