GCP Billing
Read Google Cloud spend, billing accounts, linked projects and budgets. Actual cost comes from the BigQuery billing export, broken down by service, SKU, project or label, with credits reported separately.
Connectors
Choose the connector that matches your authentication method. The options below use the names shown in StackAI.
GCP Billing
Credentials
GCP Billing
Read Google Cloud billing accounts, budgets and actual spend. Spend comes from the BigQuery billing export, so the service account needs both billing and BigQuery read access.
Set up in GCP Billing
Prepare the GCP Billing account or service that the workflow will access. Grant access to the required resources and operations.
Obtain the account, endpoint, and authentication values listed below from the service administrator.
Set up in StackAI
Open Settings → Connections, add a connection, and select GCP Billing.
Enter the credentials and connection details in the fields below.
Save the connection and check its connection status. Select this saved connection when configuring an action or feature that uses it.
Connection fields
Project ID
Yes
The Google Cloud project that runs the BigQuery queries and is billed for the bytes they scan. This is usually the project holding the billing export dataset.
Service Account JSON
Yes
JSON key for a service account with read-only billing access. Grant roles/billing.viewer on the billing account, plus roles/bigquery.dataViewer on the export dataset and roles/bigquery.jobUser on the project that runs the query. Both halves are needed: the Cloud Billing API returns account metadata and catalog prices, while actual spend is only in the BigQuery billing export. Provider instructions.
Billing Export Dataset (Optional)
Optional / as applicable
The BigQuery dataset holding the billing export, such as 'billing_export'. Setting it here lets the cost actions offer the export tables as a dropdown instead of asking for a full table name.
Verify the connection
Check that the connection is healthy. Then run a read operation against a resource the connected account can access. A successful connection check confirms authentication; it does not guarantee permission for every action.
If access is denied, check the credential or OAuth permissions, the selected account or environment, and access to the specific resource. Update expired credentials or reconnect after permissions change.
Use an action
Add the required GCP Billing action to the workflow.
Select a connection when the action requests one.
Complete the required fields. Use the reference picker when a value comes from another workflow step.
Run the workflow and inspect the action’s output. Check the result before using it in a later step.
Actions
Get Cost
Read Google Cloud spend for a date range, broken down by service, SKU, project or label, with credits shown separately.
Inputs
Billing Export Table
select (string)
Yes
The BigQuery table holding your billing export. Set the export dataset on the connection to pick it from a list instead of typing it. Options load from the selected connection.
Date Range
select (string)
No
Pick a preset window, or choose 'custom' and set Start Date and End Date. Options load from the selected connection. Default: month_to_date.
Start Date
string
No
First day to include (YYYY-MM-DD). Needed for 'custom'.
End Date
string
No
Last day to include (YYYY-MM-DD). This day is included. Needed for 'custom'.
Granularity
select (string)
No
Size of each time bucket. NONE returns one total per group. Options load from the selected connection. Default: DAILY.
Group By
select (string)
No
Break the spend down by service, SKU, project or a label. Choose 'none' for totals only. Options load from the selected connection. Default: none.
Label Key
string
No
Which label to group by. Required when Group By is 'label'.
Row Limit
integer
No
How many result rows to return.
Outputs
Rows
array
Spend per bucket and group, with credits applied separately.
Total Cost
number
Spend before credits, summed across every row.
Total Credits
number
Credits applied across every row, as a negative adjustment.
Total Net Cost
number
Spend after credits, measured by usage time.
Group Count
number
How many groups the period contains.
Truncated
boolean
True when the row limit cut the detail rows short.
Currency
string
Currency of the amounts, as recorded in the export.
Bytes Processed
number
Bytes BigQuery scanned, which is what this query costs you.
List Billing Export Tables
Find the BigQuery tables holding your Google Cloud billing export, labelled by export type and billing account.
Inputs
Dataset
string
No
The BigQuery dataset holding the export. Defaults to the one set on the connection.
Outputs
Tables
array
Billing export tables found in the dataset.
Total Count
number
Number of export tables found.
Truncated
boolean
True when more export tables exist than were returned.
List Billing Accounts
List the Google Cloud billing accounts your service account can read.
Inputs
Limit
integer
No
Maximum records to return (1-1000). Defaults to 200. Minimum: 1. Maximum: 1000.
Outputs
Accounts
array
Billing accounts the service account can see.
Total Count
number
Number of accounts returned.
Truncated
boolean
True when more entries remain than were returned.
List Budgets
List the budgets set on a Google Cloud billing account, with their limits and alert thresholds.
Inputs
Billing Account
select (string)
Yes
Which billing account's budgets to list. Options load from the selected connection.
Limit
integer
No
Maximum records to return (1-1000). Defaults to 200. Minimum: 1. Maximum: 1000.
Outputs
Budgets
array
Budgets on the billing account, with their limits and thresholds.
Total Count
number
Number of budgets returned.
Truncated
boolean
True when more entries remain than were returned.
List Project Billing Info
List which Google Cloud projects are billed to an account, and whether billing is enabled for each.
Inputs
Billing Account
select (string)
Yes
Which billing account's projects to list. Options load from the selected connection.
Limit
integer
No
Maximum records to return (1-1000). Defaults to 200. Minimum: 1. Maximum: 1000.
Outputs
Projects
array
Projects linked to the billing account.
Billing Enabled Count
number
How many of the projects have billing enabled.
Total Count
number
Number of projects returned.
Truncated
boolean
True when more entries remain than were returned.
Important behavior
Actions that create, update, send, or delete data can change the connected service. Review their inputs before running them. A retry can repeat an operation; consider this when configuring retries for actions that change data.
The catalog lists the fields and capabilities available in the supplied provider definition. Availability can also depend on your deployment and organization’s Feature Access settings.
Last updated
Was this helpful?

