Controlling who can enable your API

API keys are associated with the Google Cloud project in which they have been created. If your API requires an API key, you either have to give your API users a key from the project that you created the Cloud Endpoints service in, or you can let users enable your API in their own Google Cloud project and create an API key. This page shows you how to grant the permission that users need to enable your API.

Granting access

Endpoints uses the Identity and Access Management (IAM) Service Consumer role to allow someone who isn't a member of your Google Cloud project to enable your API in their own Google Cloud project. This section shows you how to grant access using the Google Cloud console or the Google Cloud CLI.

Revoking access

You revoke access to your API by removing the Service Consumer role from a user or group that previously had the role. After you revoke someone's access, they won't be able to enable your API.

This section shows you how to revoke access using the Google Cloud console or the Google Cloud CLI.

What's next

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2026-02-25 UTC.