Skip to main content

Claude on Google Cloud (Anthropic managed)

Since v1.114.0

Claude on Google Cloud, Anthropic managed is the Claude API run by Anthropic and billed through Google Cloud. Requests go to claude.googleapis.com and authenticate with Google credentials. Request bodies, streaming and model names are the same as the Claude API, and LiteLLM tracks its spend at the Claude API prices.

This is a different product from Claude on Vertex AI, which Google runs on aiplatform.googleapis.com. Use the anthropic_google_cloud/ prefix for the Anthropic-managed product and vertex_ai/ for the Google-managed one.

PropertyDetails
Provider routeanthropic_google_cloud/
Supported endpoints/chat/completions, /messages, /responses
AuthGoogle Cloud credentials (service account key or application default credentials)
Cost trackingYes, at the Claude API prices

Prerequisites​

  1. In your Google Cloud project, subscribe to Claude Models on Google Cloud (Anthropic managed) in Google Cloud Marketplace, enable the claude.googleapis.com and anthropic-managed-claude.cloudpartnerservices.goog services on every project that calls the API, and activate the Anthropic organization from the console. Anthropic's setup guide walks through each step.
  2. Grant the identity LiteLLM runs as the roles/claude.user role on the project.
  3. Copy your workspace ID from the Claude Console under Settings > Workspaces. It starts with wrkspc_.

Parameters​

ParameterEnvironment variableDescription
vertex_credentialsGOOGLE_APPLICATION_CREDENTIALSPath to a service account key file, or the key's JSON. Application default credentials are used when neither is set.
vertex_projectANTHROPIC_GOOGLE_CLOUD_PROJECTGoogle Cloud project ID. Defaults to the project of the credentials. With application default credentials, Google's GOOGLE_CLOUD_PROJECT comes first when it is set.
workspace_idANTHROPIC_GOOGLE_CLOUD_WORKSPACE_IDClaude workspace ID. Required unless api_base is set.
api_baseANTHROPIC_GOOGLE_CLOUD_BASE_URLFull .../invoke base URL. Overrides the URL LiteLLM builds from the project and workspace. The environment variable only applies to deployments that set neither vertex_project nor workspace_id.
api_keyA ready Google access token. LiteLLM sends it as is, so it stops working when the token expires. Set vertex_project, ANTHROPIC_GOOGLE_CLOUD_PROJECT or api_base with it. Without any of them LiteLLM loads application default credentials to find the project, so on a Google Cloud VM the request goes to the VM's own project.

This route does not read VERTEXAI_PROJECT, VERTEXAI_LOCATION or VERTEXAI_CREDENTIALS, which only the vertex_ai/ route uses.

LiteLLM mints and refreshes the Google access token for each deployment, so long-running gateways never send an expired token.

Usage​

import os
import litellm

os.environ["GOOGLE_APPLICATION_CREDENTIALS"] = "/path/to/service-account.json"
os.environ["ANTHROPIC_GOOGLE_CLOUD_PROJECT"] = "my-gcp-project"
os.environ["ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID"] = "wrkspc_01..."

response = litellm.completion(
model="anthropic_google_cloud/claude-opus-5",
messages=[{"role": "user", "content": "Write a haiku about the sea."}],
)
print(response.choices[0].message.content)

Streaming, tool calls and prompt caching work the same way as on the Anthropic provider. /v1/messages/count_tokens and the SDK's litellm.acount_tokens return the exact count from Google's count endpoint, called with the same credentials as the request.

The advisor tool is sent to Google as is, and Google runs it. LiteLLM sends fast mode (speed: "fast") to Google for Claude Opus 5.5, Claude Fable 5.2 and Claude Mythos 5.2, the models Anthropic lists for fast mode, and tracks its cost at 2x. The 1.108.x LTS line does not bundle Claude Fable 5.2 or Claude Mythos 5.2 entries. It gets their prices and fast mode from the cost map it downloads at startup, so a proxy that sets LITELLM_LOCAL_MODEL_COST_MAP=True has neither. On other models LiteLLM drops speed when drop_params is set and answers 400 when it is not.

US-only inference​

Pass inference_geo: "us" to keep inference in the US. LiteLLM's cost tracking applies the Claude API's 1.1x price for US-only inference. Only Claude 4.6 and later models accept it. Older models such as Claude Haiku 4.5 answer 400.

model_list:
- model_name: claude-opus-gcp-us
litellm_params:
model: anthropic_google_cloud/claude-opus-5
vertex_project: my-gcp-project
workspace_id: os.environ/ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID
inference_geo: us

Errors​

StatusMeaning
400 too many total text bytesThe request's text is larger than 32 MB.
401No workspace is set, or no project is set in vertex_project, ANTHROPIC_GOOGLE_CLOUD_PROJECT or the credentials, and LiteLLM answers before calling Google. Google also answers 401 UNAUTHENTICATED when the token is invalid or expired, such as an api_key older than one hour.
403 has not been used in project ... or it is disabledThe claude.googleapis.com API is not enabled on the project LiteLLM called, which the message names. Check vertex_project, api_base and their environment variables point at the subscribed project.
403, other messagesThe identity lacks roles/claude.user on the project.
404 not_found_errorThe model is not available to your Anthropic organization.
LiteLLM Enterprise
SSO/SAML, audit logs, spend tracking, multi-team management, and guardrails, built for production.
Learn more →