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

# Gemini

> Invoke responses from Gemini

## Overview

Interact with Gemini with prompts or by sending images. The Gemini tool also allows you to send prompts and receive structured responses.

## Key Features

* `GEMINI_INVOKE`
  * Send prompts to Gemini AI
* `GEMINI_INVOKE_WITH_IMAGE`
  * Send images to Gemini AI for analysis
* `GEMINI_GENERATE_IMAGE`
  * Generate images from text descriptions using Gemini image generation models (Nano Banana)

## Authentication

For further details, [click here](/en/pages/credentials/gemini).

If you do not have an API key, you can still run Gemini tools by using Jinba API credit. If you'd like to use your own API key, you can obtain one from the [official Gemini website](https://ai.google.dev/gemini-api/docs/api-key).

**Note**: Treat API keys as sensitive information and never commit them to public repositories.

### Example: Image Analysis and Spreadsheet Export

```yaml theme={null}
- id: analyze_image
  name: analyze_image
  tool: GEMINI_INVOKE_WITH_IMAGE
  config:
    - name: version
      value: gemini-flash-latest
    - name: token
      value: "{{secrets.GEMINI_API_KEY}}"
  input:
    - name: prompt
      value: Please analyze this image in detail. If there is any text, extract it as well. Please provide as much detail as possible.
    - name: base64_image
      value: YOUR_IMAGE_URL_OR_BASE64
- id: structure_information
  name: structure_information
  tool: OPENAI_INVOKE
  config:
    - name: version
      value: gpt-4
  input:
    - name: prompt
      value: |
        Please organize the following image analysis results into a structured format.

        ==Image Analysis Results==
        {{steps.analyze_image.result.content}}

        ==Instructions==
        1. Extract and organize important information by category
        2. Format the output suitable for spreadsheets
        3. Output in the following JSON array format:
        [
          ["Category", "Item", "Content"],
          ["Text", "Detected Text 1", "..."],
          ["Object", "Detected Object 1", "..."],
          ...
        ]
```

### Example: Image Generation

`GEMINI_GENERATE_IMAGE` generates an image from a text description and returns a downloadable image URL (`result.image_url`, valid for 24 hours). Two models are available: `gemini-2.5-flash-image` (Nano Banana, fast and efficient, the default) and `gemini-3-pro-image-preview` (Nano Banana Pro, high-fidelity professional output). The `aspect_ratio` input accepts `1:1` (Square, the default), `3:4` (Portrait), `4:3` (Standard), `9:16` (Mobile Portrait), or `16:9` (Landscape).

```yaml theme={null}
- id: generate_image
  name: generate_image
  tool: GEMINI_GENERATE_IMAGE
  config:
    - name: model
      value: gemini-2.5-flash-image
  input:
    - name: prompt
      value: A watercolor illustration of Mount Fuji at sunrise, with cherry blossoms in the foreground
    - name: aspect_ratio
      value: "16:9"
```
