Claude on Google Cloud (Anthropic managed)
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.
| Property | Details |
|---|---|
| Provider route | anthropic_google_cloud/ |
| Supported endpoints | /chat/completions, /messages, /responses |
| Auth | Google Cloud credentials (service account key or application default credentials) |
| Cost tracking | Yes, at the Claude API prices |
Prerequisites
- In your Google Cloud project, subscribe to Claude Models on Google Cloud (Anthropic managed) in Google Cloud Marketplace, enable the
claude.googleapis.comandanthropic-managed-claude.cloudpartnerservices.googservices on every project that calls the API, and activate the Anthropic organization from the console. Anthropic's setup guide walks through each step. - Grant the identity LiteLLM runs as the
roles/claude.userrole on the project. - Copy your workspace ID from the Claude Console under Settings > Workspaces. It starts with
wrkspc_.
Parameters
| Parameter | Environment variable | Description |
|---|---|---|
vertex_credentials | GOOGLE_APPLICATION_CREDENTIALS | Path to a service account key file, or the key's JSON. Application default credentials are used when neither is set. |
vertex_project | ANTHROPIC_GOOGLE_CLOUD_PROJECT | Google 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_id | ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID | Claude workspace ID. Required unless api_base is set. |
api_base | ANTHROPIC_GOOGLE_CLOUD_BASE_URL | Full .../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_key | A 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
- SDK
- AI Gateway
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)
1. Add to config.yaml
model_list:
- model_name: claude-opus-gcp
litellm_params:
model: anthropic_google_cloud/claude-opus-5
vertex_credentials: os.environ/GOOGLE_APPLICATION_CREDENTIALS
vertex_project: my-gcp-project
workspace_id: os.environ/ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID
2. Start LiteLLM AI Gateway
litellm --config /path/to/config.yaml
3. Call it on any of the three endpoints
curl http://0.0.0.0:4000/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"model": "claude-opus-gcp",
"messages": [{"role": "user", "content": "Write a haiku about the sea."}]
}'
curl http://0.0.0.0:4000/v1/messages \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"model": "claude-opus-gcp",
"max_tokens": 1024,
"messages": [{"role": "user", "content": "Write a haiku about the sea."}]
}'
curl http://0.0.0.0:4000/v1/responses \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $LITELLM_API_KEY" \
-d '{
"model": "claude-opus-gcp",
"input": "Write a haiku about the sea."
}'
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
| Status | Meaning |
|---|---|
400 too many total text bytes | The request's text is larger than 32 MB. |
| 401 | No 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 disabled | The 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 messages | The identity lacks roles/claude.user on the project. |
404 not_found_error | The model is not available to your Anthropic organization. |