Getting billing data from GCP
How to get billing data from your Google Cloud project
Before you can retrieve billing data, you must enable the Cloud Billing API for your Google Cloud project.
- Make sure you are in the correct project for which you want to get billing data.
- Click on the hamburger menu (three horizontal lines) in the upper left corner, and navigate to "APIs & Services" > "Library."
- In the search bar, type "Cloud Billing API" and click on the result.
- Click "Enable" to enable the API for your project.
- Set up authentication:
To access billing data, you'll need to authenticate your requests using a service account with the necessary permissions.
- Navigate to "IAM & Admin" > "Service Accounts."
- Click on "Create Service Account" and fill in the necessary details. Click "Create" when you're done.
- In the "Grant this service account access to project" section, select the "BigQuery Job User" role. This role will allow your service account to access the BigQuery dataset for billing. Click "Continue."
- Click "Done" to finish creating the service account.
- Find your newly created service account in the list, and click on the three vertical dots under "Actions." Select "Manage keys."
- Click on "Add Key" and choose "JSON." A JSON key file will be generated and downloaded to your computer. Store this file securely, as it contains sensitive information that can be used to access your project's billing data.
Adding a new billing account to Autocloud
To add a new billing account to Autocloud, you will need to generate a Service Account Key for the Google project hosting the BigQuery dataset for billing. The Service Account Key must have the "BigQuery Job User" role. Follow the steps in the "Set up authentication" section above to create a service account with the "BigQuery Job User" role and generate a JSON key file.
Once you have the JSON key file, you can provide it to Autocloud during the billing account setup process. The Autocloud platform will use this key to access the BigQuery dataset and retrieve billing data from your Google Cloud project.
This step can be done while creating a GCP project for the first time, or when you try to create a new snapshot:

- Upload the JSON key file
- Set up Billing Information
- Billing Account ID
- Project ID Hosting BigQuery Dataset
- BigQuery Dataset Name