Enable the App Optimize API

To use App Optimize API, you must enable it in the Google Cloud project where you intend to create and manage your usage and cost report resources. You can enable the API using the Google Cloud console or the Google Cloud CLI.

Before you begin

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  5. Verify that billing is enabled for your Google Cloud project.

Enable the API

To enable App Optimize API, follow one of these sets of instructions:

Console

  1. In the Google Cloud console, go to the API Library.

    Go to the API Library

  2. If prompted, select your Google Cloud project.

  3. On the App Optimize API page, click Enable.

gcloud

  1. Install and initialize the Google Cloud CLI.
  2. To enable the App Optimize API, run the following command:

    gcloud services enable appoptimize.googleapis.com --project=PROJECT_ID
    

    Replace PROJECT_ID with your Google Cloud project ID.

Verify that the API is enabled

To check that App Optimize API is enabled, follow one of these sets of instructions:

Console

  1. In the Google Cloud console, go to the Enabled APIs & services page.

    Go to Enabled APIs & services

  2. In the list, find and confirm that App Optimize API is listed.

gcloud

  1. Run the following command:

    gcloud services list --enabled --project=PROJECT_ID --filter="NAME:appoptimize.googleapis.com"
    
  2. If the API is enabled, the output includes:

    NAME                        TITLE
    appoptimize.googleapis.com  App Optimize API
    

What's next