google.internal.vertex_project_id

The project the request is billed to: the explicit option, else `GOOGLE_CLOUD_PROJECT` / `GCLOUD_PROJECT`, else whatever the credential document and the google-auth chain report. Null means "not discoverable".

Reference version

Signature

function google.internal.vertex_project_id(
preview: bool = …
) -> string | null throws baml.errors.Io | baml.errors.ParseError | ai.errors.InvalidRequest

The project the request is billed to: the explicit option, else GOOGLE_CLOUD_PROJECT / GCLOUD_PROJECT, else whatever the credential document and the google-auth chain report. Null means "not discoverable".

Express mode never consults credentials — a keyed request has none, and the ADC chain would otherwise reach for the GCE metadata server. Express mode is decided BEFORE the environment is consulted: an express key is issued for the project-less express endpoint, and an ambient GOOGLE_CLOUD_PROJECT (which every Cloud Run / GCE runtime sets by itself) is not a configuration of THIS client — letting it through would silently re-point a keyed client at a project-scoped URL the key cannot authorize. An explicit project_id option still wins, since that IS configuration.

Source:<builtin>/google/ns_internal/vertex.bamlbytes 59926809