• 訊息
  • 託管代理
  • 管理
Search...
⌘K
組織
Admin API工作區
驗證
概覽工作負載身分聯合WIF 參考
監控
用量與成本 API速率限制 APIClaude Code 分析 API
資料與合規
資料駐留API 與資料保留
合規 API
概覽取得存取權活動動態對話、檔案與專案組織、使用者、角色與群組設計您的整合錯誤常見問題
Log in
速率限制 API
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
管理/監控

速率限制 API

使用速率限制 API 以程式化方式查詢您組織的 API 速率限制。

Admin API 不適用於個人帳戶。 若要與團隊成員協作並新增成員,請在 Console → Settings → Organization 中設定您的組織。

速率限制 API 提供程式化存取,讓您查詢為您的組織及其工作區所設定的速率限制。這與 Claude Console 中 Limits 頁面所顯示的資訊相同。

使用此 API 可以:

  • 讓閘道器和代理伺服器保持同步: 在啟動時和定期排程中讀取您目前的限制,而不是硬編碼那些會在 Anthropic 調整時產生偏差的數值。
  • 支援內部警示: 將來自 Usage and Cost API 的使用量資料與您設定的限制進行比較。
  • 稽核工作區設定: 驗證工作區覆寫設定是否符合您的佈建自動化所預期的內容。

需要 Admin API 金鑰

此 API 是 Admin API 的一部分。這些端點需要 Admin API 金鑰(以 sk-ant-admin... 開頭),與標準 API 金鑰不同。只有具備管理員角色的組織成員才能透過 Claude Console 佈建 Admin API 金鑰。

快速開始

列出為您的組織設定的速率限制:

cURL
curl "https://api.anthropic.com/v1/organizations/rate_limits" \
  --header "anthropic-version: 2023-06-01" \
  --header "x-api-key: $ANTHROPIC_ADMIN_KEY"

組織速率限制

/v1/organizations/rate_limits 端點會回傳在組織層級套用於 Messages API 及其支援資源的速率限制。其他產品的限制(例如 Claude Managed Agents)不包含在內。

關鍵概念

  • 速率限制群組: 回應中的每個項目代表一個速率限制群組。模型速率限制會被分組,使多個模型版本共用同一組限制,而其他群組則涵蓋諸如 Message Batches API、Files API、Token Counting API、代理技能以及網頁搜尋工具等資源。
  • group_type: 識別該項目涵蓋的限制類別。請參閱依群組類型篩選以取得值的清單。
  • models 清單: 對於 model_group 項目,models 欄位會列出計入該群組限制的每個模型 ID 和別名。使用此清單來查詢任何模型字串屬於哪個群組。對於其他群組類型,models 為 null。
  • limits 清單: 每個群組都帶有一個 {type, value} 配對的清單。type 欄位識別限制器(例如 requests_per_minute、input_tokens_per_minute 或 output_tokens_per_minute),而 value 是設定的限制值。請參閱速率限制以了解每個限制器的測量和執行方式。

如需完整的參數詳細資訊和回應結構描述,請參閱 Organization Rate Limits API 參考文件。

列出所有組織速率限制

cURL
curl "https://api.anthropic.com/v1/organizations/rate_limits" \
  --header "anthropic-version: 2023-06-01" \
  --header "x-api-key: $ANTHROPIC_ADMIN_KEY"
{
  "data": [
    {
      "type": "rate_limit",
      "group_type": "model_group",
      "models": [
        "claude-opus-4-5",
        "claude-opus-4-5-20251101",
        "claude-opus-4-6",
        "claude-opus-4-7",
        "claude-opus-4-8"
      ],
      "limits": [
        { "type": "requests_per_minute", "value": 4000 },
        { "type": "input_tokens_per_minute", "value": 10000000 },
        { "type": "output_tokens_per_minute", "value": 800000 }
      ]
    },
    {
      "type": "rate_limit",
      "group_type": "batch",
      "models": null,
      "limits": [{ "type": "enqueued_batch_requests", "value": 500000 }]
    }
  ],
  "next_page": null
}

查詢特定模型的限制

將任何模型 ID 或別名作為 model 查詢參數傳入,即可僅回傳包含該模型的項目:

cURL
curl "https://api.anthropic.com/v1/organizations/rate_limits?model=claude-opus-4-8" \
  --header "anthropic-version: 2023-06-01" \
  --header "x-api-key: $ANTHROPIC_ADMIN_KEY"

如果模型字串不符合任何群組,端點會回傳 404 錯誤。model 參數僅在組織端點上支援;工作區端點不接受此參數。

工作區速率限制

/v1/organizations/workspaces/{workspace_id}/rate_limits 端點會回傳為單一工作區設定的速率限制覆寫。

回應僅包含覆寫設定,因此任何未出現在回應中的內容都會從組織繼承:

  • 在 data 中不存在的群組表示完全沒有工作區覆寫。該工作區會繼承該群組的組織層級限制(並非無限制)。
  • 在存在的群組中,limits[] 中不存在的限制器類型表示該限制器沒有工作區覆寫。工作區會繼承該限制器的組織值。
  • 對於每個存在的限制器,org_limit 是同一限制器的組織層級值,如果組織沒有為該限制器類型設定限制,則為 null。

如需完整的參數詳細資訊和回應結構描述,請參閱 Workspace Rate Limits API 參考文件。

若要擷取您組織的工作區 ID,請使用 List Workspaces 端點,或在 Claude Console 中查找。預設工作區無法設定速率限制覆寫,因此在此端點上沒有對應項目;請使用組織端點來讀取其限制。

cURL
curl "https://api.anthropic.com/v1/organizations/workspaces/wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ/rate_limits" \
  --header "anthropic-version: 2023-06-01" \
  --header "x-api-key: $ANTHROPIC_ADMIN_KEY"
{
  "data": [
    {
      "type": "workspace_rate_limit",
      "group_type": "model_group",
      "models": [
        "claude-opus-4-5",
        "claude-opus-4-5-20251101",
        "claude-opus-4-6",
        "claude-opus-4-7",
        "claude-opus-4-8"
      ],
      "limits": [
        { "type": "requests_per_minute", "value": 1000, "org_limit": 4000 },
        { "type": "input_tokens_per_minute", "value": 500000, "org_limit": 10000000 }
      ]
    }
  ],
  "next_page": null
}

依群組類型篩選

兩個端點都接受選用的 group_type 查詢參數,可將回應限制為單一類別:

cURL
curl "https://api.anthropic.com/v1/organizations/rate_limits?group_type=batch" \
  --header "anthropic-version: 2023-06-01" \
  --header "x-api-key: $ANTHROPIC_ADMIN_KEY"

有效值為 model_group、batch、token_count、files、skills 和 web_search。

分頁

兩個端點都接受 page 查詢參數並回傳 next_page 欄位。目前回應一律為單一頁面,因此 next_page 為 null。請針對 next_page 進行迴圈處理,如此當回應內容增加時,您的用戶端無需變更即可正確分頁。

常見問題

models 清單中會出現哪些模型字串?

計入該群組的每個模型 ID 和別名,包括帶日期的 ID(例如 claude-sonnet-4-5-20250929)和不帶日期的別名(例如 claude-sonnet-4-5)。查詢您傳遞給 Messages API 的任何模型字串,您會在恰好一個 model_group 項目中找到它。

如果工作區回應中缺少某個群組,這代表什麼?

該工作區沒有該群組的覆寫設定,並繼承組織層級的限制。請查詢組織端點以查看繼承的值。

我可以使用此 API 更新速率限制嗎?

不行。若要設定工作區速率限制,請在 Claude Console 中開啟工作區並使用 Limits 分頁。

另請參閱

  • 速率限制
  • Admin API
  • Admin API 參考文件
  • 工作區
  • Usage and Cost API

Was this page helpful?

  • 快速開始
  • 組織速率限制
  • 關鍵概念
  • 列出所有組織速率限制
  • 查詢特定模型的限制
  • 工作區速率限制
  • 依群組類型篩選
  • 分頁
  • 常見問題
  • models 清單中會出現哪些模型字串?
  • 如果工作區回應中缺少某個群組,這代表什麼?
  • 我可以使用此 API 更新速率限制嗎?
  • 另請參閱