Use API Keys
This page describes how to use API keys in API Gateway.
Overview
An API key is a string that identifies a Google Cloud project for quota, billing, and monitoring purposes. Developers generate an API key in a project in the Google Cloud console. They then embed that key in every call to your API as a query parameter or in a request header.
If you specify an API key requirement in your API config, API Gateway uses the API key to look up the associated Google Cloud project. API Gateway rejects requests unless the API key was generated in your Google Cloud project or within other Google Cloud projects in which your API has been enabled.
Create an API key
Create an API key, or view API keys already available within your Google Cloud project, go to the APIs & Services > Credentials page and complete the steps described in Create an API key.
Configure API key authentication for API Gateway
Configure API key authentication for API Gateway to secure access to your gateway using an API key, as described in the following sections.
- Enable API key support for your service.
Google Cloud console
Do the following:
- In the Google Cloud console, go to APIs & Services > Library.
- In the search bar, enter the Managed Service name of the API. You can find this value in the Managed Service column for your API on the APIs landing page. For example:
my-api-123abc456def1.apigateway.my-project.cloud.goog
- Click the service card to view the landing page.
- On the landing page for your service, click