REFERENCE / GOOGLE
Credentials / 12 min

Connect Gemini to n8n

Make a Gemini API key, save it in n8n, and test it.

Create the key

  1. Open Google AI Studio and accept the required terms.
  2. Open API keys. New users may already have a default Google Cloud project and key.
  3. Make a separate key for n8n.
  4. Store it immediately in an n8n Google Gemini/PaLM credential. Do not paste it into node parameters.
  5. Turn on billing only when the model you need requires it.

Important 2026 key change

Google now issues restricted authorization keys by default and is retiring unrestricted standard-key behavior. As of June 19, 2026, unrestricted standard keys can be rejected; Google’s published migration reaches all standard keys in September 2026. If an older key is marked unrestricted or blocked, create or migrate to the current key type in AI Studio.

Test it before importing workflows

Create a temporary Gemini step in n8n. Ask it to Return only: connection verified. Run it once. Then test one small public image.

Model names change. If a model in an imported workflow is unavailable, choose a current model with the same job—text, image understanding, structured output, or image generation—and test it again.

Common errors

  • 403 / permission denied: confirm terms, region, project permission, billing, and key status.
  • Key reported as leaked: revoke it and generate a new key; do not attempt to reuse it.
  • Model not found: the imported model is unavailable to the project or has been renamed/retired.
  • 429: slow down, reduce concurrent executions, and inspect your current project quota.

Official references: Gemini API key guide, getting started, and troubleshooting.