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 支持