---
title: "How to get a Google Gemini API key - Workflow Trigger Extensions"
description: "Create a Gemini API key in Google AI Studio and connect it to Workflow Trigger Extensions to write trigger code with Gemini."
canonical: "https://docs.workflow-trigger-extensions.app/get-gemini-api-key"
---

# How to get a Google Gemini API key

To use **Generate with AI** with Gemini, connect your own Gemini API key. Here's how to create one - it takes a minute.

## Create the key

1. Sign in to **Google AI Studio** with your Google account and open **Get API key** - direct link: <a href="https://aistudio.google.com/app/apikey" target="_blank" rel="noopener">aistudio.google.com/app/apikey</a>.
2. Select **Create API key**, choose or create a Google Cloud project, and **copy the key**. It usually starts with `AIza`.
3. For more than a few test generations, turn on billing for that project: <a href="https://ai.google.dev/gemini-api/docs/billing" target="_blank" rel="noopener">ai.google.dev/gemini-api/docs/billing</a>. Generation calls are billed to your Google account.

Google's own guide to Gemini API keys: <a href="https://ai.google.dev/gemini-api/docs/api-key" target="_blank" rel="noopener">ai.google.dev/gemini-api/docs/api-key</a>.

## Connect it

1. In your Shopify admin, open **Workflow Trigger Extensions -> Developer -> Connections**.
2. Paste the key into the **Google Gemini** card and select **Save key**.

Your key is encrypted at rest and used only for generation. It is never shown again, and it never runs inside your trigger code. Then open a custom trigger, use **Generate with AI** on the Code tab and pick Gemini and a model there. A key that Google rejects shows up as an error on your first generation.

> [!NOTE]
> **Billing and models**
> Generation is billed to your own Google account, not to your Workflow Trigger Extensions plan. See [Generate trigger code with AI](https://docs.workflow-trigger-extensions.app/generate-with-ai.md) for the available models and per-generation cost estimates.
