The two sides of this change are more than 400 edits apart, too far apart to line up, so this is the differ's own diff of it and the words inside a line are not marked.
from line 1
11---
2title: Claude on Google Cloud
3url: https://platform.claude.com/docs/en/build-with-claude/claude-on-vertex-ai
4description: Anthropic's Claude models are available through [Google Cloud's Agent Platform](https://cloud.google.com/vertex-ai).
2title: Claude Models on Google Cloud (Google managed)
3url: https://platform.claude.com/docs/en/build-with-claude/claude-models-on-google-cloud/google-managed
4description: Google operates Claude Models on Google Cloud (Google managed) as part of Google Cloud's Agent Platform. You can call Claude with Anthropic's client SDKs.
55---
66
7The API for accessing Claude on Google Cloud's Agent Platform is nearly identical to the [Messages API](https://platform.claude.com/docs/en/api/messages/create), with two key differences in request format:
8
9* On Agent Platform, `model` is not passed in the request body. Instead, it is specified in the Google Cloud endpoint URL.
10* 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`, or to [API version `2026-10-21`](https://platform.claude.com/docs/en/api/migration-2026-10-21).
11
12Agent Platform is also supported by Anthropic's official [client SDKs](https://platform.claude.com/docs/en/cli-sdks-libraries/overview). This guide walks you through making a request to Claude on Agent Platform using one of Anthropic's client SDKs.
13
14Note 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](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/partner-models/claude) for more information on the setup required and a full walkthrough.
15
16## Install an SDK for accessing Agent Platform
17
18First, install Anthropic's [client SDK](https://platform.claude.com/docs/en/cli-sdks-libraries/overview) for your language of choice.
7[Claude Models on Google Cloud](https://platform.claude.com/docs/en/build-with-claude/claude-models-on-google-cloud/overview) compares the two Google Cloud offerings. It also shows how to tell which one you use.
8
9## Before making API calls
10
11To use Claude Models on Google Cloud (Google managed), you need:
12
131. A Google Cloud project that can use Agent Platform. For setup steps, see Google Cloud's [Anthropic Claude models on Agent Platform](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/partner-models/claude) page.
142. The [gcloud CLI](https://cloud.google.com/sdk/docs/install) installed, for local development.
153. For the identity making the calls, an IAM role that includes the `aiplatform.endpoints.predict` permission, such as Agent Platform User (`roles/aiplatform.user`). For details, see Google Cloud's [Agent Platform partner models](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/partner-models/use-partner-models) page.
164. Google Cloud credentials for that identity. For the SDK examples, you might need to run `gcloud auth application-default login` to authenticate with Google Cloud. The cURL examples for Claude Models on Google Cloud (Google managed) get their token with `gcloud auth print-access-token`. That command uses the gcloud CLI's own login, not Application Default Credentials. For those examples, run `gcloud auth login` or `gcloud init` first.
17
18### Install an SDK
19
20Anthropic's [client SDKs](https://platform.claude.com/docs/en/cli-sdks-libraries/overview) support Claude Models on Google Cloud (Google managed) through `AnthropicVertex` (csharp: `AnthropicVertexClient`; go: `vertex.WithGoogleAuth`; java: `VertexBackend`; php: `Anthropic\Vertex\Client`; ruby: `Anthropic::VertexClient`). Install the package that provides it:
1921
2022<Tabs>
2123 <Tab title="Python">
from line 63
6163 <version>3.1.0</version>
6264 </dependency>
6365 ```
64
65 ```java Java
66 import com.anthropic.client.AnthropicClient;
67 import com.anthropic.client.okhttp.AnthropicOkHttpClient;
68 import com.anthropic.models.messages.Message;
69 import com.anthropic.models.messages.MessageCreateParams;
70 import com.anthropic.models.messages.Model;
71 import com.anthropic.vertex.backends.VertexBackend;
72 import com.google.auth.oauth2.GoogleCredentials;
73
74 void main() throws Exception {
75 AnthropicClient client = AnthropicOkHttpClient.builder()
76 .backend(
77 VertexBackend.builder()
78 .googleCredentials(GoogleCredentials.getApplicationDefault())
79 .region("global")
80 .project("MY_PROJECT_ID")
81 .build()
82 )
83 .build();
84
85 MessageCreateParams params = MessageCreateParams.builder()
86 .model(Model.CLAUDE_OPUS_5_5)
87 .maxTokens(1024L)
88 .addUserMessage("What is the capital of France?")
89 .build();
90
91 Message response = client.messages().create(params);
92 response.content().stream()
93 .flatMap(block -> block.text().stream())
94 .forEach(textBlock -> IO.println(textBlock.text()));
95 }
96 ```
9766 </CodeGroup>
9867 </Tab>
9968
from line 81
11281 </Tab>
11382</Tabs>
11483
115## Accessing Agent Platform
116
117### Model availability
118
119Note that Anthropic model availability varies by region. Search for "Claude" in the [Model Garden](https://cloud.google.com/model-garden) or go to [Anthropic Claude models](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/partner-models/claude) for the latest information.
120
121#### API model IDs
122
123Lifecycle terms (Deprecated, Retired) are defined in [Model deprecations](https://platform.claude.com/docs/en/about-claude/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](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/partner-models/claude).
84The `ant` CLI doesn't support Claude Models on Google Cloud (Google managed).
85
86## Making requests
87
88Requests to Claude Models on Google Cloud (Google managed) go to an Agent Platform endpoint URL that ends in `:rawPredict`. Streaming requests use `:streamRawPredict` instead.
89
90A request is nearly identical to a [Messages API](https://platform.claude.com/docs/en/api/messages/create) request. It differs in two main ways:
91
92* **Model:** The endpoint URL names the model. In a cURL request, leave `model` out of the body.
93* **Version:** In a cURL request, pass `anthropic_version` in the body, not as a header. Set it to `vertex-2023-10-16`, or to [API version `2026-10-21`](https://platform.claude.com/docs/en/api/migration-2026-10-21).
94
95The following examples use the global endpoint. For the other endpoint types, see [Global, multi-region, and regional endpoints](https://platform.claude.com/docs/en/build-with-claude/claude-models-on-google-cloud/google-managed#global-multi-region-and-regional-endpoints).
96
97<CodeGroup exclude="shell:CLI">
98 ```bash cURL
99 curl https://aiplatform.googleapis.com/v1/projects/MY_PROJECT_ID/locations/global/publishers/anthropic/models/claude-opus-5-5:rawPredict \
100 -H "Authorization: Bearer $(gcloud auth print-access-token)" \
101 -H "Content-Type: application/json" \
102 -d '{
103 "anthropic_version": "vertex-2023-10-16",
104 "messages": [{"role": "user", "content": "Hey Claude!"}],
105 "max_tokens": 100
106 }'
107 ```
108
109 <CodeGroupItem language="CLI">
110 The `ant` CLI doesn't support Claude Models on Google Cloud (Google managed).
111 </CodeGroupItem>
112
113 ```python Python
114 from anthropic import AnthropicVertex
115
116 project_id = "MY_PROJECT_ID"
117 region = "global"
118
119 client = AnthropicVertex(project_id=project_id, region=region)
120
121 message = client.messages.create(
122 model="claude-opus-5-5",
123 max_tokens=100,
124 messages=[
125 {
126 "role": "user",
127 "content": "Hey Claude!",
128 }
129 ],
130 )
131 print(message)
132 ```
133
134 ```typescript TypeScript
135 import { AnthropicVertex } from "@anthropic-ai/vertex-sdk";
136
137 const projectId = "MY_PROJECT_ID";
138 const region = "global";
139
140 // Goes through the standard `google-auth-library` flow.
141 const client = new AnthropicVertex({
142 projectId,
143 region
144 });
145
146 const result = await client.messages.create({
147 model: "claude-opus-5-5",
148 max_tokens: 100,
149 messages: [
150 {
151 role: "user",
152 content: "Hey Claude!"
153 }
154 ]
155 });
156 console.log(JSON.stringify(result, null, 2));
157 ```
158
159 ```csharp C#
160 using Anthropic.Models.Messages;
161 using Anthropic.Vertex;
162
163 var projectId = "MY_PROJECT_ID";
164 var region = "global";
165
166 var client = new AnthropicVertexClient(new AnthropicVertexCredentials(region, projectId));
167
168 var parameters = new MessageCreateParams
169 {
170 Model = Model.ClaudeOpus5_5,
171 MaxTokens = 100,
172 Messages = [new UserMessageParam { Content = "Hey Claude!" }]
173 };
174
175 var message = await client.Messages.Create(parameters);
176 Console.WriteLine(message);
177 ```
178
179 ```go Go
180 import (
181 "context"
182 "fmt"
183
184 "github.com/anthropics/anthropic-sdk-go/v2"
185 "github.com/anthropics/anthropic-sdk-go/v2/vertex"
186 )
187 // ...
188 // Uses default Google Cloud credentials
189 client := anthropic.NewClient(
190 vertex.WithGoogleAuth(context.Background(), "global", "MY_PROJECT_ID"),
191 )
192
193 message, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
194 Model: anthropic.ModelClaudeOpus5_5,
195 MaxTokens: 100,
196 Messages: []anthropic.MessageParam{
197 anthropic.NewUserMessage(anthropic.NewTextBlock("Hey Claude!")),
198 },
199 })
200 if err != nil {
201 panic(err)
202 }
203 fmt.Printf("%+v\n", message)
204 ```
205
206 ```java Java
207 import com.anthropic.client.AnthropicClient;
208 import com.anthropic.client.okhttp.AnthropicOkHttpClient;
209 import com.anthropic.models.messages.Message;
210 import com.anthropic.models.messages.MessageCreateParams;
211 import com.anthropic.models.messages.Model;
212 import com.anthropic.vertex.backends.VertexBackend;
213 import com.google.auth.oauth2.GoogleCredentials;
214
215 void main() throws Exception {
216 AnthropicClient client = AnthropicOkHttpClient.builder()
217 .backend(
218 VertexBackend.builder()
219 .googleCredentials(GoogleCredentials.getApplicationDefault())
220 .region("global")
221 .project("MY_PROJECT_ID")
222 .build()
223 )
224 .build();
225
226 Message message = client
227 .messages()
228 .create(
229 MessageCreateParams.builder()
230 .model(Model.CLAUDE_OPUS_5_5)
231 .maxTokens(100)
232 .addUserMessage("Hey Claude!")
233 .build()
234 );
235
236 IO.println(message);
237 }
238 ```
239
240 ```php PHP
241 <?php
242
243 use Anthropic\Messages\TextBlock;
244 use Anthropic\Vertex;
245
246 $client = Vertex\Client::fromEnvironment(
247 region: 'global',
248 projectId: 'MY_PROJECT_ID',
249 );
250
251 $message = $client->messages->create(
252 maxTokens: 100,
253 messages: [
254 ['role' => 'user', 'content' => 'Hey Claude!']
255 ],
256 model: 'claude-opus-5-5',
257 );
258
259 foreach ($message->content as $block) {
260 if ($block instanceof TextBlock) {
261 echo $block->text . PHP_EOL;
262 }
263 }
264 ```
265
266 ```ruby Ruby
267 require "anthropic"
268
269 client = Anthropic::VertexClient.new(
270 region: "global",
271 project_id: "MY_PROJECT_ID"
272 )
273
274 message = client.messages.create(
275 model: "claude-opus-5-5",
276 max_tokens: 100,
277 messages: [{role: "user", content: "Hey Claude!"}]
278 )
279
280 puts message.content.find { it.type == :text }.text
281 ```
282</CodeGroup>
283
284### API model IDs
124285
125286| Model | Agent Platform API model ID |
126287| :---------------------------------------------------------------------------------------------------- | :--------------------------- |
from line 306
145306| Claude Haiku 4.5 | `claude-haiku-4-5@20251001` |
146307| Claude Haiku 3.5 ([deprecated](https://platform.claude.com/docs/en/about-claude/model-deprecations)) | `claude-3-5-haiku@20241022` |
147308
309Claude Models on Google Cloud (Google managed) offers different Claude models in different regions. To check which models a region offers, search "Claude" in [Model Garden](https://cloud.google.com/model-garden) or see Google Cloud's [Anthropic Claude models on Agent Platform](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/partner-models/claude) page.
310
311Google sets the lifecycle dates for the models that Claude Models on Google Cloud (Google managed) serves. These dates can differ from the Claude API schedule. For a model's current retirement date, see Google Cloud's [Anthropic Claude models on Agent Platform](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/partner-models/claude) page. For what Deprecated and Retired mean, see [Model deprecations](https://platform.claude.com/docs/en/about-claude/model-deprecations).
312
313<Note>
314 Claude Mythos Preview is a research preview. Claude Models on Google Cloud (Google managed) offers it to invited customers. For more information, see [Project Glasswing](https://anthropic.com/glasswing).
315</Note>
316
148317<Tip>
149318 Upgrading to a newer Claude model? The [Claude API skill](https://platform.claude.com/docs/en/agents-and-tools/agent-skills/claude-api-skill#migrating-to-a-newer-claude-model) in Claude Code applies model ID swaps and breaking parameter changes across your code base:
150319
from line 326
157326 The skill detects which cloud platform your code targets and adjusts model ID formats and feature changes for that platform.
158327</Tip>
159328
160### Making requests
161
162Before running requests you might need to run `gcloud auth application-default login` to authenticate with Google Cloud.
163
164The following examples show how to generate text from Claude on Agent Platform:
329## Global, multi-region, and regional endpoints
330
331Claude Models on Google Cloud (Google managed) offers three endpoint types. You choose one with the region value you pass when you create the client. In a cURL request, the endpoint type sets the host and the `locations` segment of the URL.
332
333| Endpoint type | Region value | Host |
334| ------------------------ | ------------------------------ | -------------------------------------------------------------------------- |
335| **Global** (recommended) | `"global"` | `aiplatform.googleapis.com` |
336| **Multi-region** | `"us"` or `"eu"` | `aiplatform.us.rep.googleapis.com`<br />`aiplatform.eu.rep.googleapis.com` |
337| **Regional** | A region, such as `"us-east5"` | `{region}-aiplatform.googleapis.com` |
338
339The endpoint types differ in where they send requests:
340
341* **Global:** Requests go to any region with available capacity. Use it when you want maximum availability and data residency is flexible.
342* **Multi-region:** Requests go to any region in the United States (`"us"`) or the European Union (`"eu"`). Use it when you need data residency within a broad geography and higher availability than a single region.
343* **Regional:** Requests go only to the region you name, such as `"us-east5"` or `"europe-west1"`. Use it when you need single-region data residency or must meet strict compliance mandates.
344
345Multi-region and regional endpoints cost 10% more than global endpoints. All three endpoint types take pay-as-you-go traffic, and provisioned throughput needs a regional endpoint.
346
347Regional endpoints serve Claude Sonnet 4.6 and earlier models only. For newer models, use a global or multi-region endpoint.
348
349<Note>
350 The premium for multi-region and regional endpoints applies only to Claude Sonnet 4.5 (deprecated) and later models. For the models that keep their earlier pricing, see [Cloud platform pricing](https://platform.claude.com/docs/en/about-claude/pricing#cloud-platform-pricing). For regional endpoints, the premium reflects infrastructure costs for dedicated regional capacity.
351</Note>
352
353The following examples use the `us` multi-region endpoint. The highlighted lines set the region. For a full request on the global endpoint, see [Making requests](https://platform.claude.com/docs/en/build-with-claude/claude-models-on-google-cloud/google-managed#accessing-vertex-ai).
165354
166355<CodeGroup exclude="shell:CLI">
167356 ```bash cURL
168 curl https://aiplatform.googleapis.com/v1/projects/MY_PROJECT_ID/locations/global/publishers/anthropic/models/claude-opus-5-5:rawPredict \
169 -H "Authorization: Bearer $(gcloud auth print-access-token)" \
170 -H "Content-Type: application/json" \
171 -d '{
172 "anthropic_version": "vertex-2023-10-16",
173 "messages": [{"role": "user", "content": "Hey Claude!"}],
174 "max_tokens": 100
175 }'
176 ```
177
178 <CodeGroupItem language="CLI">
179 The `ant` CLI doesn't support Agent Platform.
180 </CodeGroupItem>
181
182 ```python Python
183 from anthropic import AnthropicVertex
184
185 project_id = "MY_PROJECT_ID"
186 region = "global"
187
188 client = AnthropicVertex(project_id=project_id, region=region)
189
190 message = client.messages.create(
191 model="claude-opus-5-5",
192 max_tokens=100,
193 messages=[
194 {
195 "role": "user",
196 "content": "Hey Claude!",
197 }
198 ],
199 )
200 print(message)
201 ```
202
203 ```typescript TypeScript
204 import { AnthropicVertex } from "@anthropic-ai/vertex-sdk";
205
206 const projectId = "MY_PROJECT_ID";
207 const region = "global";
208
209 // Goes through the standard `google-auth-library` flow.
210 const client = new AnthropicVertex({
211 projectId,
212 region
213 });
214
215 const result = await client.messages.create({
216 model: "claude-opus-5-5",
217 max_tokens: 100,
218 messages: [
219 {
220 role: "user",
221 content: "Hey Claude!"
222 }
223 ]
224 });
225 console.log(JSON.stringify(result, null, 2));
226 ```
227
228 ```csharp C#
229 using Anthropic.Models.Messages;
230 using Anthropic.Vertex;
231
232 var projectId = "MY_PROJECT_ID";
233 var region = "global";
234
235 var client = new AnthropicVertexClient(new AnthropicVertexCredentials(region, projectId));
236
237 var parameters = new MessageCreateParams
238 {
239 Model = Model.ClaudeOpus5_5,
240 MaxTokens = 100,
241 Messages = [new UserMessageParam { Content = "Hey Claude!" }]
242 };
243
244 var message = await client.Messages.Create(parameters);
245 Console.WriteLine(message);
246 ```
247
248 ```go Go
249 import (
250 "context"
251 "fmt"
252
253 "github.com/anthropics/anthropic-sdk-go/v2"
254 "github.com/anthropics/anthropic-sdk-go/v2/vertex"
255 )
256 // ...
257 // Uses default Google Cloud credentials
258 client := anthropic.NewClient(
259 vertex.WithGoogleAuth(context.Background(), "global", "MY_PROJECT_ID"),
260 )
261
262 message, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
263 Model: anthropic.ModelClaudeOpus5_5,
264 MaxTokens: 100,
265 Messages: []anthropic.MessageParam{
266 anthropic.NewUserMessage(anthropic.NewTextBlock("Hey Claude!")),
267 },
268 })
269 if err != nil {
270 panic(err)
271 }
272 fmt.Printf("%+v\n", message)
273 ```
274
275 ```java Java
276 import com.anthropic.client.AnthropicClient;
277 import com.anthropic.client.okhttp.AnthropicOkHttpClient;
278 import com.anthropic.models.messages.Message;
279 import com.anthropic.models.messages.MessageCreateParams;
280 import com.anthropic.models.messages.Model;
281 import com.anthropic.vertex.backends.VertexBackend;
282 import com.google.auth.oauth2.GoogleCredentials;
283
284 void main() throws Exception {
285 AnthropicClient client = AnthropicOkHttpClient.builder()
286 .backend(
287 VertexBackend.builder()
288 .googleCredentials(GoogleCredentials.getApplicationDefault())
289 .region("global")
290 .project("MY_PROJECT_ID")
291 .build()
292 )
293 .build();
294
295 Message message = client
296 .messages()
297 .create(
298 MessageCreateParams.builder()
299 .model(Model.CLAUDE_OPUS_5_5)
300 .maxTokens(100)
301 .addUserMessage("Hey Claude!")
302 .build()
303 );
304
305 IO.println(message);
306 }
307 ```
308
309 ```php PHP
310 <?php
311
312 use Anthropic\Vertex;
313
314 $client = Vertex\Client::fromEnvironment(
315 region: 'global',
316 projectId: 'MY_PROJECT_ID',
317 );
318
319 $message = $client->messages->create(
320 maxTokens: 100,
321 messages: [
322 ['role' => 'user', 'content' => 'Hey Claude!']
323 ],
324 model: 'claude-opus-5-5',
325 );
326 $textBlock = array_find($message->content, static fn ($block): bool => $block->type === 'text');
327 echo $textBlock->text;
328 ```
329
330 ```ruby Ruby
331 require "anthropic"
332
333 client = Anthropic::VertexClient.new(
334 region: "global",
335 project_id: "MY_PROJECT_ID"
336 )
337
338 message = client.messages.create(
339 model: "claude-opus-5-5",
340 max_tokens: 100,
341 messages: [{role: "user", content: "Hey Claude!"}]
342 )
343
344 puts message.content.find { it.type == :text }.text
345 ```
346</CodeGroup>
347
348See the [client SDKs](https://platform.claude.com/docs/en/cli-sdks-libraries/overview) and the official [Agent Platform docs](https://cloud.google.com/vertex-ai/docs) for more details.
349
350Claude is also available through [Amazon Bedrock](https://platform.claude.com/docs/en/build-with-claude/claude-in-amazon-bedrock), [Claude Platform on AWS](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws), and [Microsoft Foundry](https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry).
351
352## Data retention
353
354Data handling for this offering is governed by Google Cloud. For details, see [Agent Platform and zero data retention](https://cloud.google.com/vertex-ai/generative-ai/docs/data-governance).
355
356## Activity logging
357
358Agent Platform provides a [request-response logging service](https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/request-response-logging) that allows you to log the prompts and completions associated with your usage.
359
360Anthropic recommends that you log your activity on at least a 30-day rolling basis to understand your activity and investigate any potential misuse.
361
362<Note>
363 Turning on this service does not give Google or Anthropic any access to your content.
364</Note>
365
366## Feature support
367
368For the full feature list with Google Cloud availability, see [Features overview](https://platform.claude.com/docs/en/build-with-claude/overview).
369
370### Supported feature highlights
371
372* [Messages API](https://platform.claude.com/docs/en/api/messages/create)
373* [Prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching)
374* [Thinking](https://platform.claude.com/docs/en/build-with-claude/thinking)
375* [Tool use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview), including the [Bash tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/bash-tool), [Browser use tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/browser-use-tool), [Computer use tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool), [Memory tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-tool), and [Text editor tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/text-editor-tool)
376* [Web search tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool)
377* [Citations](https://platform.claude.com/docs/en/build-with-claude/citations)
378* [Structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
379
380### Features not supported
381
382* Input sources (URL sources for images and documents, Files API)
383* Server-side tools (code execution, web fetch, advisor)
384* Agent infrastructure (Agent Skills, MCP connector, programmatic tool calling)
385* API endpoints (Message Batches, Models, Admin, Compliance, Usage and Cost)
386* Claude Managed Agents
387* Server-side fallback (the [`fallbacks` parameter](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#server-side-fallback); use the [client-side fallback pattern](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#client-side-fallback) instead)
388
389### Context window
390
391Claude Fable 5.1, Claude Fable 5, Claude Opus 5.5, Claude Opus 5, Claude Opus 4.8, Claude Opus 4.7, Claude Opus 4.6, Claude Sonnet 5.5, Claude Sonnet 5, Claude Sonnet 4.6, and Claude Haiku 5.5 have a [1M-token context window](https://platform.claude.com/docs/en/build-with-claude/context-windows) on Agent Platform. Other Claude models, including Sonnet 4.5 (deprecated) and Sonnet 4 (deprecated), have a 200k-token context window.
392
393Agent Platform limits request payloads to 30 MB. When sending large documents or many images, you might reach this limit before the token limit.
394
395## Global, multi-region, and regional endpoints
396
397Agent Platform offers three endpoint types:
398
399* **Global endpoints:** Dynamic routing for maximum availability
400* **Multi-region endpoints:** Dynamic routing within a geographic area (for example, the United States or the European Union) for data residency with high availability
401* **Regional endpoints:** Guaranteed data routing through specific geographic regions
402
403Regional and multi-region endpoints include a 10 percent pricing premium over global endpoints.
404
405<Note>
406 This applies to Claude Sonnet 4.5 (deprecated) and future models only. Older models (Claude Sonnet 4 (deprecated), Opus 4 (deprecated), and earlier) maintain their existing pricing structures.
407</Note>
408
409### When to use each option
410
411**Global endpoints (recommended):**
412
413* Provide maximum availability and uptime
414* Dynamically route requests to regions with available capacity
415* Carry no pricing premium
416* Work best for applications where data residency is flexible
417* Only support pay-as-you-go traffic (provisioned throughput requires regional endpoints)
418
419**Multi-region endpoints:**
420
421* Dynamically route requests across regions within a geographic area (currently `us` and `eu`)
422* Are useful when you need data residency within a broad geography but want higher availability than a single region
423* Carry a 10 percent pricing premium over global endpoints
424* Only support pay-as-you-go traffic (provisioned throughput requires regional endpoints)
425
426**Regional endpoints:**
427
428* Route traffic through specific geographic regions
429* Are required for single-region data residency, strict compliance mandates, or provisioned throughput
430* Support both pay-as-you-go and provisioned throughput
431* Carry a 10 percent pricing premium that reflects infrastructure costs for dedicated regional capacity
432
433### Implementation
434
435**Using global endpoints (recommended):**
436
437Set the `region` parameter to `"global"` when initializing the client:
438
439<CodeGroup exclude="shell:CLI">
440 ```bash cURL
441 curl https://aiplatform.googleapis.com/v1/projects/MY_PROJECT_ID/locations/global/publishers/anthropic/models/claude-opus-5-5:rawPredict \
442 -H "Authorization: Bearer $(gcloud auth print-access-token)" \
443 -H "Content-Type: application/json" \
444 -d '{
445 "anthropic_version": "vertex-2023-10-16",
446 "messages": [{"role": "user", "content": "Hey Claude!"}],
447 "max_tokens": 100
448 }'
449 ```
450
451 <CodeGroupItem language="CLI">
452 The `ant` CLI doesn't support Agent Platform.
453 </CodeGroupItem>
454
455 ```python Python
456 from anthropic import AnthropicVertex
457
458 project_id = "MY_PROJECT_ID"
459 region = "global"
460
461 client = AnthropicVertex(project_id=project_id, region=region)
462
463 message = client.messages.create(
464 model="claude-opus-5-5",
465 max_tokens=100,
466 messages=[
467 {
468 "role": "user",
469 "content": "Hey Claude!",
470 }
471 ],
472 )
473 print(message)
474 ```
475
476 ```typescript TypeScript
477 import { AnthropicVertex } from "@anthropic-ai/vertex-sdk";
478
479 const projectId = "MY_PROJECT_ID";
480 const region = "global";
481
482 const client = new AnthropicVertex({
483 projectId,
484 region
485 });
486
487 const result = await client.messages.create({
488 model: "claude-opus-5-5",
489 max_tokens: 100,
490 messages: [
491 {
492 role: "user",
493 content: "Hey Claude!"
494 }
495 ]
496 });
497 console.log(JSON.stringify(result, null, 2));
498 ```
499
500 ```csharp C#
501 using Anthropic.Models.Messages;
502 using Anthropic.Vertex;
503
504 var projectId = "MY_PROJECT_ID";
505 var region = "global";
506
507 var client = new AnthropicVertexClient(new AnthropicVertexCredentials(region, projectId));
508
509 var parameters = new MessageCreateParams
510 {
511 Model = Model.ClaudeOpus5_5,
512 MaxTokens = 100,
513 Messages = [new UserMessageParam { Content = "Hey Claude!" }]
514 };
515
516 var message = await client.Messages.Create(parameters);
517 Console.WriteLine(message);
518 ```
519
520 ```go Go
521 import (
522 "context"
523 "fmt"
524
525 "github.com/anthropics/anthropic-sdk-go/v2"
526 "github.com/anthropics/anthropic-sdk-go/v2/vertex"
527 )
528 // ...
529 // Uses default Google Cloud credentials
530 client := anthropic.NewClient(
531 vertex.WithGoogleAuth(context.Background(), "global", "MY_PROJECT_ID"),
532 )
533
534 message, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
535 Model: anthropic.ModelClaudeOpus5_5,
536 MaxTokens: 100,
537 Messages: []anthropic.MessageParam{
538 anthropic.NewUserMessage(anthropic.NewTextBlock("Hey Claude!")),
539 },
540 })
541 if err != nil {
542 panic(err)
543 }
544 fmt.Printf("%+v\n", message)
545 ```
546
547 ```java Java
548 import com.anthropic.client.AnthropicClient;
549 import com.anthropic.client.okhttp.AnthropicOkHttpClient;
550 import com.anthropic.models.messages.MessageCreateParams;
551 import com.anthropic.models.messages.Model;
552 import com.anthropic.vertex.backends.VertexBackend;
553 import com.google.auth.oauth2.GoogleCredentials;
554
555 void main() throws Exception {
556 AnthropicClient client = AnthropicOkHttpClient.builder()
557 .backend(
558 VertexBackend.builder()
559 .googleCredentials(GoogleCredentials.getApplicationDefault())
560 .region("global")
561 .project("MY_PROJECT_ID")
562 .build()
563 )
564 .build();
565
566 var message = client
567 .messages()
568 .create(
569 MessageCreateParams.builder()
570 .model(Model.CLAUDE_OPUS_5_5)
571 .maxTokens(100)
572 .addUserMessage("Hey Claude!")
573 .build()
574 );
575
576 IO.println(message);
577 }
578 ```
579
580 ```php PHP
581 <?php
582
583 use Anthropic\Vertex;
584
585 $client = Vertex\Client::fromEnvironment(
586 region: 'global',
587 projectId: 'MY_PROJECT_ID',
588 );
589
590 $message = $client->messages->create(
591 maxTokens: 100,
592 messages: [
593 ['role' => 'user', 'content' => 'Hey Claude!']
594 ],
595 model: 'claude-opus-5-5',
596 );
597
598 $textBlock = array_find($message->content, static fn ($block): bool => $block->type === 'text');
599 echo $textBlock->text;
600 ```
601
602 ```ruby Ruby
603 require "anthropic"
604
605 client = Anthropic::VertexClient.new(
606 region: "global",
607 project_id: "MY_PROJECT_ID"
608 )
609
610 message = client.messages.create(
611 model: "claude-opus-5-5",
612 max_tokens: 100,
613 messages: [{role: "user", content: "Hey Claude!"}]
614 )
615
616 puts message.content.find { it.type == :text }.text
617 ```
618</CodeGroup>
619
620**Using multi-region endpoints:**
621
622Set 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.
623
624<CodeGroup exclude="shell:CLI">
625 ```bash cURL
626 # The multi-region identifier, "us" or "eu", appears in the hostname and in the path
357 # The multi-region identifier, "us" or "eu", appears in the host name and in the path
627358 curl https://aiplatform.us.rep.googleapis.com/v1/projects/MY_PROJECT_ID/locations/us/publishers/anthropic/models/claude-opus-5-5:rawPredict \
628359 -H "Authorization: Bearer $(gcloud auth print-access-token)" \
629360 -H "Content-Type: application/json" \
from line 366
635366 ```
636367
637368 <CodeGroupItem language="CLI">
638 The `ant` CLI doesn't support Agent Platform.
369 The `ant` CLI doesn't support Claude Models on Google Cloud (Google managed).
639370 </CodeGroupItem>
640371
641372 ```python Python
from line 376
645376 region = "us" # Multi-region identifier: "us" or "eu"
646377
647378 client = AnthropicVertex(project_id=project_id, region=region)
648
649 message = client.messages.create(
650 model="claude-opus-5-5",
651 max_tokens=100,
652 messages=[
653 {
654 "role": "user",
655 "content": "Hey Claude!",
656 }
657 ],
658 )
659 print(message)
660379 ```
661380
662381 ```typescript TypeScript
from line 388
669388 projectId,
670389 region
671390 });
672
673 const result = await client.messages.create({
674 model: "claude-opus-5-5",
675 max_tokens: 100,
676 messages: [
677 {
678 role: "user",
679 content: "Hey Claude!"
680 }
681 ]
682 });
683 console.log(JSON.stringify(result, null, 2));
684391 ```
685392
686393 ```csharp C#
687 using Anthropic.Models.Messages;
688394 using Anthropic.Vertex;
689395
690396 var projectId = "MY_PROJECT_ID";
691397 var region = "us"; // Multi-region identifier: "us" or "eu"
692398
693399 var client = new AnthropicVertexClient(new AnthropicVertexCredentials(region, projectId));
694
695 var parameters = new MessageCreateParams
696 {
697 Model = Model.ClaudeOpus5_5,
698 MaxTokens = 100,
699 Messages = [new UserMessageParam { Content = "Hey Claude!" }]
700 };
701
702 var message = await client.Messages.Create(parameters);
703 Console.WriteLine(message);
704400 ```
705401
706402 ```go Go
707403 import (
708404 "context"
709 "fmt"
710405
711406 "github.com/anthropics/anthropic-sdk-go/v2"
712407 "github.com/anthropics/anthropic-sdk-go/v2/vertex"
from line 411
716411 client := anthropic.NewClient(
717412 vertex.WithGoogleAuth(context.Background(), "us", "MY_PROJECT_ID"),
718413 )
719
720 message, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
721 Model: anthropic.ModelClaudeOpus5_5,
722 MaxTokens: 100,
723 Messages: []anthropic.MessageParam{
724 anthropic.NewUserMessage(anthropic.NewTextBlock("Hey Claude!")),
725 },
726 })
727 if err != nil {
728 panic(err)
729 }
730 fmt.Printf("%+v\n", message)
731414 ```
732415
733416 ```java Java
734417 import com.anthropic.client.AnthropicClient;
735418 import com.anthropic.client.okhttp.AnthropicOkHttpClient;
736 import com.anthropic.models.messages.MessageCreateParams;
737 import com.anthropic.models.messages.Model;
738419 import com.anthropic.vertex.backends.VertexBackend;
739420 import com.google.auth.oauth2.GoogleCredentials;
740421
from line 430
749430 .build()
750431 )
751432 .build();
752
753 var message = client
754 .messages()
755 .create(
756 MessageCreateParams.builder()
757 .model(Model.CLAUDE_OPUS_5_5)
758 .maxTokens(100)
759 .addUserMessage("Hey Claude!")
760 .build()
761 );
762
763 IO.println(message);
764433 }
765434 ```
766435
767436 ```php PHP
768 <?php
769
770437 use Anthropic\Vertex;
771438
772439 $client = Vertex\Client::fromEnvironment(
773440 region: 'us', // Multi-region identifier: "us" or "eu"
774441 projectId: 'MY_PROJECT_ID',
775442 );
776
777 $message = $client->messages->create(
778 maxTokens: 100,
779 messages: [
780 ['role' => 'user', 'content' => 'Hey Claude!']
781 ],
782 model: 'claude-opus-5-5',
783 );
784 $textBlock = array_find($message->content, static fn ($block): bool => $block->type === 'text');
785 echo $textBlock->text;
786443 ```
787444
788445 ```ruby Ruby
from line 449
792449 region: "us", # Multi-region identifier: "us" or "eu"
793450 project_id: "MY_PROJECT_ID"
794451 )
795
796 message = client.messages.create(
797 model: "claude-opus-5-5",
798 max_tokens: 100,
799 messages: [{role: "user", content: "Hey Claude!"}]
800 )
801
802 puts message.content.find { it.type == :text }.text
803452 ```
804453</CodeGroup>
805454
806**Using regional endpoints:**
807
808Specify a specific region such as `"us-east5"` or `"europe-west1"`:
809
810<CodeGroup exclude="shell:CLI">
811 ```bash cURL
812 # Specific regional endpoints support Claude Sonnet 4.6 and earlier; newer models use the global or multi-region endpoints
813 # The region, here us-east5, appears in the hostname and in the path
814 curl https://us-east5-aiplatform.googleapis.com/v1/projects/MY_PROJECT_ID/locations/us-east5/publishers/anthropic/models/claude-sonnet-4-6:rawPredict \
815 -H "Authorization: Bearer $(gcloud auth print-access-token)" \
816 -H "Content-Type: application/json" \
817 -d '{
818 "anthropic_version": "vertex-2023-10-16",
819 "messages": [{"role": "user", "content": "Hey Claude!"}],
820 "max_tokens": 100
821 }'
822 ```
823
824 <CodeGroupItem language="CLI">
825 The `ant` CLI doesn't support Agent Platform.
826 </CodeGroupItem>
827
828 ```python Python
829 from anthropic import AnthropicVertex
830
831 project_id = "MY_PROJECT_ID"
832 region = "us-east5" # Specify a specific region
833
834 client = AnthropicVertex(project_id=project_id, region=region)
835
836 message = client.messages.create(
837 # Specific regional endpoints support Claude Sonnet 4.6 and earlier; newer models use the global or multi-region endpoints
838 model="claude-sonnet-4-6",
839 max_tokens=100,
840 messages=[
841 {
842 "role": "user",
843 "content": "Hey Claude!",
844 }
845 ],
846 )
847 print(message)
848 ```
849
850 ```typescript TypeScript
851 import { AnthropicVertex } from "@anthropic-ai/vertex-sdk";
852
853 const projectId = "MY_PROJECT_ID";
854 const region = "us-east5"; // Specify a specific region
855
856 const client = new AnthropicVertex({
857 projectId,
858 region
859 });
860
861 const result = await client.messages.create({
862 // Specific regional endpoints support Claude Sonnet 4.6 and earlier; newer models use the global or multi-region endpoints
863 model: "claude-sonnet-4-6",
864 max_tokens: 100,
865 messages: [
866 {
867 role: "user",
868 content: "Hey Claude!"
455## Feature support
456
457Features supported on Claude Models on Google Cloud (Google managed) include the following:
458
459* [Messages API](https://platform.claude.com/docs/en/api/messages/create)
460
461* [Prompt caching](https://platform.claude.com/docs/en/build-with-claude/prompt-caching)
462
463* [Thinking](https://platform.claude.com/docs/en/build-with-claude/thinking)
464
465* [Tool use](https://platform.claude.com/docs/en/agents-and-tools/tool-use/overview), including these tools:
466
467 * [Bash tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/bash-tool)
468 * [Browser use tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/browser-use-tool)
469 * [Computer use tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/computer-use-tool)
470 * [Memory tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/memory-tool)
471 * [Text editor tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/text-editor-tool)
472 * [Web search tool](https://platform.claude.com/docs/en/agents-and-tools/tool-use/web-search-tool)
473
474* [Citations](https://platform.claude.com/docs/en/build-with-claude/citations)
475
476* [Structured outputs](https://platform.claude.com/docs/en/build-with-claude/structured-outputs)
477
478[Features overview](https://platform.claude.com/docs/en/build-with-claude/overview) lists every feature and whether Claude Models on Google Cloud (Google managed) supports it.
479
480### Features not supported
481
482Claude Models on Google Cloud (Google managed) doesn't support the following:
483
484* **Input sources:** URL sources for images and documents, and the Files API
485* **Server-side tools:** Code execution, web fetch, and advisor
486* **Agent infrastructure:** Agent Skills, MCP connector, and programmatic tool calling
487* **API endpoints:** Message Batches API, Models API, Admin API, Compliance API, and Usage and Cost API
488* **Claude Managed Agents**
489* **Server-side fallback:** The [`fallbacks` parameter](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#server-side-fallback)
490
491Instead of server-side fallback, use the [client-side fallback pattern](https://platform.claude.com/docs/en/build-with-claude/refusals-and-fallback#client-side-fallback).
492
493### Context window
494
495Claude Models on Google Cloud (Google managed) offers a [1M-token context window](https://platform.claude.com/docs/en/build-with-claude/context-windows) for these models:
496
497* Claude Fable 5.1
498* Claude Fable 5
499* Claude Opus 5.5
500* Claude Opus 5
501* Claude Opus 4.8
502* Claude Opus 4.7
503* Claude Opus 4.6
504* Claude Sonnet 5.5
505* Claude Sonnet 5
506* Claude Sonnet 4.6
507* Claude Haiku 5.5
508
509Other Claude models have a 200k-token context window. These include Claude Sonnet 4.5 (deprecated) and Claude Sonnet 4 (deprecated).
510
511Agent Platform limits request payloads to 30 MB. When you send large documents or many images, you might reach this limit before the token limit.
512
513## Billing, rate limits, and logging
514
515### Rate limits
516
517Google Cloud manages rate limits and quotas for Claude Models on Google Cloud (Google managed). For details, including how to request a quota increase, see Google Cloud's [Quotas for Anthropic Claude models](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/partner-models/claude/quotas) page.
518
519### Billing
520
521Google Cloud invoices you for Claude Models on Google Cloud (Google managed). For prices, see Google Cloud's [Generative AI pricing](https://cloud.google.com/vertex-ai/generative-ai/pricing#claude-models) page. Prices also depend on the endpoint type. See [Global, multi-region, and regional endpoints](https://platform.claude.com/docs/en/build-with-claude/claude-models-on-google-cloud/google-managed#global-multi-region-and-regional-endpoints).
522
523### Data retention
524
525Google Cloud governs data handling for Claude Models on Google Cloud (Google managed). For details, see [Agent Platform and zero data retention](https://cloud.google.com/vertex-ai/generative-ai/docs/data-governance).
526
527### Monitoring and logging
528
529To log prompts and completions for Claude Models on Google Cloud (Google managed), use Agent Platform's [request-response logging service](https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/request-response-logging).
530
531Anthropic recommends that you keep at least the last 30 days of logs. The logs help you understand your activity and investigate possible misuse.
532
533<Note>
534 Turning on this service doesn't give Google or Anthropic any access to your content.
535</Note>
536
537## Migrating from Claude Models on Google Cloud (Anthropic managed)
538
539For what changes when you move, see [How the two Google Cloud offerings differ](https://platform.claude.com/docs/en/build-with-claude/claude-models-on-google-cloud/overview#how-the-two-google-cloud-offerings-differ). To move to Claude Models on Google Cloud (Google managed), follow these steps:
540
541<Steps>
542 <Step title="Set up access">
543 Check that your project and the identity that makes the calls meet the requirements in [Before making API calls](https://platform.claude.com/docs/en/build-with-claude/claude-models-on-google-cloud/google-managed#before-making-api-calls).
544 </Step>
545
546 <Step title="Install the SDK package">
547 Install the package that provides the client for Claude Models on Google Cloud (Google managed). See [Install an SDK](https://platform.claude.com/docs/en/build-with-claude/claude-models-on-google-cloud/google-managed#install-an-sdk-for-accessing-vertex-ai).
548 </Step>
549
550 <Step title="Replace the import and the client">
551 Change the code that imports and creates your client. Use `AnthropicVertex` (csharp: `AnthropicVertexClient`; go: `vertex.WithGoogleAuth`; java: `VertexBackend`; php: `Anthropic\Vertex\Client`; ruby: `Anthropic::VertexClient`) in place of `AnthropicGoogleCloud` (csharp: `AnthropicGoogleCloudClient`; go: `googlecloud.NewClient`; java: `GoogleCloudBackend`; php: `Anthropic\GoogleCloud\Client`; ruby: `Anthropic::GoogleCloudClient`). A cURL request needs a new URL, new headers, and a new body. The following code creates the client for Claude Models on Google Cloud (Anthropic managed) that you use today:
552
553 <CodeGroup>
554 ```bash cURL
555 curl "https://claude.googleapis.com/v1/projects/$ANTHROPIC_GOOGLE_CLOUD_PROJECT/locations/global/workspaces/$ANTHROPIC_GOOGLE_CLOUD_WORKSPACE_ID/invoke/v1/messages" \
556 -H "Authorization: Bearer $(gcloud auth application-default print-access-token)" \
557 -H "content-type: application/json" \
558 -H "anthropic-version: 2023-06-01" \
559 -d '{
560 "model": "claude-opus-5-5",
561 "max_tokens": 1024,
562 "messages": [
563 {"role": "user", "content": "Hello, Claude"}
564 ]
565 }'
566 ```
567
568 ```bash CLI
569 ant messages create \
570 --model claude-opus-5-5 \
571 --max-tokens 1024 \
572 --message '{role: user, content: "Hello, Claude"}'
573 ```
574
575 ```python Python
576 from anthropic import AnthropicGoogleCloud
577
578 client = AnthropicGoogleCloud()
579 ```
580
581 ```typescript TypeScript
582 import { AnthropicGoogleCloud } from "@anthropic-ai/google-cloud-sdk";
583
584 const client = new AnthropicGoogleCloud();
585 ```
586
587 ```csharp C#
588 using Anthropic.GoogleCloud;
589
590 var client = new AnthropicGoogleCloudClient();
591 ```
592
593 ```go Go
594 import (
595 "context"
596
597 "github.com/anthropics/anthropic-sdk-go/v2"
598 "github.com/anthropics/anthropic-sdk-go/v2/googlecloud"
599 )
600 // ...
601 client, err := googlecloud.NewClient(context.Background(), googlecloud.ClientConfig{})
602 if err != nil {
603 panic(err)
604 }
605 ```
606
607 ```java Java
608 import com.anthropic.client.AnthropicClient;
609 import com.anthropic.client.okhttp.AnthropicOkHttpClient;
610 import com.anthropic.googlecloud.backends.GoogleCloudBackend;
611
612 void main() {
613 AnthropicClient client = AnthropicOkHttpClient.builder()
614 .backend(GoogleCloudBackend.fromEnv())
615 .build();
869616 }
870 ]
871 });
872 console.log(JSON.stringify(result, null, 2));
873 ```
874
875 ```csharp C#
876 using Anthropic.Models.Messages;
877 using Anthropic.Vertex;
878
879 var projectId = "MY_PROJECT_ID";
880 var region = "us-east5"; // Specify a specific region
881
882 var client = new AnthropicVertexClient(new AnthropicVertexCredentials(region, projectId));
883
884 var parameters = new MessageCreateParams
885 {
886 // Specific regional endpoints support Claude Sonnet 4.6 and earlier; newer models use the global or multi-region endpoints
887 Model = Model.ClaudeSonnet4_6,
888 MaxTokens = 100,
889 Messages = [new UserMessageParam { Content = "Hey Claude!" }]
890 };
891
892 var message = await client.Messages.Create(parameters);
893 Console.WriteLine(message);
894 ```
895
896 ```go Go
897 import (
898 "context"
899 "fmt"
900
901 "github.com/anthropics/anthropic-sdk-go/v2"
902 "github.com/anthropics/anthropic-sdk-go/v2/vertex"
903 )
904 // ...
905 // Specify a specific region
906 client := anthropic.NewClient(
907 vertex.WithGoogleAuth(context.Background(), "us-east5", "MY_PROJECT_ID"),
908 )
909
910 message, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
911 // Specific regional endpoints support Claude Sonnet 4.6 and earlier; newer models use the global or multi-region endpoints
912 Model: anthropic.ModelClaudeSonnet4_6,
913 MaxTokens: 100,
914 Messages: []anthropic.MessageParam{
915 anthropic.NewUserMessage(anthropic.NewTextBlock("Hey Claude!")),
916 },
917 })
918 if err != nil {
919 panic(err)
920 }
921 fmt.Printf("%+v\n", message)
922 ```
923
924 ```java Java
925 import com.anthropic.client.AnthropicClient;
926 import com.anthropic.client.okhttp.AnthropicOkHttpClient;
927 import com.anthropic.models.messages.MessageCreateParams;
928 import com.anthropic.models.messages.Model;
929 import com.anthropic.vertex.backends.VertexBackend;
930 import com.google.auth.oauth2.GoogleCredentials;
931
932 void main() throws Exception {
933 AnthropicClient client = AnthropicOkHttpClient.builder()
934 .backend(
935 VertexBackend.builder()
936 .googleCredentials(GoogleCredentials.getApplicationDefault())
937 .region("us-east5") // Specify a specific region
938 .project("MY_PROJECT_ID")
939 .build()
940 )
941 .build();
942
943 var message = client
944 .messages()
945 .create(
946 MessageCreateParams.builder()
947 // Specific regional endpoints support Claude Sonnet 4.6 and earlier; newer models use the global or multi-region endpoints
948 .model(Model.CLAUDE_SONNET_4_6)
949 .maxTokens(100)
950 .addUserMessage("Hey Claude!")
951 .build()
952 );
953
954 IO.println(message);
955 }
956 ```
957
958 ```php PHP
959 <?php
960
961 use Anthropic\Vertex;
962
963 $client = Vertex\Client::fromEnvironment(
964 region: 'us-east5',
965 projectId: 'MY_PROJECT_ID',
966 );
967
968 $message = $client->messages->create(
969 maxTokens: 100,
970 messages: [
971 ['role' => 'user', 'content' => 'Hey Claude!']
972 ],
973 // Specific regional endpoints support Claude Sonnet 4.6 and earlier; newer models use the global or multi-region endpoints
974 model: 'claude-sonnet-4-6',
975 );
976 echo $message->content[0]->text;
977 ```
978
979 ```ruby Ruby
980 require "anthropic"
981
982 client = Anthropic::VertexClient.new(
983 region: "us-east5", # Specify a specific region
984 project_id: "MY_PROJECT_ID"
985 )
986
987 message = client.messages.create(
988 # Specific regional endpoints support Claude Sonnet 4.6 and earlier; newer models use the global or multi-region endpoints
989 model: "claude-sonnet-4-6",
990 max_tokens: 100,
991 messages: [{role: "user", content: "Hey Claude!"}]
992 )
993
994 puts message.content.first.text
995 ```
996</CodeGroup>
997
998<Note>
999 Claude Mythos Preview is a research preview available to invited customers on Agent Platform. For more information, see [Project Glasswing](https://anthropic.com/glasswing).
1000</Note>
1001
1002## Additional resources
1003
1004* **Agent Platform pricing:** [Generative AI pricing on cloud.google.com](https://cloud.google.com/vertex-ai/generative-ai/pricing)
1005* **Claude models documentation:** [Claude on Agent Platform](https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/partner-models/claude)
1006* **Google blog post:** [Global endpoint for Claude models](https://cloud.google.com/blog/products/ai-machine-learning/global-endpoint-for-claude-models-generally-available-on-vertex-ai)
1007* **Anthropic pricing details:** [Cloud platform pricing](https://platform.claude.com/docs/en/about-claude/pricing#cloud-platform-pricing)
617 ```
618
619 ```php PHP
620 use Anthropic\GoogleCloud\Client;
621
622 $client = new Client();
623 ```
624
625 ```ruby Ruby
626 require "anthropic"
627
628 client = Anthropic::GoogleCloudClient.new
629 ```
630 </CodeGroup>
631
632 The following code creates the client for Claude Models on Google Cloud (Google managed). It uses the global endpoint. For the other endpoint types, see [Global, multi-region, and regional endpoints](https://platform.claude.com/docs/en/build-with-claude/claude-models-on-google-cloud/google-managed#global-multi-region-and-regional-endpoints).
633
634 <CodeGroup exclude="shell:CLI">
635 ```bash cURL
636 curl https://aiplatform.googleapis.com/v1/projects/MY_PROJECT_ID/locations/global/publishers/anthropic/models/claude-opus-5-5:rawPredict \
637 -H "Authorization: Bearer $(gcloud auth print-access-token)" \
638 -H "Content-Type: application/json" \
639 -d '{
640 "anthropic_version": "vertex-2023-10-16",
641 "messages": [{"role": "user", "content": "Hey Claude!"}],
642 "max_tokens": 100
643 }'
644 ```
645
646 <CodeGroupItem language="CLI">
647 The `ant` CLI doesn't support Claude Models on Google Cloud (Google managed). Use cURL or an SDK instead.
648 </CodeGroupItem>
649
650 ```python Python
651 from anthropic import AnthropicVertex
652
653 project_id = "MY_PROJECT_ID"
654 region = "global"
655
656 client = AnthropicVertex(project_id=project_id, region=region)
657 ```
658
659 ```typescript TypeScript
660 import { AnthropicVertex } from "@anthropic-ai/vertex-sdk";
661
662 const projectId = "MY_PROJECT_ID";
663 const region = "global";
664
665 const client = new AnthropicVertex({
666 projectId,
667 region
668 });
669 ```
670
671 ```csharp C#
672 using Anthropic.Vertex;
673
674 var projectId = "MY_PROJECT_ID";
675 var region = "global";
676
677 var client = new AnthropicVertexClient(new AnthropicVertexCredentials(region, projectId));
678 ```
679
680 ```go Go
681 import (
682 "context"
683
684 "github.com/anthropics/anthropic-sdk-go/v2"
685 "github.com/anthropics/anthropic-sdk-go/v2/vertex"
686 )
687 // ...
688 // Uses default Google Cloud credentials
689 client := anthropic.NewClient(
690 vertex.WithGoogleAuth(context.Background(), "global", "MY_PROJECT_ID"),
691 )
692 ```
693
694 ```java Java
695 import com.anthropic.client.AnthropicClient;
696 import com.anthropic.client.okhttp.AnthropicOkHttpClient;
697 import com.anthropic.vertex.backends.VertexBackend;
698 import com.google.auth.oauth2.GoogleCredentials;
699
700 void main() throws Exception {
701 AnthropicClient client = AnthropicOkHttpClient.builder()
702 .backend(
703 VertexBackend.builder()
704 .googleCredentials(GoogleCredentials.getApplicationDefault())
705 .region("global")
706 .project("MY_PROJECT_ID")
707 .build()
708 )
709 .build();
710 }
711 ```
712
713 ```php PHP
714 use Anthropic\Vertex;
715
716 $client = Vertex\Client::fromEnvironment(
717 region: 'global',
718 projectId: 'MY_PROJECT_ID',
719 );
720 ```
721
722 ```ruby Ruby
723 require "anthropic"
724
725 client = Anthropic::VertexClient.new(
726 region: "global",
727 project_id: "MY_PROJECT_ID"
728 )
729 ```
730 </CodeGroup>
731
732 This code passes your project ID and a region when it creates the client. Replace `MY_PROJECT_ID` with your project ID. The Messages API calls that you make with the client stay as they are. The exceptions are the model IDs and features in the next step.
733 </Step>
734
735 <Step title="Check model IDs and features">
736 * **Model IDs:** If you use a model earlier than Claude 4.6, replace the hyphen before the snapshot date in its ID with `@`. For example, `claude-haiku-4-5-20251001` becomes `claude-haiku-4-5@20251001`. For the models and their IDs, see [API model IDs](https://platform.claude.com/docs/en/build-with-claude/claude-models-on-google-cloud/google-managed#api-model-ids).
737 * **Features:** Check that the features your code uses aren't listed in [Features not supported](https://platform.claude.com/docs/en/build-with-claude/claude-models-on-google-cloud/google-managed#features-not-supported).
738 </Step>
739
740 <Step title="Run a test request">
741 Run the request in [Making requests](https://platform.claude.com/docs/en/build-with-claude/claude-models-on-google-cloud/google-managed#accessing-vertex-ai) to check that your setup works. Then run your own code. Before you move production traffic, read about [rate limits for Claude Models on Google Cloud (Google managed)](https://platform.claude.com/docs/en/build-with-claude/claude-models-on-google-cloud/google-managed#rate-limits).
742 </Step>
743</Steps>
744
745## Next steps
746
747<CardGroup cols={2}>
748 <Card title="Features overview" icon="stack" href="https://platform.claude.com/docs/en/build-with-claude/overview">
749 Explore Claude's features.
750 </Card>
751
752 <Card title="Anthropic Claude models on Agent Platform" icon="book" href="https://docs.cloud.google.com/gemini-enterprise-agent-platform/models/partner-models/claude">
753 Check which Claude models each region offers, and their retirement dates.
754 </Card>
755
756 <Card title="Agent Platform documentation" icon="book" href="https://cloud.google.com/vertex-ai/docs">
757 Read Google Cloud's Agent Platform documentation.
758 </Card>
759
760 <Card title="Global endpoint for Claude models" icon="link" href="https://cloud.google.com/blog/products/ai-machine-learning/global-endpoint-for-claude-models-generally-available-on-vertex-ai">
761 Read Google Cloud's blog post about the global endpoint for Claude models.
762 </Card>
763</CardGroup>
1008764