Get a Gemini API key

Use your own key to enable optional AI correction/rewriting in AI Keyboard.

Keep your API key private. Don’t share it publicly or commit it to Git.

Steps

Prerequisite: a Google account.

  1. Open https://ai.google.dev/gemini-api and click Sign in.
  2. Click Get API Key in Google AI Studio.
  3. Click Get API Key.
  4. Check the consent box (I consent to…) and click Continue.
  5. On the API keys page, click Create API Key.
  6. If a popup appears, click Got it.
  7. Click Create API key in new project.
  8. Click Copy to copy your key. This may be the last time it is shown — save it somewhere secure.
  9. Paste the key into AI Keyboard: Setup wizard → API key, or AI Keyboard → Settings → API key.

Get the key again (rotate)

  • In Google AI Studio, click Create API key again. If it asks for a Google Cloud project, selecting Generative Language Client should work.

References