Get an API key from Google (Gemini)

Make the key in Google AI Studio, put billing and a monthly cap on its project, then paste it into Runner. Every step at Google comes from Google's own documentation.

Updated

The short version

  • Make the key on the API Keys page of Google AI Studio. Every key belongs to a Google Cloud project.
  • Set up billing on that project, then set a monthly spend cap on the Spend page.
  • In Runner, an owner or admin pastes it under Settings, then LLM providers, presses Test, then Connect.
  • Rather skip all of it? With AI included there is nothing to set up, and you can change your choice later.

Create the key in Google AI Studio

Gemini API keys are made in Google AI Studio, and every key belongs to a Google Cloud project, which is what Google bills. If you're new to Google Cloud, AI Studio makes a default project for you. If you already have a Google Cloud account it doesn't, and you bring a project in from Dashboard, then Projects, with Import projects.

  1. Open API Keys

    In Google AI Studio, open the API Keys page, at aistudio.google.com/api-keys.

  2. Press Create API key

    AI Studio generates a new key on the project.

  3. Copy it somewhere safe

    Treat it like a password, and keep it where only you can reach it: Google suggests a secure secret store, such as Google Cloud Secret Manager.

Set up billing on the key's project

Setting up billing moves the project from Google's Free Tier to its Paid Tier, which Google describes as the way to ensure your prompts and responses are not used to improve Google products.

  1. Press Set up billing

    On the Projects page, find the key's project and press Set up billing under Billing Tier. The API Keys page has the same button.

  2. Add a billing account

    Choose your country and agree to the Terms of Service, then fill in your contact details and payment method, or pick a billing account you already have.

  3. Prepay, or choose Postpay

    Google asks you to prepay at least $5, or offers Postpay. Either one finishes the setup.

When a prepaid balance runs out

At $0, Google refuses requests until you add credits.

Set a monthly spend cap at Google

Google sets spend caps per project, and anyone with the project's editor, owner or admin role can set one.

  1. Open Spend

    In Google AI Studio, open the Spend page.

  2. Edit the cap

    Under Monthly spend cap, press Edit spend cap and set the most the project may spend in a month.

How exact the cap is

Google calls project caps experimental, and says spend can run past one when billing data hasn't caught up with new charges, or during long-running work. Your billing account's tier has a cap of its own, and reaching it pauses every project on the account until the 1st of the next month.

Paste the key into Runner, under Settings, then LLM providers

The key belongs to your Runner organization, so every product in it can use the key, and only an owner or admin can connect one. Runner encrypts it before storing it and never shows it again.

A key you connect is used before credits, even on AI included.

  1. Open LLM providers

    In Runner, open Settings, then LLM providers, under What the AI uses.

  2. Find the Google card

    If it's folded under More providers, open it. Paste the key into Google API key.

  3. Press Test, then Connect

    Test asks Google whether it accepts the key, without using any credit. When it says Google accepted it, press Connect.

On Runner's LLM providers page, paste the key into the Google API key box, press Test, then Connect.

Keep the key secret, and keep it to Gemini

Google's first rule is to treat your Gemini API key like a password. Restricting it to the Gemini API also limits the damage if it ever leaks.

  1. Find the key's label

    On API Keys in AI Studio, hover over the Unrestricted label beside the key.

  2. Restrict it

    Click Add restrictions, select Restrict to Gemini API only, then click Restrict key.

  • Never check it into source control, such as Git.
  • Never put it in a website or an app that people download.
  • Set up billing alerts in the Google Cloud console, so a spike in use or cost reaches you.
  • Paste it only into Runner's key box, never into a chat, an email or a support ticket.

Swap the key for a new one, or switch it off

Google's order for replacing a key is to make the new one, move to it, and only then disable or delete the old one, so nothing stops in between.

  1. Make the new key

    Create a replacement key in Google AI Studio, as above.

  2. Swap it in Runner

    On the Google card in LLM providers, press Disconnect, then Confirm disconnect, and paste the new key, Test it and Connect. Disconnecting stops your team using the old key at once.

  3. Disable or delete the old key

    Once the new key works, disable the old one in the Google Cloud console, or delete it.

If the old key leaked

Check billing and API usage in the Google Cloud console for anything you didn't do.

Rather not make a key at all?

With AI included, your team runs on the AI credits your plan includes, with nothing to set up: no API keys, no vendor accounts, no billing with an AI company.

Every plan comes two ways, AI included or your own key, and you can change your choice later in Settings.

AI included or your own key: help me choose

Give your business a growth team.

Create your account and pick a plan. Your team is built once the plan is paid.

  • AI models and keys

    Get an API key from Anthropic (Claude)

    Claude API key from Anthropic, step by step: make a Claude Console account, buy credits, create the key, set a spend limit, and connect it to Runner.

    Updated

  • AI models and keys

    Get an API key from OpenAI

    OpenAI API key, step by step: sign in to the OpenAI Platform, add credits, create the key, set a hard spend limit, and connect it to Runner.

    Updated

  • AI models and keys

    Get an API key from xAI (Grok)

    Grok API key from xAI, step by step: buy credits in the xAI console, create the key, keep spending inside what you bought, and connect it to Runner.

    Updated

Trademarks of their owners. No affiliation or endorsement.