---
title: 資料駐留
url: https://platform.claude.com/docs/zh-TW/manage-claude/data-residency
description: 透過地理控制管理模型推論的執行位置以及資料的儲存位置。
---

「Data residency」（資料駐留）控制讓您管理資料的處理與儲存位置。這由兩個獨立的設定管理：

* **Inference geo（推論地理區域）：** 以每個請求為單位，控制模型推論的執行位置。透過 `inference_geo` API 參數設定，或設為工作區預設值。
* **Workspace geo（工作區地理區域）：** 控制靜態資料的儲存位置，以及端點處理（例如影像轉碼與程式碼執行）的發生位置。在 [Claude Console](https://platform.claude.com) 中於工作區層級設定。

<Note>
  [Claude Managed Agents](https://platform.claude.com/docs/zh-TW/managed-agents/overview) 支援在代理層級固定地理區域：[代理的模型設定](https://platform.claude.com/docs/zh-TW/managed-agents/agent-setup#pin-the-inference-geo)上的 `inference_geo` 會固定為執行該代理之工作階段提供模型請求服務的地理區域，並可在建立工作階段時進行[每個工作階段的覆寫](https://platform.claude.com/docs/zh-TW/managed-agents/sessions#pin-the-inference-geo-for-a-session)。未固定地理區域的代理在每個請求上會遵循工作區的預設推論地理區域。Managed Agents 也會遵守在 Console 中設定的工作區地理區域，而使用[自行託管的沙箱](https://platform.claude.com/docs/zh-TW/managed-agents/self-hosted-sandboxes)時，工具執行和沙箱檔案系統會保留在您控制的基礎架構上；所附加之[記憶體儲存區](https://platform.claude.com/docs/zh-TW/managed-agents/self-hosted-sandboxes-memory)的內容仍由 Anthropic 儲存，並會在工作階段期間複製到您的沙箱中。
</Note>

## 推論地理區域

<Note>
  若要了解「zero data retention」（零資料保留），即 ZDR 如何適用於此功能，請參閱 [API 與資料保留](https://platform.claude.com/docs/zh-TW/manage-claude/api-and-data-retention)。
</Note>

`inference_geo` 參數控制特定 API 請求的模型推論執行位置。將其加入任何 `POST /v1/messages` 呼叫即可。

| 值          | 說明                               |
| ---------- | -------------------------------- |
| `"global"` | 預設值。推論可在任何可用的地理區域執行，以獲得最佳效能與可用性。 |
| `"us"`     | 推論僅在位於美國的基礎設施上執行。                |

### API 用法

<CodeGroup>
  ```bash cURL
  curl https://api.anthropic.com/v1/messages \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01" \
    -H "content-type: application/json" \
    -d '{
      "model": "claude-opus-5-5",
      "max_tokens": 1024,
      "inference_geo": "us",
      "messages": [{
        "role": "user",
        "content": "Summarize the key points of this document."
      }]
    }'
  ```

  ```bash CLI
  ant messages create \
    --model claude-opus-5-5 \
    --max-tokens 1024 \
    --inference-geo us \
    --message '{role: user, content: "Summarize the key points of this document."}' \
    --transform '{content.#(type=="text").text,usage.inference_geo}' --format yaml
  ```

  ```python Python
  client = anthropic.Anthropic()

  response = client.messages.create(
      model="claude-opus-5-5",
      max_tokens=1024,
      inference_geo="us",
      messages=[
          {"role": "user", "content": "Summarize the key points of this document."}
      ],
  )

  for block in response.content:
      if block.type == "text":
          print(block.text)
  # 檢查推論實際執行的位置
  print(f"Inference geo: {response.usage.inference_geo}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const response = await client.messages.create({
    model: "claude-opus-5-5",
    max_tokens: 1024,
    inference_geo: "us",
    messages: [
      {
        role: "user",
        content: "Summarize the key points of this document."
      }
    ]
  });

  const textBlock = response.content.find(
    (block): block is Anthropic.TextBlock => block.type === "text"
  );
  console.log(textBlock?.text);
  // 檢查推論實際執行的位置
  console.log(`Inference geo: ${response.usage.inference_geo}`);
  ```

  ```csharp C#
  var client = new AnthropicClient();

  var response = await client.Messages.Create(
      new MessageCreateParams
      {
          Model = Model.ClaudeOpus5_5,
          MaxTokens = 1024,
          InferenceGeo = "us",
          Messages =
          [
              new() { Role = Role.User, Content = "Summarize the key points of this document." },
          ],
      }
  );

  foreach (var block in response.Content)
  {
      if (block.TryPickText(out var textBlock))
      {
          Console.WriteLine(textBlock.Text);
      }
  }

  // 檢查推論實際執行的位置
  Console.WriteLine($"Inference geo: {response.Usage.InferenceGeo}");
  ```

  ```go Go
  client := anthropic.NewClient()

  message, err := client.Messages.New(context.Background(), anthropic.MessageNewParams{
  	Model:        anthropic.ModelClaudeOpus5_5,
  	MaxTokens:    1024,
  	InferenceGeo: anthropic.String("us"),
  	Messages: []anthropic.MessageParam{
  		anthropic.NewUserMessage(anthropic.NewTextBlock("Summarize the key points of this document.")),
  	},
  })
  if err != nil {
  	log.Fatal(err)
  }

  for _, block := range message.Content {
  	if textBlock, ok := block.AsAny().(anthropic.TextBlock); ok {
  		fmt.Println(textBlock.Text)
  	}
  }
  // 檢查推論實際執行的位置
  fmt.Printf("Inference geo: %s\n", message.Usage.InferenceGeo)
  ```

  ```java Java
  AnthropicClient client = AnthropicOkHttpClient.fromEnv();

  Message response = client.messages().create(
          MessageCreateParams.builder()
                  .model(Model.CLAUDE_OPUS_5_5)
                  .maxTokens(1024L)
                  .inferenceGeo("us")
                  .addUserMessage("Summarize the key points of this document.")
                  .build());

  response.content().stream()
          .flatMap(block -> block.text().stream())
          .forEach(textBlock -> IO.println(textBlock.text()));
  // 檢查推論實際執行的位置
  IO.println("Inference geo: " + response.usage().inferenceGeo().get());
  ```

  ```php PHP
  $client = new Client();

  $response = $client->messages->create(
      model: 'claude-opus-5-5',
      maxTokens: 1024,
      inferenceGeo: 'us',
      messages: [
          ['role' => 'user', 'content' => 'Summarize the key points of this document.'],
      ],
  );

  foreach ($response->content as $block) {
      if ($block->type === 'text') {
          echo $block->text, PHP_EOL;
      }
  }
  // 檢查推論實際執行的位置
  echo "Inference geo: {$response->usage->inferenceGeo}\n";
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  response = client.messages.create(
    model: "claude-opus-5-5",
    max_tokens: 1024,
    inference_geo: "us",
    messages: [
      {role: "user", content: "Summarize the key points of this document."}
    ]
  )

  response.content.each do |block|
    puts block.text if block.type == :text
  end
  # 檢查推論實際執行的位置
  puts "Inference geo: #{response.usage.inference_geo}"
  ```
</CodeGroup>

### 回應

回應的 `usage` 物件包含一個 `inference_geo` 欄位，指出推論的執行位置：

```json Output
{
  "usage": {
    "input_tokens": 25,
    "output_tokens": 150,
    "inference_geo": "us"
  }
}
```

### 模型可用性

`inference_geo` 參數支援 Claude 4.6 及更新的模型。在 Claude Opus 4.5、Claude Sonnet 4.5（已棄用）、Claude Haiku 4.5 或更早的模型上使用 `inference_geo` 的請求會傳回 400 錯誤。

<Note>
  `inference_geo` 參數可在 Claude API（第一方）與 [Claude Platform on AWS](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-platform-on-aws) 上使用。在 Amazon Bedrock 與 Google Cloud 上，推論區域由端點 URL 或推論設定檔決定，因此 `inference_geo` 不適用。在 [Claude in Microsoft Foundry](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-in-microsoft-foundry) 上，`inference_geo` 同樣不適用：託管於 Azure 的部署可改用 US Data Zone Standard 部署類型，將推論保留在美國境內。`inference_geo` 參數也無法透過 [OpenAI SDK 相容性端點](https://platform.claude.com/docs/zh-TW/cli-sdks-libraries/libraries/openai-sdk)使用。
</Note>

### 工作區層級限制

工作區設定也支援限制可用的推論地理區域：

* **`allowed_inference_geos`：** 限制工作區可使用的地理區域。若請求指定的 `inference_geo` 不在此清單中，API 會傳回錯誤。
* **`default_inference_geo`：** 設定請求中省略 `inference_geo` 時的後備地理區域。個別請求可透過明確設定 `inference_geo` 來覆寫此值。

這些設定可透過 Console 或 [Admin API](https://platform.claude.com/docs/zh-TW/manage-claude/admin-api) 在 `data_residency` 欄位下進行設定。

## 工作區地理區域

工作區地理區域在您建立工作區時設定，之後無法變更。目前，`"us"` 是唯一可用的工作區地理區域。

若要設定工作區地理區域，請在 [Console](https://platform.claude.com) 中建立新的工作區：

1. 在 Console 中，前往 [Workspaces](https://platform.claude.com/settings/workspaces) 頁面（`platform.claude.com/settings/workspaces`）。
2. 點擊 **Create workspace**，在 Console 中開啟 [Create workspace](https://platform.claude.com/settings/workspaces/new) 頁面（`platform.claude.com/settings/workspaces/new`）。
3. 輸入名稱，確認 **Workspace geo** 欄位中的值，然後點擊 **Create workspace**。

<Note>
  **Claude Platform on AWS：** 工作區地理區域無法設定。此平台上的 Claude Managed Agents 工作階段以 `"us"` 作為實際生效的 Workspace geo 執行，這也是目前唯一可用的工作區地理區域。請參閱 [Claude Platform on AWS](https://platform.claude.com/docs/zh-TW/build-with-claude/claude-platform-on-aws) 以了解該平台特有的資料駐留考量。
</Note>

## 定價

資料駐留定價依模型世代而異：

* **Claude 4.6 及更新的模型：** 僅限美國的推論（`inference_geo: "us"`）在所有權杖定價類別（輸入權杖、輸出權杖、快取寫入和快取讀取）中的價格為標準費率的 1.1 倍。在 Claude Haiku 5.5 上，此乘數也適用於超過 100,000 個權杖之提示的較高價格（請參閱[長上下文定價](https://platform.claude.com/docs/zh-TW/about-claude/pricing#long-context-pricing)）。
* **全球路由**（`inference_geo: "global"`）：適用標準定價。
* **較舊的模型：** 不支援 `inference_geo`（請參閱[模型可用性](https://platform.claude.com/docs/zh-TW/manage-claude/data-residency#model-availability)）；適用標準定價。包含此參數的請求會傳回 400 錯誤。

此定價適用於 Claude API（第一方）與 Claude Platform on AWS。在 Claude in Microsoft Foundry 上，相同的 1.1 倍乘數適用於託管於 Azure 且使用 US Data Zone Standard 部署類型的部署。由合作夥伴營運的平台（Bedrock 與 Google Cloud）有其各自的區域定價。詳情請參閱[資料駐留定價](https://platform.claude.com/docs/zh-TW/about-claude/pricing#data-residency-pricing)。

相同的乘數也適用於 [Claude Managed Agents](https://platform.claude.com/docs/zh-TW/managed-agents/overview)：當代理的[模型設定](https://platform.claude.com/docs/zh-TW/managed-agents/agent-setup)將 `inference_geo` 釘選為 `"us"` 時，執行該代理之工作階段中的模型請求會以標準費率的 1.1 倍計價。

<Note>
  若您有 [Priority Tier](https://platform.claude.com/docs/zh-TW/api/service-tiers) 承諾，僅限美國推論的 1.1 倍乘數也會影響權杖計入您 Priority Tier 容量的方式。每個以 `inference_geo: "us"` 消耗的權杖會從您承諾的 TPM 中扣除 1.1 個權杖，這與其他定價乘數（例如提示快取）影響消耗速率的方式一致。
</Note>

## Batch API 支援

[Batch API](https://platform.claude.com/docs/zh-TW/build-with-claude/batch-processing) 支援 `inference_geo` 參數。批次中的每個請求都可以指定自己的 `inference_geo` 值。

## 從舊版選擇退出機制遷移

若您的組織先前曾選擇退出全球路由以將推論保留在美國，您的工作區已自動設定為 `allowed_inference_geos: ["us"]` 與 `default_inference_geo: "us"`。無需變更任何程式碼。您現有的資料駐留要求會繼續透過新的地理控制強制執行。

### 變更內容

舊版選擇退出是一項組織層級的設定，會將所有請求限制在位於美國的基礎設施上。新的資料駐留控制以兩種機制取代它：

* **每個請求的控制：** `inference_geo` 參數讓您在每次 API 呼叫中指定 `"us"` 或 `"global"`，提供請求層級的彈性。
* **工作區控制：** Console 中的 `default_inference_geo` 與 `allowed_inference_geos` 設定讓您對工作區中的所有金鑰強制執行地理政策。

### 您的工作區發生了什麼變化

您的工作區已自動遷移：

| 舊版設定           | 新的對應設定                                                         |
| -------------- | -------------------------------------------------------------- |
| 全球路由選擇退出（僅限美國） | `allowed_inference_geos: ["us"]`、`default_inference_geo: "us"` |

所有使用您工作區金鑰的 API 請求會繼續在位於美國的基礎設施上執行。無需採取任何行動即可維持您目前的行為。

### 若您想使用全球路由

若您的資料駐留要求已變更，且您想利用全球路由以獲得更佳的效能與可用性，請更新您工作區的推論地理區域設定，將 `"global"` 納入允許的地理區域，並將 `default_inference_geo` 設為 `"global"`。詳情請參閱[工作區層級限制](https://platform.claude.com/docs/zh-TW/manage-claude/data-residency#workspace-level-restrictions)。

### 定價影響

舊版模型不受此次遷移影響。如需較新模型的目前定價，請參閱[定價](https://platform.claude.com/docs/zh-TW/manage-claude/data-residency#pricing)。

## 目前限制

* **共用速率限制：** 速率限制在所有地理區域之間共用。
* **推論地理區域：** 僅提供 `"us"` 與 `"global"`。
* **工作區地理區域：** 目前僅提供 `"us"`。工作區地理區域在工作區建立後無法變更。

## 後續步驟

<CardGroup>
  <Card title="定價" icon="dollar-sign" href="https://platform.claude.com/docs/zh-TW/about-claude/pricing#data-residency-pricing">
    檢視資料駐留定價詳情。
  </Card>

  <Card title="工作區" icon="building" href="https://platform.claude.com/docs/zh-TW/manage-claude/workspaces">
    了解工作區設定。
  </Card>

  <Card title="用量與成本 API" icon="chart" href="https://platform.claude.com/docs/zh-TW/manage-claude/usage-cost-api">
    依資料駐留追蹤用量與成本。
  </Card>
</CardGroup>
