Skip to content
Docs

Creating a Google API key

This guide is part of the Publicus connection catalog. Once you have the credentials, connect the service and Publicus stores them for you.

Distilled from Google’s own documentation: Authenticate using API keys. Retrieved 2026-07-03. Manage API keys (the same page under its new address and title), Use API keys to access APIs, Authenticate to Cloud Translation, Set up the Places API (New), Places API Usage and Billing, Set up the Routes API, Routes API Usage and Billing, Set up the Address Validation API, Set up the Weather API and Using Gemini API keys. Retrieved 2026-10-25.

An API key ties each request to one Google Cloud project, and that project is billed for it. Create the key in the project you want to pay. A key does not identify a person, so it only works with APIs that accept keys: Translation (Basic), Vision, Speech-to-Text, Natural Language and the Maps Platform APIs among them. APIs that act on a person’s own data, such as Gmail or Drive, need the Google OAuth connection instead.

  1. In the Google Cloud console, choose the project in the project picker at the top of the page.
  2. Go to Menu → APIs & Services → Library.
  3. Search for each API the connection will call, open it, and click Enable. Do this before creating the key: Google only lets you restrict a key to an API that is already enabled in its project.

Places API (New), Routes, Geocoding, Address Validation, Weather, Air Quality and Pollen are Google Maps Platform APIs. Google requires billing to be enabled on every project that calls them, and every request to carry an API key or OAuth token.

  1. In the Google Cloud console, open Billing for the project.
  2. Link a billing account to the project, or create one if you have none.

The Weather API also offers a Maps Demo Key without billing. Google intends it for prototyping only, not production use, so do not use it for a connection.

  1. Go to Menu → APIs & Services → Credentials. Maps Platform documentation calls the same page Google Maps Platform → Credentials.
  2. Click Create credentials → API key.
  3. Under the API restrictions, select only the APIs this connection calls. The console will not create a key without at least one, and a key restricted this way cannot call any other API, so a leaked key reaches only what you selected.
  4. Leave Authenticate API calls through a service account unchecked for the Cloud AI and Maps Platform APIs. That option binds the key to a service account and makes it an authorization key, which Google advises against for production use with APIs that create or manage Cloud resources.
  5. Click Create. The API key created dialog shows the key string. Copy it into the connection, and do not paste it anywhere else.
  6. Optionally, click the key’s name and set Application restrictions to limit which callers may use it. Only one restriction type applies at a time, and for calls made from servers the matching type is IP addresses. Add one only if you know the addresses the calls come from: a request from any other address is refused.

To change which APIs an existing key may call, click its name, choose Restrict key under API restrictions, tick the APIs, then Save.

Use one key per connection. To rotate a key, create the new one, update the connection, then delete the old key.

Cloud Translation accepts API keys only on its Basic (v2) API. Google documents that the Advanced (v3) API does not support them, so glossaries, document translation and custom models need OAuth, not a key.

A Gemini API key is a Google Cloud API key on a project too, sent in the same x-goog-api-key header, but it does not belong on this connection. It is created in Google AI Studio, not on the Credentials page. Since 28 May 2026, the keys AI Studio creates are authorization keys, restricted to the Gemini API (the Generative Language API) by default. Google advises keeping the Gemini key separate from keys for other services. Connect Gemini with its own Gemini API key, which has its own guide.

If you restrict a key here to Cloud or Maps Platform APIs, leave the Generative Language API out of its restrictions.

The key goes in the x-goog-api-key request header. Google also accepts the key query parameter, but discourages it: the key then appears in URLs, where it is easier to steal. See Use API keys to access APIs.

Open Connections under Credentials, choose Google, and pick Google API key. Publicus asks for exactly the fields listed above and keeps them in your workspace’s secret storage.

See also: Google in the catalog.

This guide is maintained by Publicus and published under CC BY 4.0.