Claude Platform Docs
  • Messages
  • Managed Agents
  • 管理

Search...
⌘K

Log in
Beta 標頭
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
API 參考/使用 API

Beta 標頭

搭配 Claude API 使用 beta 標頭的說明文件

Beta 標頭讓您能夠在實驗性功能和新模型能力成為標準 API 的一部分之前搶先使用。

這些功能可能會有所變動,並可能在未來版本中被修改或移除。



Beta 標頭通常與每個用戶端 SDK 所公開的 beta 命名空間搭配使用。

如何使用 beta 標頭

若要存取 beta 功能,請在您的 API 請求中包含 anthropic-beta 標頭:

POST /v1/messages
Content-Type: application/json
X-API-Key: YOUR_API_KEY
anthropic-beta: BETA_FEATURE_NAME

使用 SDK 時,您可以在請求選項中指定 beta 標頭:

client = Anthropic()

response = client.beta.messages.create(
    model="claude-opus-4-8",
    max_tokens=1024,
    messages=[{"role": "user", "content": "Hello, Claude"}],
    betas=["files-api-2025-04-14"],
)


Beta 功能屬於實驗性質,可能會:

  • 在通知後發生重大變更
  • 被棄用或移除
  • 具有不同的速率限制或定價
  • 並非在所有地區皆可使用

多個 beta 功能

若要在單一請求中使用多個 beta 功能,請在標頭中包含所有功能名稱,並以逗號分隔:

anthropic-beta: feature1,feature2,feature3

端點專屬標頭

某些 beta 功能的適用範圍是特定端點,而非個別請求參數,因此每個請求都需要包含該功能專屬的 beta 標頭:

端點Beta 標頭
/v1/agents、/v1/sessions、/v1/environmentsmanaged-agents-2026-04-01

詳情請參閱 Managed Agents 概覽。

版本命名慣例

Beta 功能名稱通常遵循以下模式:feature-name-YYYY-MM-DD,其中日期表示該 beta 版本的發布時間。請務必使用文件中記載的確切 beta 功能名稱。

錯誤處理

如果您使用無效或不可用的 beta 標頭,將會收到錯誤回應:

Output
{
  "type": "error",
  "error": {
    "type": "invalid_request_error",
    "message": "Unsupported beta header: invalid-beta-name"
  }
}

取得協助

如有關於 beta 功能的問題:

  1. 查閱該特定功能的說明文件
  2. 檢視 API 變更日誌以取得更新資訊
  3. 聯絡支援團隊以取得正式環境使用方面的協助

請注意,beta 功能是以「現狀」提供,可能不具備與穩定 API 功能相同的 SLA 保證。

Was this page helpful?

  • 如何使用 beta 標頭
  • 多個 beta 功能
  • 端點專屬標頭
  • 版本命名慣例
  • 錯誤處理
  • 取得協助