6

I would like to see my current bill on my GCP project. I tried using the Billing API and the Budget API but they just give me meta data information. No bill with costs on it. I would like to know the current bill cost for the month.

I know there is a Pub/Sub way to do this, but I don't want to get notified of the billing cost. I would like to see the bill cost when on demand.

John Hanley
  • 74,467
  • 6
  • 95
  • 159
AskYous
  • 4,332
  • 9
  • 46
  • 82
  • Did you try [this](https://cloud.google.com/billing/docs/reference/budget/rest/v1/billingAccounts.budgets/get)? – Swapnil Masurekar Feb 06 '21 at 18:13
  • Yes. In [the documentation](https://cloud.google.com/billing/docs/reference/budget/rest/v1/billingAccounts.budgets#Budget), it shows the response. It's just metadata information. No cost. – AskYous Feb 06 '21 at 18:15
  • `"amount"` field has object `BudgetAmount` which has object `Money`, this object holds the amount. Refer this [link](https://cloud.google.com/billing/docs/reference/budget/rest/Shared.Types/Money). Did you check it out? – Swapnil Masurekar Feb 06 '21 at 18:18
  • 1
    Yes. But isn't this the **budget** amount. Not the **billing** amount? For example, I just went into my GCP and set the budget to $13.37. Now it displays that budget I put. But I don't want the budget. I want to know my bill cost. Here is the API response I just tested: https://imgur.com/e6dSKGL – AskYous Feb 06 '21 at 18:24

1 Answers1

7

At this moment as per the list of available 'Cloud billing APIs', GCP don't have such an API to view usage/total cost of a project. Here is the Feature Request for this.

As per the PIT there is no such API that would provide real-time billing cost and this is Feature Request as billing Engineering team working on this.

Mahboob
  • 1,877
  • 5
  • 19