列出工作區速率限制
GET/v1/organizations/workspaces/{workspace_id}/rate_limits
列出工作區的速率限制。
預設情況下,僅傳回具有工作區層級覆寫的群組與限制器類型。設定 include_inherited=true 時,會傳回工作區可見且具有組織層級限制的每個群組,並針對每個群組列出其從組織繼承的值以及其自身的覆寫值。每個值的 source 會指出其屬於哪一種。
省略 limit 時,所有符合的項目會在單一頁面中傳回;當 limit 截斷結果時,請依循 next_page 擷取其餘項目。
Parameters
Returns
列出工作區速率限制
import os
from anthropic import Anthropic
client = Anthropic(
api_key=os.environ.get(
"ANTHROPIC_API_KEY"
), # This is the default and can be omitted
)
page = client.organization.workspaces.rate_limits.list(
workspace_id="workspace_id",
)
page = page.data[0]
print(page.rate_limit_id)Response 200
{
"data": [
{
"group": {
"id": "id",
"display_name": "display_name",
"type": "model_group"
},
"group_type": "batch",
"limits": [
{
"org_limit": 0,
"source": {
"type": "workspace"
},
"type": "type",
"value": 0
}
],
"models": [
"string"
],
"rate_limit_id": "rate_limit_id",
"type": "workspace_rate_limit",
"workspace_id": "workspace_id"
}
],
"next_page": "next_page"
}Returns Examples
Response 200
{
"data": [
{
"group": {
"id": "id",
"display_name": "display_name",
"type": "model_group"
},
"group_type": "batch",
"limits": [
{
"org_limit": 0,
"source": {
"type": "workspace"
},
"type": "type",
"value": 0
}
],
"models": [
"string"
],
"rate_limit_id": "rate_limit_id",
"type": "workspace_rate_limit",
"workspace_id": "workspace_id"
}
],
"next_page": "next_page"
}