此 API 文档假定您使用过 Google Cloud,并且您熟悉 Google Cloud 控制台中的 Cloud Billing 功能和概念。如果您还不熟悉 Cloud Billing 账号、 Google Cloud 项目、 Google Cloud产品和 Cloud Billing 预算及提醒等概念,请在开始编写代码之前先阅读以下内容:
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-08-18。"],[[["\u003cp\u003eFamiliarity with Google Cloud console, Cloud Billing features, and concepts like Cloud Billing accounts, projects, products, and budgets is essential before coding a Cloud Billing budget application.\u003c/p\u003e\n"],["\u003cp\u003eCloud Billing accounts can have thousands of budgets, each linked to one account, and one account can link to multiple Google Cloud projects.\u003c/p\u003e\n"],["\u003cp\u003eYou can monitor costs for an entire Cloud Billing account or specific slices of costs using granular budget filters such as projects and services.\u003c/p\u003e\n"],["\u003cp\u003eThe Cloud Billing Budget API can be invoked via HTTP requests or client libraries, with the API employing RESTful architecture, utilizing HTTP verbs like \u003ccode\u003ePOST\u003c/code\u003e, \u003ccode\u003eGET\u003c/code\u003e, \u003ccode\u003ePUT\u003c/code\u003e, and \u003ccode\u003eDELETE\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eThe Cloud Billing Budget API uses JSON, a language-independent data format, to return data, providing a simple text representation of arbitrary data structures.\u003c/p\u003e\n"]]],[],null,["# Cloud Billing Budget API Prerequisites\n\n\u003cbr /\u003e\n\nBefore you start coding your first Cloud Billing budget application, there\nare a few things you need to do, if you haven't done them already.\n\nTry out the Cloud Billing features in the Google Cloud console\n--------------------------------------------------------------\n\nThis API documentation assumes that you've used Google Cloud, and\nthat you're familiar with the Cloud Billing features and concepts in\nthe Google Cloud console. If you're not already familiar with concepts like\nCloud Billing accounts, Google Cloud projects, Google Cloud\nproducts, and Cloud Billing budgets and alerts, read the following\nbefore starting to code:\n\n- [Overview of Cloud Billing concepts](/billing/docs/concepts)\n- [Manage your Cloud Billing account](/billing/docs/how-to/manage-billing-account)\n- [View the projects linked to a Cloud Billing account](/billing/docs/how-to/view-linked)\n- [Budgets and budget alert rules](/billing/docs/how-to/budgets)\n- [Access control for the Cloud Billing Budget API](/billing/docs/access-control)\n\nAfter you are familiar with the Cloud Billing features and concepts, try out\nthe [Google Cloud console user interface](https://console.cloud.google.com/).\n\nKey Cloud Billing concepts\n--------------------------\n\n- Each individual Cloud Billing account can have [several thousand budgets](/billing/quotas) associated with it at a time. See [Quotas and limits](/billing/quotas) for the current limits and additional information.\n- A budget is linked to only one Cloud Billing account at a time.\n- A single Cloud Billing account is linked to, and pays for, one or more Google Cloud projects.\n- A Google Cloud project is linked to only one Cloud Billing account at a time.\n- You can create a budget to monitor your costs for an entire Cloud Billing account, including all the Google Cloud projects paid for by that billing account. You can also define the scope of the budget using **granular budget filters** to monitor specific slices of your costs. Filters include Google Cloud projects, services, the budget's time period, and other filters applicable to your Cloud Billing account.\n\nLearn REST basics\n-----------------\n\nThere are two ways to invoke the Cloud Billing Budget API:\n\n- Sending HTTP requests and parsing the responses.\n- Using [client libraries](/billing/docs/reference/budget/libraries) (recommended).\n\nIf you decide not to use client libraries, you'll need to understand the basics\nof REST.\n\nREST is a style of software architecture that provides a convenient and consistent approach to requesting and modifying data.\n\nThe term REST is short for \"[Representational State Transfer](https://en.wikipedia.org/wiki/Representational_state_transfer).\" In the context of Google APIs, it refers to using HTTP verbs to retrieve and modify representations of data stored by Google.\n\nIn a RESTful system, resources are stored in a data store; a client sends a request that the server perform a particular action (such as creating, retrieving, updating, or deleting a resource), and the server performs the action and sends a response, often in the form of a representation of the specified resource.\n\nIn Google's RESTful APIs, the client specifies an action using an HTTP verb such as `POST`, `GET`, `PUT`, or `DELETE`. It specifies a resource by a globally-unique URI of the following form: \n\n```\nhttps://www.googleapis.com/apiName/apiVersion/resourcePath?parameters\n```\n\nBecause all API resources have unique HTTP-accessible URIs, REST enables data caching and is optimized to work with the web's distributed infrastructure.\n\nYou may find the [method definitions](https://tools.ietf.org/html/rfc7231#section-4.3) in the HTTP 1.1 standards documentation useful; they include specifications for `GET`, `POST`, `PUT`, and `DELETE`.\n\n### REST in the Cloud Billing Budget API\n\nThe Cloud Billing Budget API operations map directly to REST HTTP verbs.\n\nThe specific formats for Cloud Billing Budget API URIs are: \n\n```\nhttps://billingbudgets.googleapis.com/v1/resourcePath?parameters\n```\n\nThe full set of URIs used for each supported operation in the API is summarized\nin the Cloud Billing Budget API reference documents\n([REST](/billing/docs/reference/budget/rest),\n[RPC](/billing/docs/reference/budget/rpc)).\n\nLearn JSON basics\n-----------------\n\nThe Cloud Billing Budget API returns data in JSON format.\n\n[JSON](http://en.wikipedia.org/wiki/JSON) (JavaScript Object Notation) is a common, language-independent data format that provides a simple text representation of arbitrary data structures. For more information, see [json.org](http://www.json.org/)."]]