Claude Platform Docs
  • Messages
  • Managed Agents
  • Admin

Search...
⌘K
First steps
Intro to ClaudeQuickstart
Building with Claude
Features overviewUsing the Messages APIStop reasons and fallbackRefusals and fallbackFallback credit
Model capabilities
Extended thinkingAdaptive thinkingEffortTask budgets (beta)Fast mode (research preview)Structured outputsCitationsStreaming MessagesBatch processingSearch resultsStreaming refusalsMultilingual supportEmbeddings
Tools
OverviewHow tool use worksTutorial: Build a tool-using agentDefine toolsHandle tool callsParallel tool useTool Runner (SDK)Strict tool useServer toolsWeb search toolWeb fetch toolCode execution toolAdvisor toolTool search toolMemory toolBash toolText editor toolComputer use toolTroubleshooting
Tool infrastructure
Tool referenceManage tool contextTool combinationsTool use with prompt cachingProgrammatic tool callingFine-grained tool streaming
Context management
Context windowsCompactionContext editingPrompt cachingMid-conversation system messagesBuild an orchestration modeCache diagnostics (beta)Token counting
Working with files
Files APIPDF support
Skills
OverviewQuickstartBest practicesSkills for enterpriseSkills in the API
MCP
Remote MCP serversMCP connector
Claude on cloud platforms
Amazon BedrockAmazon Bedrock (legacy)Claude Platform on AWSGoogle CloudMicrosoft Foundry

Log in
Microsoft Foundry
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Claude Platform Docs

Solutions

  • AI agents
  • Code modernization
  • Coding
  • Customer support
  • Education
  • Financial services
  • Government
  • Life sciences

Partners

  • Claude on AWS
  • Claude on Google Cloud

Learn

  • Blog
  • Courses
  • Use cases
  • Connectors
  • Customer stories
  • Engineering at Anthropic
  • Events
  • Powered by Claude
  • Service partners
  • Startups program

Company

  • Anthropic
  • Careers
  • Economic Futures
  • Research
  • News
  • Responsible Scaling Policy
  • Security and compliance
  • Transparency

Learn

  • Blog
  • Courses
  • Use cases
  • Connectors
  • Customer stories
  • Engineering at Anthropic
  • Events
  • Powered by Claude
  • Service partners
  • Startups program

Help and security

  • Availability
  • Status
  • Support
  • Discord

Terms and policies

  • Privacy policy
  • Responsible disclosure policy
  • Terms of service: Commercial
  • Terms of service: Consumer
  • Usage policy
Messages/Claude on cloud platforms

Claude in Microsoft Foundry

Access Claude models through Microsoft Foundry with Azure-native endpoints and authentication.

This guide walks you through the process of setting up and making 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, allowing you to access Claude's latest capabilities while managing costs through your Azure subscription.

Claude 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 Pricing for details.

Hosting options

Claude models in Microsoft Foundry are available in two hosting options. You choose the hosting option when you configure the deployment.

Hosted on AzureHosted on Anthropic
Where inference runsAnthropic-operated service running on Azure infrastructureAnthropic-operated service running on Anthropic infrastructure
Model availabilityThe latest models in the Opus and Haiku familiesAll Claude models available on Microsoft Foundry
Deployment typesGlobal Standard, US Data Zone StandardGlobal Standard
Recommended forMost workloadsAccess to features or models not yet hosted on Azure


Anthropic acts as an independent processor for Microsoft. Customers using Claude through Microsoft Foundry are subject to Anthropic's data use terms. For deployments hosted on Azure, prompts and completions remain within Azure; only usage metadata and content flagged by Anthropic's safety systems egress to Anthropic. Anthropic continues to provide its safety and data commitments.

Prerequisites

Before you begin, ensure you have:

  • An active Azure subscription
  • Access to Foundry
  • The Azure CLI installed (optional, for resource management)

Install an SDK

Anthropic's client SDKs support Foundry through a platform-specific package or client class.



Foundry is supported by the C#, Java, PHP, Python, and TypeScript SDKs. Foundry is not currently available in the Go and Ruby SDKs.

Provisioning

Foundry uses a two-level hierarchy: resources contain your security and billing configuration, while deployments are the model instances you call through the API. You'll first create a Foundry resource, then create one or more Claude deployments within it.

Provisioning Foundry resources

Create a Foundry resource, which is required to use and manage services in Azure. You can follow these instructions to create a Foundry resource. Alternatively, you can start by creating a Foundry project, which involves creating a Foundry resource.

To provision your resource:

  1. Navigate to the Foundry portal
  2. Create a new Foundry resource or select an existing one
  3. Configure access management using Azure-issued API keys or Entra ID (formerly Azure Active Directory) for role-based access control
  4. Optionally configure the resource to be part of a private network (Azure Virtual Network) for enhanced security
  5. Note your resource name. You'll use this as {resource} in API endpoints (for example, https://{resource}.services.ai.azure.com/anthropic/v1/*)

Creating Foundry deployments

After creating your resource, deploy a Claude model to make it available for API calls. These steps describe the new Foundry portal (the New Foundry toggle is on):

  1. Sign in to the Foundry portal. From the portal homepage, select Discover in the upper-right navigation, then Models in the left pane to open the model catalog.
  2. Search for and select a Claude model (for example, claude-opus-4-8). Each model appears once in the catalog regardless of how many hosting options it supports.
  3. On the model card, select Deploy, then Custom settings to open the deployment settings pane. If you choose Default settings instead, the deployment is automatically configured as Hosted on Azure for models available in both hosting options.
  4. On your first Claude deployment, review the Azure Marketplace terms, select an industry, and select Agree and Proceed to accept the terms and subscribe to the Azure Marketplace offer.
  5. Configure the deployment:
    • Deployment name: Defaults to the model ID, but you can customize it (for example, my-claude-deployment). The deployment name cannot be changed after creation.
    • Region scope: Select Global, or for models hosted on Azure, Data Zone. Selecting Data Zone creates a US Data Zone Standard deployment, which keeps inference within the United States and is equivalent to setting inference_geo: "us" on the Claude API.
    • Model version: Expand Model version settings and select a version from the Model version dropdown. Each hosting option is listed as a separate model version, labeled with its hosting option (for example, version 1 for Hosted on Anthropic, version 2 for Hosted on Azure).
  6. Select Deploy and wait for provisioning to complete.
  7. Once deployed, select Build in the upper-right navigation, then Models in the left pane, and open your deployment. The Details tab shows the Target URI (your endpoint URL) and Key (your API key).


If the New Foundry toggle is off, you are in the classic portal layout. There, open Model catalog in the left pane to find and deploy a model, and open Models + endpoints (under My assets) to view your deployments and their endpoint details.



The deployment name you choose becomes the value you pass in the model parameter of your API requests. You can create multiple deployments of the same model with different names to manage separate configurations or rate limits.

Authentication

Claude in Microsoft Foundry supports two authentication methods: API keys and Entra ID tokens. Both methods use Azure-hosted endpoints in the format https://{resource}.services.ai.azure.com/anthropic/v1/*.

API key authentication

After provisioning your Foundry Claude resource, you can obtain an API key from the Foundry portal:

  1. In the Foundry portal, select Build in the upper-right navigation, then Models in the left pane.
  2. Open your Claude deployment and select the Details tab.
  3. Copy the Key value (and note the Target URI for your endpoint).
  4. Use either the api-key or x-api-key header in your requests, or provide it to the SDK.

The Foundry SDKs require an API key and either a resource name or base URL. The C#, Java, PHP, Python, and TypeScript SDKs automatically read these from the following environment variables if they are defined:

  • ANTHROPIC_FOUNDRY_API_KEY - Your API key
  • ANTHROPIC_FOUNDRY_RESOURCE - Your resource name (for example, example-resource)
  • ANTHROPIC_FOUNDRY_BASE_URL - Alternative to resource name; the full base URL (for example, https://example-resource.services.ai.azure.com/anthropic/)


The resource and base_url parameters are mutually exclusive. Provide either the resource name (which the SDK uses to construct the URL as https://{resource}.services.ai.azure.com/anthropic/) or the full base URL directly.

Example using API key:



Keep your API keys secure. Never commit them to version control or share them publicly. Anyone with access to your API key can make requests to Claude through your Foundry resource.

Microsoft Entra authentication

For enhanced security and centralized access management, you can use Entra ID tokens:

  1. Enable Entra authentication for your Foundry resource
  2. Obtain an access token from Entra ID
  3. Use the token in the Authorization: Bearer {TOKEN} header

Example using Entra ID:



Microsoft Entra ID authentication allows you to manage access using Azure RBAC, integrate with your organization's identity management, and avoid managing API keys manually.

Correlation request IDs

Foundry includes request identifiers in HTTP response headers for debugging and tracing. When contacting support, provide both the request-id and apim-request-id values to help teams quickly locate and investigate your request across both Anthropic and Azure systems.

Feature support

Claude in Microsoft Foundry supports most of Claude's powerful features. You can find all the features currently supported in Features overview.

Context window

Claude Fable 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 Microsoft Foundry. Other Claude models, including Claude Sonnet 4.5, have a 200k-token context window.

Claude features not supported for Claude in Microsoft Foundry

  • Admin API
  • Advisor tool
  • Claude Managed Agents
  • Compliance API
  • Models API
  • Message Batches API
  • Server-side fallback (the fallbacks parameter; use the client-side fallback pattern instead)

Additional features not supported when hosted on Azure

The following features are available for deployments hosted on Anthropic but are not supported for deployments hosted on Azure:

  • Structured outputs
  • Server-side tools (web search, web fetch, code execution, and tool search)
  • MCP connector
  • Agent Skills
  • Programmatic tool calling
  • Files API

Requests that use these features against a deployment hosted on Azure return a 400 Bad Request error by design. Claude Code detects deployments hosted on Azure and automatically adapts its feature set.

API responses

API responses from Claude in Microsoft Foundry follow the standard Claude API response format. This includes the usage object in response bodies, which provides detailed token consumption information for your requests. The usage object is consistent across all platforms (Claude API, Foundry, Claude Platform on AWS, Amazon Bedrock, and Google Cloud).

For details on response headers specific to Foundry, see Correlation request IDs.

API model IDs and deployments

Lifecycle terms (Deprecated, Retired) are defined in Model deprecations. Microsoft Foundry follows the Claude API lifecycle schedule.

The following Claude models are available through Foundry:

ModelDefault deployment nameHosted on AzureHosted on Anthropic
Claude Fable 5claude-fable-5✓
Claude Opus 4.8claude-opus-4-8✓✓
Claude Opus 4.7claude-opus-4-7✓
Claude Opus 4.6claude-opus-4-6✓
Claude Opus 4.5claude-opus-4-5✓
Claude Opus 4.1
Deprecated. Retiring August 5, 2026.
claude-opus-4-1✓
Claude Sonnet 5 (preview)claude-sonnet-5✓
Claude Sonnet 4.6claude-sonnet-4-6✓
Claude Sonnet 4.5claude-sonnet-4-5✓
Claude Haiku 4.5claude-haiku-4-5✓✓

By default, deployment names match the model IDs shown in the preceding table. However, you can create custom deployments with different names in the Foundry portal to manage different configurations, versions, or rate limits. Use the deployment name (not necessarily the model ID) in your API requests.



Upgrading to a newer Claude model? In Claude Code, run /claude-api migrate to apply model ID swaps and breaking parameter changes across your codebase. The skill detects which cloud platform your code targets and adjusts model ID formats and feature changes for that platform. See Migrating to a newer Claude model.

Billing

Claude in Microsoft Foundry bills through the Azure Marketplace. Usage is denominated in Claude Consumption Units (CCUs), metered hourly, and invoiced monthly in arrears on your Azure bill. CCUs are not prepaid credits; there is no CCU balance or commitment.

For the CCU price, conversion mechanics, and per-model token rates, see Claude in Microsoft Foundry pricing.

Migrating between hosting options

To move an existing deployment from one hosting option to the other:

  1. Create a new deployment of the model's other hosting version (Hosted on Azure or Hosted on Anthropic). This can be in the same Foundry resource, or a new one.
  2. Update your application to pass the new deployment name in the model parameter.
  3. Delete the old deployment once traffic has moved.

If the new deployment is in the same Foundry resource, your endpoint URL and authentication are unchanged. If you created a new resource, update your application's endpoint and credentials to point to it.

Monitoring and logging

Azure provides comprehensive monitoring and logging capabilities for your Claude usage through standard Azure patterns:

  • Azure Monitor: Track API usage, latency, and error rates
  • Azure Log Analytics: Query and analyze request/response logs
  • Cost Management: Monitor and forecast costs associated with Claude usage

Anthropic recommends logging your activity on at least a 30-day rolling basis to understand usage patterns and investigate any potential issues.



Azure's logging services are configured within your Azure subscription. Enabling logging does not provide Microsoft or Anthropic access to your content beyond what's necessary for billing and service operation.

Troubleshooting

Authentication errors

Error: 401 Unauthorized or Invalid API key

  • Solution: Verify your API key is correct. You can find it in the Foundry portal on your deployment's Details tab (under Build > Models).
  • Solution: If using Microsoft Entra ID, ensure your access token is valid and hasn't expired. Tokens typically expire after 1 hour.

Error: 403 Forbidden

  • Solution: Your Azure account may lack the necessary permissions. Ensure you have the appropriate Azure RBAC role assigned (for example, Foundry User (formerly Azure AI User) or Cognitive Services User).

Rate limiting

Error: 429 Too Many Requests

  • Solution: You've exceeded your rate limit. Implement exponential backoff and retry logic in your application.
  • Solution: Consider requesting rate limit increases through the Azure portal or Azure support.

Rate limit headers

Foundry does not include Anthropic's standard rate limit headers (anthropic-ratelimit-tokens-limit, anthropic-ratelimit-tokens-remaining, anthropic-ratelimit-tokens-reset, anthropic-ratelimit-input-tokens-limit, anthropic-ratelimit-input-tokens-remaining, anthropic-ratelimit-input-tokens-reset, anthropic-ratelimit-output-tokens-limit, anthropic-ratelimit-output-tokens-remaining, and anthropic-ratelimit-output-tokens-reset) in responses. Manage rate limiting through Azure's monitoring tools instead.

Model and deployment errors

Error: Model not found or Deployment not found

  • Solution: Verify you're using the correct deployment name. If you haven't created a custom deployment, use the default model ID (for example, claude-sonnet-4-6).
  • Solution: Ensure the model/deployment is available in your Azure region.

Error: Invalid model parameter

  • Solution: The model parameter should contain your deployment name, which can be customized in the Foundry portal. Verify the deployment exists and is properly configured.


Claude Mythos Preview is a research preview available to invited customers on Microsoft Foundry. For more information, see Project Glasswing.

Additional resources

  • Foundry documentation: ai.azure.com/catalog
  • Azure pricing: azure.microsoft.com/en-us/pricing/details/ai-foundry
  • Anthropic pricing details: Model pricing
  • Authentication guide: See Authentication
  • Azure portal: portal.azure.com

Was this page helpful?

  • Hosting options
  • Prerequisites
  • Install an SDK
  • Provisioning
  • Provisioning Foundry resources
  • Creating Foundry deployments
  • Authentication
  • API key authentication
  • Microsoft Entra authentication
  • Correlation request IDs
  • Feature support
  • Context window
  • Claude features not supported for Claude in Microsoft Foundry
  • Additional features not supported when hosted on Azure
  • API responses
  • API model IDs and deployments
  • Billing
  • Migrating between hosting options
  • Monitoring and logging
  • Troubleshooting
  • Authentication errors
  • Rate limiting
  • Model and deployment errors
  • Additional resources