canonical: https://jentic.com/apis/googleapis.com/billingbudgets

# Google Cloud Billing Budget API

The Cloud Billing Budget API stores spending budgets attached to a Cloud Billing account and the threshold rules that fire as spend accrues against that plan. You can create budgets scoped to whole billing accounts, specific projects, services, or labels, and configure alert thresholds at percentage triggers. Budgets are FinOps guardrails - not enforcement. They emit notifications via Cloud Pub/Sub or email so other systems can react, but they do not stop resource provisioning. Use them to track and alert on Google Cloud spend.

## For AI agents

Create and manage Cloud Billing budgets, threshold rules, and notification settings for a billing account. Agents can list budgets, patch thresholds, and inspect spend filters.

## Scope

Does not block spend, manage billing accounts, or run cost reports - use for budget creation, threshold alerts, and Pub/Sub notification wiring only.

## Capabilities

- Create budgets scoped to a billing account, projects, services, or labels
- Configure threshold rules at percentage points of forecasted or actual spend
- List budgets under a billing account and inspect their filters
- Patch a budget's amount, filter, or threshold rules without recreating it
- Delete budgets that are no longer needed
- Wire budget notifications to a Pub/Sub topic or notification channel

## Use cases

### Project-Level Spend Alerts

Create a budget per environment so spend on dev, staging, and prod each fire at their own thresholds. Budgets are managed at /v1/{parent}/budgets with a billing account parent and a budgetFilter containing projects[]. Threshold rules at 50/75/90/100 percent trigger emails to billing admins or Pub/Sub messages for downstream automation.

Example prompt: Create a $5,000 monthly budget on billingAccounts/012345-678901-23ABCD scoped to projects/myproj-dev with thresholds at 50, 75, 90 percent.

### Service Cost Tracking

Filter budgets by service (BigQuery, Compute Engine, Cloud Storage) to track per-service spend across the org. budgetFilter.services accepts service IDs and combines with projects, labels, and creditTypes for fine-grained scoping. Useful for FinOps teams who chargeback by service.

Example prompt: Create a budget that filters services to BigQuery and Compute Engine across all projects under billingAccount 012345-678901-23ABCD with a $20,000 monthly cap.

### Pub/Sub-Driven Automation

Configure notificationsRule.pubsubTopic on a budget so percentage thresholds emit JSON messages that other systems consume. Combined with Cloud Functions or Workflows, this enables automated cost responses such as scaling down non-prod resources when spend crosses 80 percent.

Example prompt: Patch existing budget budgets/abc to add notificationsRule with pubsubTopic projects/myproj/topics/billing-alerts.

### Agent-Driven FinOps Setup

An AI agent takes a request like 'put a $10k cap on the analytics project with alerts at 80 and 100 percent' and creates the budget through Jentic. The agent loads the create operation, applies the right filter and thresholds, and reports back the budget resource name. OAuth tokens stay in your Jentic One instance.

Example prompt: Given the request 'cap analytics project at $10k with alerts at 80 and 100 percent', create a budget scoped to projects/analytics with the right thresholdRules.

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | /v1/{+parent}/budgets | Create a budget on a billing account |
| GET | /v1/{+parent}/budgets | List budgets on a billing account |
| GET | /v1/{+name} | Get a single budget |
| PATCH | /v1/{+name} | Update an existing budget |
| DELETE | /v1/{+name} | Delete a budget |

## Key resources

- **Budgets** — Create, list, patch, and delete budgets attached to a billing account.

## Why Jentic

- **Setup:** Wiring the Cloud Billing Budget API by hand means standing up its Google OAuth 2.0 flow, refreshing scoped access tokens, and assembling budgetFilter and thresholdRules payloads with Pub/Sub notification wiring yourself. Through Jentic you install once, import the Cloud Billing Budget API from the API Directory, store the OAuth credentials once, and your agent calls it.
- **Permission scoping:** The API puts the billing account and budget in the URL path (/v1/{+parent}/budgets and /v1/{+name}), so a rule can pin your agent to one billing account's budgets: it can create budgets and read their thresholds there and nowhere else. You choose the operations it may call, so deleting a budget is not included unless you add it.
- **Credential handling:** Your Google OAuth client credentials and refresh token are stored once, encrypted, by your own Jentic One instance and injected at execution time. The agent receives only short-lived scoped access tokens and never sees the refresh token in its prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create a GCP budget with a 90 percent alert', and Jentic returns the create budget operation with its budgetFilter and thresholdRules schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Cloud Billing API** — Manages billing accounts and project-account links that budgets attach to.
- **BigQuery Reservation API** — Controls BigQuery slot capacity that drives a major chunk of GCP spend.
- **Cloud Resource Manager API** — Lists and manages projects that budgets filter on.

## FAQ

### What authentication does the Cloud Billing Budget API use?

The API uses Google OAuth 2.0 with the cloud-billing or cloud-platform scope. Through Jentic the OAuth refresh token sits in the encrypted vault and the agent only receives short-lived access tokens scoped to the budget operations.

### Can I create a budget that covers only a specific project?

Yes. POST /v1/{parent}/budgets with budgetFilter.projects set to projects/PROJECT_ID limits the budget to spend in that project. You can also filter by services, labels, calendarPeriod, and creditTypesTreatment.

### What are the rate limits for the Cloud Billing Budget API?

Quotas are billing-account-level: typically a few thousand budgets per billing account and modest write QPS on the same budget. Read QPS is bursty up to several hundred per second per account. Specific values are visible in the Google Cloud quotas console.

### How do I wire budget alerts to Pub/Sub through Jentic?

Search Jentic for 'add a Pub/Sub notification to a budget', load the schema for PATCH /v1/{name}, and execute with notificationsRule.pubsubTopic set to projects/PROJECT/topics/TOPIC and an updateMask of notificationsRule. Jentic forwards the OAuth token automatically.

### Does a budget stop spending when it hits 100 percent?

No. Budgets only emit notifications at the configured thresholds. They do not block resource provisioning or stop existing workloads. Combine them with Cloud Functions or Workflows triggered from the Pub/Sub topic to enforce automated responses.

### Can I limit what my agent is allowed to do with the Cloud Billing Budget API?

Yes. Because you run Jentic One yourself, your own rules decide which operations and credentials the agent may use, and this API puts the billing account and budget in the URL path (/v1/{+parent}/budgets and /v1/{+name}), so a rule can pin the agent to a single billing account's budgets and nowhere else. You choose the exact operations it may call, so you can let it create budgets and read their threshold rules while leaving delete out unless you explicitly add it. The stored Google OAuth credentials are injected only at execution time, and the agent receives short-lived scoped access tokens rather than the refresh token.
