0
votes

I have a small hobby project using Google Cloud's Natural Language Processing API. I also made sure to set up a daily budget for the project of just $2.00 USD.

screenshot of spending limit

My questions is: what happens when/if the spending limit is reached? Does the API cease working to prevent any further queries to the API? Basically, does having a spending limit prevent me from having to worry about additional charges to the project in question?

Thanks!

1

1 Answers

2
votes

Yes, if your daily spending limit is hit, services that cost money will cease to function until the limit resets.

See When a resource is depleted for details:

For resources that are required to initiate a request, when the resource is depleted, App Engine by default returns an HTTP 403 or 503 error code for the request instead of calling a request handler.

For all other resources, when the resource is depleted, an attempt in the application to consume the resource results in an exception. This exception can be caught by the application and handled, such as by displaying a friendly error message to the user.

In the Python API, this exception is apiproxy_errors.OverQuotaError.

In the API for Java, this exception is com.google.apphosting.api.ApiProxy.OverQuotaException.

In the Go API, the appengine.IsOverQuota function reports whether an error represents an API call failure due to insufficient available quota.