Loading...
  • 建構
  • 管理
  • 模型與定價
  • 客戶端 SDK
  • API 參考
Search...
⌘K
Log in
資料駐留
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Solutions

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

Partners

  • Amazon Bedrock
  • Google Cloud's Vertex AI

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
管理

資料駐留

使用地理位置控制來管理模型推理執行位置和資料儲存位置。

This feature is eligible for Zero Data Retention (ZDR). When your organization has a ZDR arrangement, data sent through this feature is not stored after the API response is returned.

資料駐留控制可讓您管理資料的處理和儲存位置。兩個獨立的設定控制此功能:

  • 推理地理位置: 控制模型推理在何處執行,以每個請求為基礎。透過 inference_geo API 參數或工作區預設值設定。
  • 工作區地理位置: 控制資料在靜止狀態下的儲存位置,以及端點處理(影像轉碼、程式碼執行等)發生的位置。在 Console 的工作區層級進行設定。

推理地理位置

inference_geo 參數控制特定 API 請求的模型推理執行位置。將其新增至任何 POST /v1/messages 呼叫。

值說明
"global"預設值。推理可能在任何可用的地理位置執行,以獲得最佳效能和可用性。
"us"推理僅在美國基礎設施上執行。

API 使用

client = anthropic.Anthropic()

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

print(response.content[0].text)
# Check where inference actually ran
print(f"Inference geo: {response.usage.inference_geo}")

回應

回應 usage 物件包含一個 inference_geo 欄位,指示推理執行的位置:

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

模型可用性

inference_geo 參數在 Claude Opus 4.6 及所有後續模型上受支援。在 Opus 4.6 之前發佈的舊版模型不支援此參數。在舊版模型上使用 inference_geo 的請求會傳回 400 錯誤。

inference_geo 參數僅在 Claude API (1P) 上可用。在第三方平台(AWS Bedrock、Google Vertex AI)上,推理區域由端點 URL 或推理設定檔決定,因此 inference_geo 不適用。inference_geo 參數也無法透過 OpenAI SDK 相容性端點 使用。

工作區層級限制

工作區設定也支援限制可用的推理地理位置:

  • allowed_inference_geos: 限制工作區可以使用的地理位置。如果請求指定的 inference_geo 不在此清單中,API 會傳回錯誤。
  • default_inference_geo: 設定當請求中省略 inference_geo 時的後備地理位置。個別請求可以透過明確設定 inference_geo 來覆蓋此設定。

這些設定可以透過 Console 或 Admin API 在 data_residency 欄位下進行設定。

工作區地理位置

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

若要設定工作區地理位置,請在 Console 中建立新工作區:

  1. 前往 Settings > Workspaces。
  2. 建立新工作區。
  3. 選擇工作區地理位置。

定價

資料駐留定價因模型世代而異:

  • Claude Opus 4.6 及更新版本: 僅限美國的推理(inference_geo: "us")的定價為標準費率的 1.1 倍,涵蓋所有代幣定價類別(輸入代幣、輸出代幣、快取寫入和快取讀取)。
  • 全球路由(inference_geo: "global" 或省略):適用標準定價。
  • 舊版模型: 無論 inference_geo 設定如何,現有定價保持不變。

此定價僅適用於 Claude API (1P)。第三方平台(AWS Bedrock、Google Vertex AI)有其自己的區域定價。詳見 定價頁面。

如果您使用 Priority Tier,僅限美國推理的 1.1 倍乘數也會影響代幣如何計入您的 Priority Tier 容量。使用 inference_geo: "us" 消耗的每個代幣會從您的承諾 TPM 中扣除 1.1 個代幣,與其他定價乘數(例如提示快取)影響燃盡率的方式一致。

Batch API 支援

inference_geo 參數在 Batch API 上受支援。批次中的每個請求都可以指定其自己的 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"。詳見 工作區層級限制。

定價影響

舊版模型不受此遷移影響。如需較新模型的目前定價,請參閱 定價。

目前的限制

  • 共用速率限制: 速率限制在所有地理位置之間共用。
  • 推理地理位置: 啟動時僅提供 "us" 和 "global"。其他區域將隨著時間推移而新增。
  • 工作區地理位置: 目前僅提供 "us"。工作區建立後無法變更工作區地理位置。

後續步驟

定價

檢視資料駐留定價詳細資訊。

工作區

瞭解工作區設定。

使用量和成本 API

按資料駐留追蹤使用量和成本。

Was this page helpful?

  • API 使用
  • Batch API 支援