Get a GCP recommendation

Returns the recommendation for one product line (gcp_service) and region scope on the GCP
billing account, including analysis metrics and time-bucketed eligible spend. Use
granularity to choose the eligible-spend bucket size (defaults to day).

region: optional for compute, defaulting to global (its only scope). Required
for cloud_sql — omitting it returns 400 with code validation_failed, as does a
malformed region or one incompatible with gcp_service (cloud_sql never uses global).
A well-formed region the billing account has never had eligible spend in returns 404
with code not_found — the scope does not exist, same as an unknown billing account.
When the scope exists but no stored recommendation matches, the response is 200 with
recommendation omitted and estimatedEquivalentRecommendedCommitment of 0.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…
Path Params
string
required
^[A-Z0-9]{6}-[A-Z0-9]{6}-[A-Z0-9]{6}$

GCP Billing Account ID (format XXXXXX-XXXXXX-XXXXXX; the account that owns the CUDs) that scopes the request.

string
enum
required

PS4C product line to fetch the recommendation for. Matching is case-insensitive; the value is lowercased before validation.

Allowed:
Query Params
string
^(global|[a-z]+(_[a-z0-9]+)+)$

Filter by region scope, in lower_snake_case wire form (for example us_east1), or the
literal global. Requires gcp_service; a request with region but no gcp_service
returns 400 with code gcp_service_required. When both are omitted, all available
regions for all available product lines are returned.

The value is format-validated, not checked against a closed region list: compute accepts
only global, cloud_sql accepts only concrete regions (never global), and a value that
is malformed or incompatible with gcp_service returns 400 with code validation_failed.
A well-formed, service-compatible region with no data returns 200 with an empty result.
Matching is case-insensitive; the value is lowercased before validation.

string
enum
Defaults to day

Time bucket size for eligible-spend data points on the recommendation response. If omitted, defaults to day. Coarser buckets return min/max/median usage; hour returns per-hour totals.

Show Details
hourOne point per hour (typically last 24 hours of eligible usage).
dayOne point per day (typically last 21 days).
weekOne point per week (typically last 16 weeks).
monthOne point per month (typically last 6 months).
Allowed:
Headers
string

Customer (tenant) ID for the request. This is separate from authentication: you still pass your personal or service account API token in the Authorization header (Bearer <token>). See Get Started.

When to omit (most callers): If your personal or service account token belongs to a single customer, omit this header. The API resolves that customer from the token.

When to send: If your credential can access more than one customer, set X-Tenant-Id to the customer ID you want to act on. A service account can select an active direct or nested descendant of its home customer; the endpoint's normal permissions, entitlements, and resource-ownership checks still apply. A service-account target outside that customer subtree returns 403 Forbidden. Prefer this header over the legacy customerContext query parameter, which only applies to legacy API keys and is ignored by personal and service account tokens.

string
enum
Defaults to application/json

Generated from available response content types

Allowed:
Responses

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json
application/problem+json