Repository Public
1---2title: Data residency3url: https://platform.claude.com/docs/en/manage-claude/data-residency4description: Manage where model inference runs and where data is stored with geographic controls.5---67Data residency controls let you manage where your data is processed and stored. Two independent settings govern this:89* **Inference geo:** Controls where model inference runs, on a per-request basis. Set through the `inference_geo` API parameter or as a workspace default.10* **Workspace geo:** Controls where data is stored at rest and where endpoint processing (such as image transcoding and code execution) happens. Configured at the workspace level in the [Claude Console](https://platform.claude.com).1112<Note>13 [Claude Managed Agents](https://platform.claude.com/docs/en/managed-agents/overview) supports geographic pinning at the agent level: `inference_geo` on an [agent's model configuration](https://platform.claude.com/docs/en/managed-agents/agent-setup#pin-the-inference-geo) pins the geography that serves model requests for sessions running that agent, with [per-session overrides](https://platform.claude.com/docs/en/managed-agents/sessions#pin-the-inference-geo-for-a-session) at session create. Agents without a pin follow the workspace's default inference geo on each request. Managed Agents also respects the Workspace geo configured in Console, and with [self-hosted sandboxes](https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes), tool execution and the sandbox filesystem stay on infrastructure you control; the contents of attached [memory stores](https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes#use-memory-stores) remain stored by Anthropic and are copied to your sandbox for the session.14</Note>1516## Inference geo1718<Note>19 To learn how zero data retention (ZDR) applies to this feature, see [API and data retention](https://platform.claude.com/docs/en/manage-claude/api-and-data-retention).20</Note>2122The `inference_geo` parameter controls where model inference runs for a specific API request. Add it to any `POST /v1/messages` call.2324| Value | Description |25| ---------- | ----------------------------------------------------------------------------------------------- |26| `"global"` | Default. Inference may run in any available geography for optimal performance and availability. |27| `"us"` | Inference runs only in US-based infrastructure. |2829### API usage3031<CodeGroup>32 ```bash cURL33 curl https://api.anthropic.com/v1/messages \34 -H "x-api-key: $ANTHROPIC_API_KEY" \35 -H "anthropic-version: 2023-06-01" \36 -H "content-type: application/json" \37 -d '{38 "model": "claude-opus-5",39 "max_tokens": 1024,40 "inference_geo": "us",41 "messages": [{42 "role": "user",43 "content": "Summarize the key points of this document."44 }]45 }'46 ```4748 ```bash CLI49 ant messages create \50 --model claude-opus-5 \51 --max-tokens 1024 \52 --inference-geo us \53 --message '{role: user, content: "Summarize the key points of this document."}' \54 --transform '{content.#(type=="text").text,usage.inference_geo}' --format yaml55 ```5657 ```python Python58 client = anthropic.Anthropic()5960 response = client.messages.create(61 model="claude-opus-5",62 max_tokens=1024,63 inference_geo="us",64 messages=[65 {"role": "user", "content": "Summarize the key points of this document."}66 ],67 )6869 for block in response.content:70 if block.type == "text":71 print(block.text)72 # Check where inference actually ran73 print(f"Inference geo: {response.usage.inference_geo}")74 ```7576 ```typescript TypeScript77 const client = new Anthropic();7879 const response = await client.messages.create({80 model: "claude-opus-5",81 max_tokens: 1024,82 inference_geo: "us",83 messages: [84 {85 role: "user",86 content: "Summarize the key points of this document."87 }88 ]89 });9091 const textBlock = response.content.find(92 (block): block is Anthropic.TextBlock => block.type === "text"93 );94 console.log(textBlock?.text);95 // Check where inference actually ran96 console.log(`Inference geo: ${response.usage.inference_geo}`);97 ```9899 ```csharp C#100 var client = new AnthropicClient();101102 var response = await client.Messages.Create(103 new MessageCreateParams104 {105 Model = Model.ClaudeOpus5,106 MaxTokens = 1024,107 InferenceGeo = "us",108 Messages =109 [110 new() { Role = Role.User, Content = "Summarize the key points of this document." },111 ],112 }113 );114115 foreach (var block in response.Content)116 {117 if (block.TryPickText(out var textBlock))118 {119 Console.WriteLine(textBlock.Text);120 }121 }122123 // Check where inference actually ran124 Console.WriteLine($"Inference geo: {response.Usage.InferenceGeo}");125 ```126127 ```go Go128 client := anthropic.NewClient()129130 message, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{131 Model: anthropic.ModelClaudeOpus5,132 MaxTokens: 1024,133 InferenceGeo: anthropic.String("us"),134 Messages: []anthropic.MessageParam{135 anthropic.NewUserMessage(anthropic.NewTextBlock("Summarize the key points of this document.")),136 },137 })138 if err != nil {139 log.Fatal(err)140 }141142 for _, block := range message.Content {143 if textBlock, ok := block.AsAny().(anthropic.TextBlock); ok {144 fmt.Println(textBlock.Text)145 }146 }147 // Check where inference actually ran148 fmt.Printf("Inference geo: %s\n", message.Usage.InferenceGeo)149 ```150151 ```java Java152 AnthropicClient client = AnthropicOkHttpClient.fromEnv();153154 Message response = client.messages().create(155 MessageCreateParams.builder()156 .model(Model.CLAUDE_OPUS_5)157 .maxTokens(1024L)158 .inferenceGeo("us")159 .addUserMessage("Summarize the key points of this document.")160 .build());161162 response.content().stream()163 .flatMap(block -> block.text().stream())164 .forEach(textBlock -> IO.println(textBlock.text()));165 // Check where inference actually ran166 IO.println("Inference geo: " + response.usage().inferenceGeo().get());167 ```168169 ```php PHP170 $client = new Client();171172 $response = $client->messages->create(173 model: 'claude-opus-5',174 maxTokens: 1024,175 inferenceGeo: 'us',176 messages: [177 ['role' => 'user', 'content' => 'Summarize the key points of this document.'],178 ],179 );180181 foreach ($response->content as $block) {182 if ($block->type === 'text') {183 echo $block->text, PHP_EOL;184 }185 }186 // Check where inference actually ran187 echo "Inference geo: {$response->usage->inferenceGeo}\n";188 ```189190 ```ruby Ruby191 client = Anthropic::Client.new192193 response = client.messages.create(194 model: "claude-opus-5",195 max_tokens: 1024,196 inference_geo: "us",197 messages: [198 {role: "user", content: "Summarize the key points of this document."}199 ]200 )201202 response.content.each do |block|203 puts block.text if block.type == :text204 end205 # Check where inference actually ran206 puts "Inference geo: #{response.usage.inference_geo}"207 ```208</CodeGroup>209210### Response211212The response `usage` object includes an `inference_geo` field indicating where inference ran:213214```json Output215{216 "usage": {217 "input_tokens": 25,218 "output_tokens": 150,219 "inference_geo": "us"220 }221}222```223224### Model availability225226The `inference_geo` parameter is supported on Claude 4.6 and later models. Requests with `inference_geo` on Claude Opus 4.5, Claude Sonnet 4.5, Claude Haiku 4.5, or earlier models return a 400 error.227228<Note>229 The `inference_geo` parameter is available on the Claude API (first-party) and [Claude Platform on AWS](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws). On Amazon Bedrock and Google Cloud, the inference region is determined by the endpoint URL or inference profile, so `inference_geo` is not applicable. On [Claude in Microsoft Foundry](https://platform.claude.com/docs/en/build-with-claude/claude-in-microsoft-foundry), `inference_geo` is likewise not applicable: deployments hosted on Azure can instead use the US Data Zone Standard deployment type, which keeps inference within the United States. The `inference_geo` parameter is also not available through the [OpenAI SDK compatibility endpoint](https://platform.claude.com/docs/en/cli-sdks-libraries/libraries/openai-sdk).230</Note>231232### Workspace-level restrictions233234Workspace settings also support restricting which inference geos are available:235236* **`allowed_inference_geos`:** Restricts which geos a workspace can use. If a request specifies an `inference_geo` not in this list, the API returns an error.237* **`default_inference_geo`:** Sets the fallback geo when `inference_geo` is omitted from a request. Individual requests can override this by setting `inference_geo` explicitly.238239These settings can be configured through the Console or the [Admin API](https://platform.claude.com/docs/en/manage-claude/admin-api) under the `data_residency` field.240241## Workspace geo242243Workspace geo is set when you create a workspace and can't be changed afterward. Currently, `"us"` is the only available workspace geo.244245To set workspace geo, create a new workspace in the [Console](https://platform.claude.com):2462471. Go to **Settings** > **Workspaces**.2482. Create a new workspace.2493. Select the workspace geo.250251<Note>252 **Claude Platform on AWS:** Workspace geo is not configurable. Claude Managed Agents sessions on this platform run with an effective Workspace geo of `"us"`, which is currently the only available workspace geo. See [Claude Platform on AWS](https://platform.claude.com/docs/en/build-with-claude/claude-platform-on-aws) for data residency considerations specific to that platform.253</Note>254255## Pricing256257Data residency pricing varies by model generation:258259* **Claude 4.6 and later models:** US-only inference (`inference_geo: "us"`) is priced at 1.1x the standard rate across all token pricing categories (input tokens, output tokens, cache writes, and cache reads).260* **Global routing** (`inference_geo: "global"`): Standard pricing applies.261* **Older models:** Don't support `inference_geo` (see [Model availability](https://platform.claude.com/docs/en/manage-claude/data-residency#model-availability)); standard pricing applies. Requests that include the parameter return a 400 error.262263This pricing applies to the Claude API (first-party) and Claude Platform on AWS. On Claude in Microsoft Foundry, the same 1.1x multiplier applies to deployments hosted on Azure that use the US Data Zone Standard deployment type. Partner-operated platforms (Bedrock and Google Cloud) have their own regional pricing. See [Data residency pricing](https://platform.claude.com/docs/en/about-claude/pricing#data-residency-pricing) for details.264265The same multiplier applies to [Claude Managed Agents](https://platform.claude.com/docs/en/managed-agents/overview): when an agent's [model configuration](https://platform.claude.com/docs/en/managed-agents/agent-setup) pins `inference_geo` to `"us"`, model requests in sessions running that agent are priced at 1.1x the standard rate.266267<Note>268 If you have a [Priority Tier](https://platform.claude.com/docs/en/api/service-tiers) commitment, the 1.1x multiplier for US-only inference also affects how tokens are counted against your Priority Tier capacity. Each token consumed with `inference_geo: "us"` draws down 1.1 tokens from your committed TPM, consistent with how other pricing multipliers (such as prompt caching) affect burndown rates.269</Note>270271## Batch API support272273The `inference_geo` parameter is supported on the [Batch API](https://platform.claude.com/docs/en/build-with-claude/batch-processing). Each request in a batch can specify its own `inference_geo` value.274275## Migration from legacy opt-outs276277If your organization previously opted out of global routing to keep inference in the US, your workspace has been automatically configured with `allowed_inference_geos: ["us"]` and `default_inference_geo: "us"`. No code changes are required. Your existing data residency requirements continue to be enforced through the new geo controls.278279### What changed280281The legacy opt-out was an organization-level setting that restricted all requests to US-based infrastructure. The new data residency controls replace this with two mechanisms:282283* **Per-request control:** The `inference_geo` parameter lets you specify `"us"` or `"global"` on each API call, giving you request-level flexibility.284* **Workspace controls:** The `default_inference_geo` and `allowed_inference_geos` settings in the Console let you enforce geo policies across all keys in a workspace.285286### What happened to your workspace287288Your workspace was migrated automatically:289290| Legacy setting | New equivalent |291| -------------------------------- | --------------------------------------------------------------- |292| Global routing opt-out (US only) | `allowed_inference_geos: ["us"]`, `default_inference_geo: "us"` |293294All API requests using keys from your workspace continue to run on US-based infrastructure. No action is needed to maintain your current behavior.295296### If you want to use global routing297298If your data residency requirements have changed and you want to take advantage of global routing for better performance and availability, update your workspace's inference geo settings to include `"global"` in the allowed geos and set `default_inference_geo` to `"global"`. See [Workspace-level restrictions](https://platform.claude.com/docs/en/manage-claude/data-residency#workspace-level-restrictions) for details.299300### Pricing impact301302Legacy models are unaffected by this migration. For current pricing on newer models, see [Pricing](https://platform.claude.com/docs/en/manage-claude/data-residency#pricing).303304## Current limitations305306* **Shared rate limits:** Rate limits are shared across all geos.307* **Inference geo:** Only `"us"` and `"global"` are available.308* **Workspace geo:** Only `"us"` is currently available. Workspace geo can't be changed after workspace creation.309310## Next steps311312<CardGroup>313 <Card title="Pricing" icon="dollar-sign" href="https://platform.claude.com/docs/en/about-claude/pricing#data-residency-pricing">314 View data residency pricing details.315 </Card>316317 <Card title="Workspaces" icon="building" href="https://platform.claude.com/docs/en/manage-claude/workspaces">318 Learn about workspace configuration.319 </Card>320321 <Card title="Usage and Cost API" icon="chart" href="https://platform.claude.com/docs/en/manage-claude/usage-cost-api">322 Track usage and costs by data residency.323 </Card>324</CardGroup>325