# Gemini

## Connection <a href="#connect" id="connect"></a>

When you're setting up your first workflow with Gemini, you'll need to create an API Key.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2FU4CNfStNK6BB2BSj7qWs%2Fimage.png?alt=media&#x26;token=f447356e-c31b-4221-bcb6-8e521120b487" alt=""><figcaption></figcaption></figure>

To create an API Key, go to this URL: <https://aistudio.google.com/apikey>. Once there, click on the Create API key button or select an existing key.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2FTVsB36WjnoApXIe1vgCN%2Fimage.png?alt=media&#x26;token=ca12645a-23ea-4c95-9588-814dce4ad471" alt=""><figcaption></figcaption></figure>

Click the Create API key in new project button and copy the generated API key.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2F3NGiqkPBigHxWipcyV3W%2Fimage.png?alt=media&#x26;token=26e479dd-a7c1-4915-b7cd-adc3c987a67c" alt=""><figcaption></figcaption></figure>

Paste the copied value into MESA's Gemini API Key field.

Lastly, click the Add connection button and you're all set! MESA is now connected with Gemini.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2FVpAHloo3CmyOmoBlDLgW%2Fimage.png?alt=media&#x26;token=c13e56a8-2476-4a08-8cf0-8d701d732630" alt=""><figcaption></figcaption></figure>

## Configure <a href="#configuring" id="configuring"></a>

#### Following Gemini's Usage Policies <a href="#policy" id="policy"></a>

Please ensure that you follow Gemini's Usage Policies when using MESA's Gemini integration: <https://gemini.google/policy-guidelines/>

#### ShopPad's Recommendation <a href="#recommendation" id="recommendation"></a>

We recommend using Gemini's [playground](https://aistudio.google.com/u/2/prompts/new_chat) when testing with MESA's Create Chat Completion action. This allows you to try different models and prompts and will estimate the token cost for each automation.

<figure><img src="https://3425906282-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F1H6u1HQc3Iew7ATmmiCi%2Fuploads%2Fz2B07s4O02jqZdwH41Wd%2Fimage.png?alt=media&#x26;token=1a1f6948-df50-494f-a138-981f1eb12f9c" alt=""><figcaption></figcaption></figure>

As Gemini is not our product, we would like to note that we are not responsible for its output. We recommend visiting the Gemini website and attempting to replicate your preferred prompt using the Gemini UI to verify that it meets your expectations before trying to automate it with MESA.

### How Gemini Uses Your Data <a href="#data-security" id="data-security"></a>

The Gemini app makes API calls to Gemini. Only the variables explicitly configured in the MESA builder will be shared with Gemini. MESA does not store any of this information beyond your data retention date.

To opt out of any data sharing with AI models, simply do not use the Gemini step in any of your workflows.

[Learn more](https://support.google.com/gemini/answer/13594961?hl=en#what_data) about how and when Gemini uses data to train their models. Read [MESA's Data Processing Agreement](https://www.getmesa.com/dpa).

## Technical Notes

* Each model has its different capabilities and price points. You can review [Gemini's pricing here](https://ai.google.dev/gemini-api/docs/pricing). If you do not wish to incur additional Gemini costs, you can use the [AI tool](https://docs.getmesa.com/tools/ai) as an alternative. Please note that the AI tool is a [premium app which is double the fun and double the automation](https://docs.getmesa.com/going-further/plans-and-billing#premium-steps).
* When using Gemini, please note that you will incur additional costs from Gemini, which depends on how often MESA interacts with Gemini in a single automation run.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.getmesa.com/connect/gemini.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
