---
title: Google Gemini
slug: connectors/google-gemini
docTags: 
createdAt: 2026-06-09T16:29:49.348Z
---

Google Gemini is an AI platform that provides intelligent, context-aware responses to user queries.

Google Gemini is a powerful AI-driven platform designed for advanced text generation and natural language processing. The Google Gemini Connector allows Swimlane Turbine users to seamlessly integrate AI-generated responses into their security workflows. By leveraging this integration, users can enhance their playbooks with dynamic, AI-driven insights, improving decision-making and response times in security operations. This connector empowers users to automate complex text generation tasks, providing a significant boost to the efficiency and effectiveness of security processes.

## Prerequisites

Before you can use the Google Gemini connector for Turbine, you'll need access to the Google Gemini API. This requires the following:

- an API key authentication using the following parameters:
  - API Key: A unique key provided by Google to authenticate requests.
  - Model: The specific AI model to be used for generating responses.

## Getting an API Key

1. Go to [Google AI Studio](https://aistudio.google.com/)
2. Navigate to the **API Keys** page from the Dashboard
3. Click **Create API Key** and select your project
4. Copy the generated API key for use in the connector

## Capabilities

This Connector provides the following capabilities:

- **Text Generation**: Generate human-like text responses to prompts
- **Question Answering**: Ask questions and receive comprehensive answers
- **Content Analysis**: Analyze and summarize text content
- **Creative Writing**: Generate creative content, stories, and explanations
- **Code Generation**: Generate and explain code snippets
- **Multi-model Support**: Access to multiple Gemini model variants with different capabilities

### Limitations

- **Rate Limits**: Subject to Google's API rate limits and quotas
- **Model Availability**: Some models may have regional availability restrictions
- **Parameter Support**: Not all models support all generation parameters (e.g., top\_k)
- **Token Limits**: Responses are limited by the max\_tokens parameter (default: 1024, max: 8192)
- **Content Safety**: All responses are subject to Google's safety filters

## Asset Setup

### Required Configuration

1. **Base URL**: `https://generativelanguage.googleapis.com` (default)
2. **API Key**: Your Google Gemini API key from Google AI Studio
3. **Model**: Select from supported Gemini models:
   - `gemini-2.5-pro` - Most capable model for complex tasks
   - `gemini-2.5-flash` - Fast and efficient for most use cases
   - `gemini-2.5-flash-lite` - Lightweight version with reduced capabilities
   - `gemini-2.0-flash` - Previous generation fast model
   - `gemini-2.0-flash-lite` - Previous generation lightweight model

### Optional Configuration

- **Max Tokens**: Maximum response length (1-8192, default: 1024)
- **Temperature**: Response creativity (0.0-1.0, default: 0.7)
- **Top P**: Nucleus sampling (0.0-1.0, default: 0.95)
- **Top K**: Top-k sampling (1-100, default: 64, not supported by all models)
- **Thinking Budget**: Thinking budget for Gemini 2.5 models (0-1000, default: 0, 0 disables thinking)

### Model Parameter Support

| Model                 | Max Tokens | Temperature | Top P | Top K | Thinking |
| --------------------- | ---------- | ----------- | ----- | ----- | -------- |
| Gemini 2.5 Pro        | ✅          | ✅           | ✅     | ✅     | ✅        |
| Gemini 2.5 Flash      | ✅          | ✅           | ✅     | ✅     | ✅        |
| Gemini 2.5 Flash-Lite | ✅          | ✅           | ✅     | ❌     | ✅        |
| Gemini 2.0 Flash      | ✅          | ✅           | ✅     | ✅     | ❌        |
| Gemini 2.0 Flash-Lite | ✅          | ✅           | ✅     | ❌     | ❌        |

## Tasks Setup

### Ask Gemini Action

The connector provides a single action called "Ask Gemini" that accepts:

**Input:**

- `prompt` (string, required): The question or prompt to send to Gemini

**Output:**

- `response` (string): The AI-generated response
- `model_used` (string): The model that generated the response
- `tokens_used` (integer): Number of tokens consumed
- `finish_reason` (string): Reason for generation completion
- `safety_ratings` (array): Content safety assessments

### Example Usage

```yaml
## Example playbook action

action: ask_gemini
parameters:
  prompt: "Explain the concept of machine learning in simple terms"
```

## Notes

- **API Key Security**: Keep your API key secure and never expose it in client-side code
- **Cost Management**: Monitor your usage through Google AI Studio to manage costs
- **Error Handling**: The connector includes comprehensive error handling for common API issues
- **Model Selection**: Choose the appropriate model based on your needs - Pro for complex tasks, Flash for speed
- **Parameter Tuning**: Experiment with temperature and other parameters to achieve desired response characteristics

### Reference URLs

- [Google Gemini API Documentation](https://ai.google.dev/gemini-api/docs/text-generation)
- [Generation Configuration Reference](https://ai.google.dev/api/generate-content#v1beta.GenerationConfig)
- [API Key Management](https://ai.google.dev/gemini-api/docs/api-key)
- [Google AI Studio](https://aistudio.google.com/)

## Additional Documentation

- [Google Gemini Connector Documentation](https://docs.swimlane.com/connectors/google-gemini)
- [Google Gemini API Documentation](https://ai.google.dev/api/rest)

# Configurations

## Google Gemini AI Configuration

Configuration for Google Gemini AI API with model selection and generation parameters

### Configuration Parameters

| **Parameter** | **Description**                                                             | **Type** | **Required** |
| ------------- | --------------------------------------------------------------------------- | -------- | ------------ |
| apiKey        | API key for Google Gemini authentication                                    | string   | Required     |
| model         | Gemini model to use for text generation                                     | string   | Required     |
| max\_tokens   | Maximum number of tokens in the response (default- 1024)                    | integer  | Optional     |
| temperature   | Controls randomness in responses (0.0-2.0) (default- 0.7)                   | number   | Optional     |
| top\_p        | Nucleus sampling parameter (0.0-1.0) (default- 0.95)                        | number   | Optional     |
| top\_k        | Top-k sampling parameter (default- 64) - Not supported by Flash-Lite models | number   | Optional     |

# Actions

## Ask Gemini

Send a prompt to Google Gemini and receive an AI-generated response. This action requires a specific prompt parameter.

### Endpoint

- **Method:** `GET`

### Input

| **Argument Name** | **Type** | **Required** | **Description**                          |
| ----------------- | -------- | ------------ | ---------------------------------------- |
| `prompt`          | string   | Required     | The prompt or question to send to Gemini |

### Input Example

`{"prompt":"string"}`

### Output

| **Parameter**   | **Type** | **Description**                                  |
| --------------- | -------- | ------------------------------------------------ |
| `response`      | string   | The AI-generated response from Gemini            |
| `model_used`    | string   | The model that was used to generate the response |
| `tokens_used`   | integer  | Number of tokens used in the response            |
| `finish_reason` | string   | Reason why the generation finished               |

### Output Example

`{"response":"string","model_used":"string","tokens_used":123,"finish_reason":"string"}`

# Response Headers

| **Header**   | **Description**                                       | **Example**                   |
| ------------ | ----------------------------------------------------- | ----------------------------- |
| Content-Type | The media type of the resource                        | application/json              |
| Date         | The date and time at which the message was originated | Thu, 01 Jan 2024 00:00:00 GMT |
