Get a Gemini API Key

Create a Gemini API key, fund the prepaid billing Google now requires, and wire it into m18t encrypted in the Vault. One key serves the whole workspace.

What you'll learn

  • How to create a Google Gemini API key in Google AI Studio.
  • Why a key on its own is not enough, and what else Google needs before it will answer.
  • How to wire it into m18t, encrypted in the Vault.
  • How to confirm it really works, and how to read the failures when it doesn't.

Why Gemini

m18t uses Google's Gemini models for fast, low-cost text work. The News Manager pipeline and the brand-aware prompt step of the Graphics Generator lean on them, and Gemini carries a "Recommended" badge in m18t's provider picker for that reason. Like every AI provider here, it's BYOK: you bring the key and pay Google directly. m18t never resells or marks up tokens.

Step 1: Create the key in Google AI Studio

Google's interface shifts over time, so follow the intent rather than the exact labels:

  1. Sign in to Google AI Studio with your Google account.
  2. Find the Get API key area and create a new key. You will need to associate it with a Google Cloud project.
  3. Copy the key. Google may show the raw value only once, so secure it in m18t before closing the window.

Step 2: Set up billing, which is the step people miss

A brand new Gemini key cannot generate anything until the billing account behind it has been funded. This catches almost everyone, so do it now rather than after the first failure.

  • Google's free tier is effectively closed. On a project with no billing account, models return a quota error with a limit of zero rather than a small free allowance. Assume you need to pay.
  • The Gemini API is prepaid. You buy credits up front and usage draws them down. Having a Google Cloud billing account attached is not the same thing, and a project can show as billing enabled and paid tier while still being unable to serve a single request.
  • Set it up in AI Studio under Billing, then Set up prepay. There is a minimum top up. Turning on auto reload is worth it, because when the balance reaches zero every key on that billing account stops at the same moment.
  • Billing is per billing account, not per project or per key. Funding it once covers every key and project attached to it, and running dry breaks all of them together.

Step 3: Add it to m18t

You add the key through the connection wizard, which stores it in the encrypted Vault.

  1. Go to Business Settings → Connections (/studio/business/connections).
  2. Click Add Connection.
  3. Pick a brand. The connection record is filed under a brand, which is how it appears in that brand's connection list and health checks.
  4. Pick a provider. Under AI Providers, choose Google Gemini.
  5. On the setup step, confirm the Label and leave the Base URL at its default.
  6. On the Authentication step, choose + Add new vault key. The wizard suggests GOOGLE_AI_KEY. Paste your value. It's encrypted before storage and saved as vault:GOOGLE_AI_KEY.
  7. Finish with Create connection.

One key serves the whole workspace. Unlike a Facebook Page or a CMS, which really are wired per brand, m18t's AI features read a single workspace-level GOOGLE_AI_KEY from the Vault. Whichever brand you file the connection under, every brand uses that same key. You do not need to repeat this for your other brands.

Careful with Purpose. If you set a connection's Purpose to a single kind of task, features needing a different kind stop seeing it. Setting your only Gemini connection to text, for example, leaves the AI Canvas greyed out because it looks for an image-capable key. Leave Purpose unset unless you are deliberately splitting work across providers.

Step 4: Confirm it works

On the Connections tab, find the Google Gemini card and run its test action.

Read this result carefully. The test asks Google to list the models your key can see. That is deliberately free, so it costs you nothing to run, but it means a pass proves your key is real and correctly scoped, and not that you can actually generate. A key with an unfunded billing account still passes this test. If the test passes but every AI feature fails, your key is fine and Step 2 is what's missing.

The honest end-to-end check is to use a real AI feature once, for example evaluating a single news item, and see it return something.

What it costs

You pay Google directly, at Google's prices. Text work with the Flash models is inexpensive, usually a fraction of a cent per call. Images cost meaningfully more, and the higher quality image model runs several times the price of the fast one.

Treat any figure you read here or elsewhere as indicative rather than a quote. Providers change pricing, retire models, and bill larger images at higher rates. Google's own pricing page and the usage dashboard in AI Studio are the only authority, and it is worth glancing at the dashboard after your first real session so the numbers stop being abstract.

Variations

  • Key already in the Vault? On the Authentication step, pick the existing GOOGLE_AI_KEY instead of adding a new one.
  • Running Gemini alongside another provider? Wire OpenAI or Anthropic as separate connections. Each provider has its own Vault key.
  • Several brands? Nothing extra to do. The AI key is workspace-wide, so one setup covers all of them.

FAQ

The test passes, but the AI features still fail. Almost always billing. A key with no prepaid balance lists models happily and refuses to generate, so the test goes green while real calls come back saying your prepayment credits are depleted. Go back to Step 2 and fund the billing account. Do not rotate the key, because there is nothing wrong with it.

The test itself fails. Read the message. Wording about an invalid or unauthorized key points at the key, so re-copy it, check it's enabled for the Generative Language API in your Google project, then rotate it on the Vault tab. Wording about quota, credits or billing points at Step 2 instead, and no amount of regenerating will help.

The AI buttons are still greyed out. The AI gate is workspace-wide, so filing another connection under a different brand will not change it. Check that a Gemini connection exists and is showing as healthy, and that its Purpose isn't restricting it to a kind of task the feature doesn't want. See the Purpose note in Step 3.

Gemini vs OpenAI vs Anthropic, which do I need? You need at least one text provider for AI features to light up. Gemini is recommended for speed and cost, and OpenAI and Anthropic are equally supported. Wire whichever you already have.

Can I see the raw key later? No. The Vault shows only the reference name. The value is encrypted and never displayed again.

What's next

Was this article helpful?