The whole hunk
from line 4, old and new numbered
/
lines
from line 4
44description: Access Claude models through Microsoft Foundry with Azure-native endpoints and authentication.
55---
66
7This guide shows you how to set up and make API calls to Claude in Microsoft Foundry using one of Anthropic's client SDKs or direct HTTP requests. When you access Claude in Microsoft Foundry, you are billed for Claude usage in the Azure Marketplace. You can use Claude models including Claude Fable 5.1, Claude Opus 5, Claude Opus 4.8, and Claude Sonnet 5, and features such as the [1M-token context window](https://platform.claude.com/docs/en/build-with-claude/context-windows), while managing costs through your Azure subscription.
7This guide shows you how to set up and make API calls to Claude in Microsoft Foundry using one of Anthropic's client SDKs or direct HTTP requests. When you access Claude in Microsoft Foundry, you are billed for Claude usage in the Azure Marketplace. You can use Claude models including Claude Fable 5.1, Claude Opus 5.5, Claude Opus 5, Claude Opus 4.8, and Claude Sonnet 5, and features such as the [1M-token context window](https://platform.claude.com/docs/en/build-with-claude/context-windows), while managing costs through your Azure subscription.
88
99Claude is available in Global Standard and US Data Zone Standard deployment types in Foundry resources, billed in Claude Consumption Units through the Azure Marketplace. Visit [Claude in Microsoft Foundry pricing](https://platform.claude.com/docs/en/about-claude/pricing#claude-in-microsoft-foundry-pricing) for details.
1010
from line 77
7777 <Tabs>
7878 <Tab title="Gradle">
7979 ```kotlin
80 implementation("com.anthropic:anthropic-java:2.63.0")
81 implementation("com.anthropic:anthropic-java-foundry:2.63.0")
80 implementation("com.anthropic:anthropic-java:2.65.0")
81 implementation("com.anthropic:anthropic-java-foundry:2.65.0")
8282
8383 // For Entra ID authentication, also add the Azure Identity library
8484 implementation("com.azure:azure-identity:1.18.3")
from line 90
9090 <dependency>
9191 <groupId>com.anthropic</groupId>
9292 <artifactId>anthropic-java</artifactId>
93 <version>2.63.0</version>
93 <version>2.65.0</version>
9494 </dependency>
9595 <dependency>
9696 <groupId>com.anthropic</groupId>
9797 <artifactId>anthropic-java-foundry</artifactId>
98 <version>2.63.0</version>
98 <version>2.65.0</version>
9999 </dependency>
100100 <!-- For Entra ID authentication, also add the Azure Identity library -->
101101 <dependency>
from line 200
200200 -H "api-key: YOUR_AZURE_API_KEY" \
201201 -H "anthropic-version: 2023-06-01" \
202202 -d '{
203 "model": "claude-opus-5",
203 "model": "claude-opus-5-5",
204204 "max_tokens": 1024,
205205 "messages": [
206206 {"role": "user", "content": "Hello!"}
from line 214
214214
215215 ant messages create \
216216 --base-url https://example-resource.services.ai.azure.com/anthropic \
217 --model claude-opus-5 \
217 --model claude-opus-5-5 \
218218 --max-tokens 1024 \
219219 --message '{role: user, content: "Hello!"}' \
220220 --transform content
from line 230
230230 )
231231
232232 message = client.messages.create(
233 model="claude-opus-5",
233 model="claude-opus-5-5",
234234 max_tokens=1024,
235235 messages=[{"role": "user", "content": "Hello!"}],
236236 )
from line 246
246246 });
247247
248248 const message = await client.messages.create({
249 model: "claude-opus-5",
249 model: "claude-opus-5-5",
250250 max_tokens: 1024,
251251 messages: [{ role: "user", content: "Hello!" }]
252252 });
from line 266
266266
267267 var response = await client.Messages.Create(new MessageCreateParams
268268 {
269 Model = "claude-opus-5",
269 Model = "claude-opus-5-5",
270270 MaxTokens = 1024,
271271 Messages = [new() { Role = Role.User, Content = "Hello!" }],
272272 });
from line 305
305305 )
306306
307307 message, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
308 Model: "claude-opus-5",
308 Model: "claude-opus-5-5",
309309 MaxTokens: 1024,
310310 Messages: []anthropic.MessageParam{
311311 anthropic.NewUserMessage(anthropic.NewTextBlock("Hello!")),
from line 331
331331 .build();
332332
333333 MessageCreateParams params = MessageCreateParams.builder()
334 .model("claude-opus-5")
334 .model("claude-opus-5-5")
335335 .maxTokens(1024)
336336 .addUserMessage("Hello!")
337337 .build();
from line 355
355355 messages: [
356356 ['role' => 'user', 'content' => 'Hello!']
357357 ],
358 model: 'claude-opus-5',
358 model: 'claude-opus-5-5',
359359 );
360360 echo array_find($message->content, fn ($block) => $block->type === 'text')->text;
361361 ```
from line 376
376376 )
377377
378378 message = client.messages.create(
379 model: "claude-opus-5",
379 model: "claude-opus-5-5",
380380 max_tokens: 1024,
381381 messages: [{role: "user", content: "Hello!"}]
382382 )
from line 410
410410 -H "Authorization: Bearer $ACCESS_TOKEN" \
411411 -H "anthropic-version: 2023-06-01" \
412412 -d '{
413 "model": "claude-opus-5",
413 "model": "claude-opus-5-5",
414414 "max_tokens": 1024,
415415 "messages": [
416416 {"role": "user", "content": "Hello!"}
from line 443
443443
444444 # Make request
445445 message = client.messages.create(
446 model="claude-opus-5",
446 model="claude-opus-5-5",
447447 max_tokens=1024,
448448 messages=[{"role": "user", "content": "Hello!"}],
449449 )
from line 466
466466
467467 // Make request
468468 const message = await client.messages.create({
469 model: "claude-opus-5",
469 model: "claude-opus-5-5",
470470 max_tokens: 1024,
471471 messages: [{ role: "user", content: "Hello!" }]
472472 });
from line 487
487487
488488 var response = await client.Messages.Create(new MessageCreateParams
489489 {
490 Model = "claude-opus-5",
490 Model = "claude-opus-5-5",
491491 MaxTokens = 1024,
492492 Messages = [new() { Role = Role.User, Content = "Hello!" }],
493493 });
from line 530
530530 )
531531
532532 message, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
533 Model: "claude-opus-5",
533 Model: "claude-opus-5-5",
534534 MaxTokens: 1024,
535535 Messages: []anthropic.MessageParam{
536536 anthropic.NewUserMessage(anthropic.NewTextBlock("Hello!")),
from line 566
566566 .build();
567567
568568 MessageCreateParams params = MessageCreateParams.builder()
569 .model("claude-opus-5")
569 .model("claude-opus-5-5")
570570 .maxTokens(1024)
571571 .addUserMessage("Hello!")
572572 .build();
from line 595
595595 messages: [
596596 ['role' => 'user', 'content' => 'Hello!']
597597 ],
598 model: 'claude-opus-5',
598 model: 'claude-opus-5-5',
599599 );
600600 echo array_find($message->content, fn ($block) => $block->type === 'text')->text;
601601 ```
from line 619
619619 )
620620
621621 message = client.messages.create(
622 model: "claude-opus-5",
622 model: "claude-opus-5-5",
623623 max_tokens: 1024,
624624 messages: [{role: "user", content: "Hello!"}]
625625 )
from line 638
638638
639639### Context window
640640
641Claude 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](https://platform.claude.com/docs/en/build-with-claude/context-windows) on Microsoft Foundry. Other Claude models, including Claude Sonnet 4.5, have a 200k-token context window.
641Claude 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, and Claude Sonnet 4.6 have a [1M-token context window](https://platform.claude.com/docs/en/build-with-claude/context-windows) on Microsoft Foundry. Other Claude models, including Claude Sonnet 4.5, have a 200k-token context window.
642642
643643### Claude features not supported for Claude in Microsoft Foundry
644644
from line 679
679679| :---------------- | :---------------------- | :-------------: | :-----------------: |
680680| Claude Fable 5.1 | `claude-fable-5-1` | | ✓ |
681681| Claude Fable 5 | `claude-fable-5` | | ✓ |
682| Claude Opus 5.5 | `claude-opus-5-5` | ✓ | ✓ |
682683| Claude Opus 5 | `claude-opus-5` | ✓ | ✓ |
683684| Claude Opus 4.8 | `claude-opus-4-8` | ✓ | ✓ |
684685| Claude Opus 4.7 | `claude-opus-4-7` | | ✓ |