Claude Platform Docs
MessagesClaude on cloud platforms

Claude on Google Cloud

Anthropic's Claude models are available through Google Cloud's Agent Platform.

The API for accessing Claude on Google Cloud's Agent Platform is nearly identical to the Messages API, with two key differences in request format:

  • On Agent Platform, model is not passed in the request body. Instead, it is specified in the Google Cloud endpoint URL.
  • On Agent Platform, anthropic_version is passed in the request body (rather than as a header), and must be set to the value vertex-2023-10-16.

Agent Platform is also supported by Anthropic's official client SDKs. This guide walks you through making a request to Claude on Agent Platform using one of Anthropic's client SDKs.

Note that this guide assumes you already have a Google Cloud project that is able to use Agent Platform. See Anthropic Claude models on Agent Platform for more information on the setup required and a full walkthrough.

Install an SDK for accessing Agent Platform

First, install Anthropic's client SDK for your language of choice.

pip install -U "anthropic[vertex]"

Accessing Agent Platform

Model availability

Note that Anthropic model availability varies by region. Search for "Claude" in the Model Garden or go to Anthropic Claude models for the latest information.

API model IDs

Lifecycle terms (Deprecated, Retired) are defined in Model deprecations. Lifecycle dates on partner-operated platforms are set by the partner and can differ from the Claude API schedule. For the current retirement date of any model on Agent Platform, see Google Cloud's documentation for Claude models on Agent Platform.

ModelAgent Platform API model ID
Claude Fable 5.1
Claude Fable 5
Claude Opus 5
Claude Opus 4.8
Claude Opus 4.7
Claude Opus 4.6
Claude Sonnet 5claude-sonnet-5
Claude Sonnet 4.6
Claude Sonnet 4.5
Claude Sonnet 4
Deprecated.
Claude Sonnet 3.7
Retired.
Claude Opus 4.5
Claude Opus 4.1
Deprecated.
Claude Opus 4
Deprecated.
Claude Haiku 4.5
Claude Haiku 3.5
Deprecated.

Making requests

Before running requests you might need to run gcloud auth application-default login to authenticate with Google Cloud.

The following examples show how to generate text from Claude on Agent Platform:

from anthropic import AnthropicVertex

project_id = "MY_PROJECT_ID"
region = "global"

client = AnthropicVertex(project_id=project_id, region=region)

message = client.messages.create(
    model="claude-opus-5",
    max_tokens=100,
    messages=[
        {
            "role": "user",
            "content": "Hey Claude!",
        }
    ],
)
print(message)

See the client SDKs and the official Agent Platform docs for more details.

Claude is also available through Amazon Bedrock, Claude Platform on AWS, and Microsoft Foundry.

Data retention

Data handling for this offering is governed by Google Cloud. For details, see Agent Platform and zero data retention.

Activity logging

Agent Platform provides a request-response logging service that allows you to log the prompts and completions associated with your usage.

Anthropic recommends that you log your activity on at least a 30-day rolling basis to understand your activity and investigate any potential misuse.

Feature support

For the full feature list with Google Cloud availability, see Features overview.

Supported feature highlights

Features not supported

  • Input sources (URL sources for images and documents, Files API)
  • Server-side tools (code execution, web fetch, advisor)
  • Agent infrastructure (Agent Skills, MCP connector, programmatic tool calling)
  • API endpoints (Message Batches, Models, Admin, Compliance, Usage and Cost)
  • Claude Managed Agents
  • Server-side fallback (the fallbacks parameter; use the client-side fallback pattern instead)

Context window

Claude Fable 5.1, Claude Fable 5, Claude Opus 5, Claude Opus 4.8, Claude Opus 4.7, Claude Opus 4.6, Claude Sonnet 5, and Claude Sonnet 4.6 have a 1M-token context window on Agent Platform. Other Claude models, including Sonnet 4.5 and Sonnet 4 (deprecated), have a 200k-token context window.

Agent Platform limits request payloads to 30 MB. When sending large documents or many images, you might reach this limit before the token limit.

Global, multi-region, and regional endpoints

Agent Platform offers three endpoint types:

  • Global endpoints: Dynamic routing for maximum availability
  • Multi-region endpoints: Dynamic routing within a geographic area (for example, the United States or the European Union) for data residency with high availability
  • Regional endpoints: Guaranteed data routing through specific geographic regions

Regional and multi-region endpoints include a 10% pricing premium over global endpoints.

When to use each option

Global endpoints (recommended):

  • Provide maximum availability and uptime
  • Dynamically route requests to regions with available capacity
  • No pricing premium
  • Best for applications where data residency is flexible
  • Only supports pay-as-you-go traffic (provisioned throughput requires regional endpoints)

Multi-region endpoints:

  • Dynamically route requests across regions within a geographic area (currently us and eu)
  • Useful when you need data residency within a broad geography but want higher availability than a single region
  • 10% pricing premium over global endpoints
  • Only supports pay-as-you-go traffic (provisioned throughput requires regional endpoints)

Regional endpoints:

  • Route traffic through specific geographic regions
  • Required for single-region data residency, strict compliance mandates, or provisioned throughput
  • Support both pay-as-you-go and provisioned throughput
  • 10% pricing premium reflects infrastructure costs for dedicated regional capacity

Implementation

Using global endpoints (recommended):

Set the region parameter to "global" when initializing the client:

from anthropic import AnthropicVertex

project_id = "MY_PROJECT_ID"
region = "global"

client = AnthropicVertex(project_id=project_id, region=region)

message = client.messages.create(
    model="claude-opus-5",
    max_tokens=100,
    messages=[
        {
            "role": "user",
            "content": "Hey Claude!",
        }
    ],
)
print(message)

Using multi-region endpoints:

Set the region parameter to a multi-region identifier: "us" for the United States or "eu" for the European Union. The SDK routes requests to the corresponding multi-region endpoint (https://aiplatform.us.rep.googleapis.com or https://aiplatform.eu.rep.googleapis.com), which dynamically balances traffic across regions within that geography.

from anthropic import AnthropicVertex

project_id = "MY_PROJECT_ID"
region = "us"  # Multi-region identifier: "us" or "eu"

client = AnthropicVertex(project_id=project_id, region=region)

message = client.messages.create(
    model="claude-opus-5",
    max_tokens=100,
    messages=[
        {
            "role": "user",
            "content": "Hey Claude!",
        }
    ],
)
print(message)

Using regional endpoints:

Specify a specific region such as "us-east5" or "europe-west1":

from anthropic import AnthropicVertex

project_id = "MY_PROJECT_ID"
region = "us-east5"  # Specify a specific region

client = AnthropicVertex(project_id=project_id, region=region)

message = client.messages.create(
    # Specific regional endpoints support Claude Sonnet 4.6 and earlier; newer models use the global or multi-region endpoints
    model="claude-sonnet-4-6",
    max_tokens=100,
    messages=[
        {
            "role": "user",
            "content": "Hey Claude!",
        }
    ],
)
print(message)

Additional resources

Was this page helpful?