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

# Google Gemini

> Connect Google Gemini to your Atako agents — 3 read and 3 write actions.

Let your agents use the Google Gemini API — content generation, embeddings, token counting and the model catalogue.

## Connection

* **Authentication**: API key.

<Note>
  Go to aistudio.google.com → sign in → "Get API key" → "Create API key". Select a project (or create one), name the key, and copy it immediately. The key grants access to content generation, embeddings and model listing — no additional scopes required.

  See [Google Gemini's documentation](https://aistudio.google.com/apikey).
</Note>

## Read actions (3)

| Action         | Description                                                                                                                                                                     |
| -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `count_tokens` | Count the number of tokens in a text prompt using the model's tokenizer. Arguments: model (string, e.g. "gemini-2.5-flash"); prompt (string). Returns: total\_tokens (integer). |
| `get_model`    | Retrieve metadata for a single model (token limits, supported methods, description). Arguments: model (string, e.g. "gemini-2.5-flash").                                        |
| `list_models`  | List the models available to the API key. Arguments: page\_size (integer, max 1000, default 50); page\_token (string, for pagination).                                          |

## Write actions (3)

| Action                 | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| ---------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `batch_embed_contents` | Compute embedding vectors for up to 100 texts in a single request. Arguments: model (string, e.g. "gemini-embedding-001"); texts (array of strings, max 100). Returns: embeddings (array of objects each with values: array of floats).                                                                                                                                                                                                                                                                                                                                                                                                                         |
| `embed_content`        | Compute an embedding vector for a single text. Arguments: model (string, e.g. "gemini-embedding-001"); text (string); task\_type (optional string — RETRIEVAL\_QUERY, RETRIEVAL\_DOCUMENT, SEMANTIC\_SIMILARITY, CLASSIFICATION, CLUSTERING, QUESTION\_ANSWERING, FACT\_VERIFICATION); output\_dimensionality (optional integer, reduced embedding dimension). Returns: embedding.values (array of floats).                                                                                                                                                                                                                                                     |
| `generate_content`     | Generate a model reply for a text prompt (non-streaming). Arguments: model (string, e.g. "gemini-2.5-flash"); prompt (string, the user message); system\_instruction (optional string, developer instructions); history (optional array of objects \{role: "user"\|"model", text: string} for multi-turn conversations); temperature (number 0–2); max\_output\_tokens (integer ≥ 1); response\_mime\_type ("text/plain" or "application/json"); response\_schema (optional object, JSON Schema for structured output). Returns: candidates\[0].content.parts\[0].text and usageMetadata (prompt\_token\_count, candidates\_token\_count, total\_token\_count). |

## Permissions

Every action above must be explicitly granted to an agent before it can be used. See [Permissions](/integrations/permissions) for the grant model and [Security](/integrations/security) for how credentials are protected.
