---
title: 速率限制 API
url: https://platform.claude.com/docs/zh-TW/manage-claude/rate-limits-api
description: 使用 Rate Limits API 以程式化方式查詢您組織的 API 速率限制。
---

<Tip>
  **Admin API 不適用於個人帳戶。** 若要與團隊成員協作並新增成員，請在 Claude Console 的 [Organization](https://platform.claude.com/settings/organization) 頁面（`platform.claude.com/settings/organization`）設定您的組織。
</Tip>

速率限制 API 提供以程式化方式存取為您的組織及其工作區所設定之速率限制的功能。這與 Claude Console 中[速率限制](https://platform.claude.com/usage/limits)頁面上顯示的資訊相同。

使用此 API 來：

* **讓閘道和代理保持同步：** 在啟動時及依排程讀取您目前的限制，而不是將數值寫死在程式中，因為當 Anthropic 調整限制時，這些數值會產生偏差。
* **支援內部警示：** 將來自[用量與成本 API](https://platform.claude.com/docs/zh-TW/manage-claude/usage-cost-api) 的使用量資料與您設定的限制進行比較。
* **稽核工作區設定：** 驗證工作區覆寫設定是否符合您的佈建自動化所預期的內容。

<Check>
  **需要 Admin API 憑證。** 這些端點屬於 Admin API 的一部分。您可以使用 [Admin API 金鑰](https://platform.claude.com/docs/zh-TW/manage-claude/admin-api-keys)、具有 `org:admin` 範圍的 OAuth 權杖，或未限定於特定工作區的個人或服務帳戶金鑰來存取它們；工作區 API 金鑰無法使用。詳情請參閱[驗證](https://platform.claude.com/docs/zh-TW/manage-claude/admin-api#authentication)。
</Check>

本頁面上的 SDK 和 CLI 範例會建構預設用戶端，該用戶端會從 `ANTHROPIC_API_KEY` 環境變數讀取 Admin API 金鑰。SDK 將這些端點公開為 `client.organization.rate_limits` (typescript: `client.organization.rateLimits`; csharp, go: `client.Organization.RateLimits`; java: `client.organization().rateLimits()`; php: `$client->organization->rateLimits`) 和 `client.organization.workspaces.rate_limits` (typescript: `client.organization.workspaces.rateLimits`; csharp, go: `client.Organization.Workspaces.RateLimits`; java: `client.organization().workspaces().rateLimits()`; php: `$client->organization->workspaces->rateLimits`)；Python、TypeScript、C#、Go 和 Java 的 list 方法會回傳一個自動為您追蹤 `next_page` 的迭代器，而 PHP、Ruby 和 curl 範例則只讀取一頁。

## 快速開始

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

<CodeGroup>
  ```bash cURL
  curl "https://api.anthropic.com/v1/organizations/rate_limits" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01"
  ```

  ```bash CLI
  ant organization:rate-limits list
  ```

  ```python Python
  client = anthropic.Anthropic()

  rate_limits = client.organization.rate_limits.list()

  for entry in rate_limits:
      models = f" ({', '.join(entry.models)})" if entry.models else ""
      print(f"{entry.group.type}{models}")
      for limit in entry.limits:
          print(f"  {limit.type}: {limit.value}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const rateLimits = await client.organization.rateLimits.list();

  for await (const entry of rateLimits) {
    const models = entry.models ? ` (${entry.models.join(", ")})` : "";
    console.log(`${entry.group.type}${models}`);
    for (const limit of entry.limits) {
      console.log(`  ${limit.type}: ${limit.value}`);
    }
  }
  ```

  ```csharp C#
  AnthropicClient client = new();

  var rateLimits = await client.Organization.RateLimits.List();

  await foreach (var entry in rateLimits.Paginate())
  {
      var models = entry.Models is null ? "" : $" ({string.Join(", ", entry.Models)})";
      Console.WriteLine($"{entry.Group.Type.GetString()}{models}");
      foreach (var limit in entry.Limits)
      {
          Console.WriteLine($"  {limit.Type}: {limit.Value}");
      }
  }
  ```

  ```go Go
  client := anthropic.NewClient()

  rateLimits := client.Organization.RateLimits.ListAutoPaging(context.Background(), anthropic.OrganizationRateLimitListParams{})

  for rateLimits.Next() {
  	entry := rateLimits.Current()
  	models := ""
  	if len(entry.Models) > 0 {
  		models = fmt.Sprintf(" (%s)", strings.Join(entry.Models, ", "))
  	}
  	fmt.Printf("%s%s\n", entry.Group.Type, models)
  	for _, limit := range entry.Limits {
  		fmt.Printf("  %s: %d\n", limit.Type, limit.Value)
  	}
  }
  if err := rateLimits.Err(); err != nil {
  	log.Fatal(err)
  }
  ```

  ```java Java
  AnthropicClient client = AnthropicOkHttpClient.fromEnv();

  var rateLimits = client.organization().rateLimits().list();

  for (var entry : rateLimits.autoPager()) {
      var models = entry.models()
          .map(modelIds -> " (" + String.join(", ", modelIds) + ")")
          .orElse("");
      IO.println(entry.group().type().asString() + models);
      for (var limit : entry.limits()) {
          IO.println("  " + limit.type() + ": " + limit.value());
      }
  }
  ```

  ```php PHP
  $client = new Client();

  $rateLimits = $client->organization->rateLimits->list();

  foreach ($rateLimits->data as $entry) {
      $models = $entry->models ? ' (' . implode(', ', $entry->models) . ')' : '';
      echo "{$entry->group->type}{$models}\n";
      foreach ($entry->limits as $limit) {
          echo "  {$limit->type}: {$limit->value}\n";
      }
  }
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  rate_limits = client.organization.rate_limits.list

  rate_limits.data.each do |entry|
    models = entry.models ? " (#{entry.models.join(", ")})" : ""
    puts "#{entry.group.type}#{models}"
    entry.limits.each do |limit|
      puts "  #{limit.type}: #{limit.value}"
    end
  end
  ```
</CodeGroup>

## 組織速率限制

`/v1/organizations/rate_limits` 端點會回傳在組織層級套用於 Messages API 及其支援資源的速率限制。其他產品（例如 [Claude Managed Agents](https://platform.claude.com/docs/zh-TW/managed-agents/overview)）的限制不包含在內。

### 關鍵概念

* **速率限制群組：** 回應中的每個項目代表一個速率限制群組。模型速率限制會被分組，讓多個模型版本共用同一組限制；其他群組則涵蓋 Message Batches API、Files API、Token Counting API、agent skills 和網頁搜尋工具等資源。
* **`group` 物件：** 存在於每個項目中，用於識別該項目所套用的速率限制群組。它一定包含 `type`（為 `group_type` 值之一）以及 `id`（帶有 `rlg_` 前綴的不透明識別碼）。在 `model_group` 項目中，它還包含 `display_name`，即 Anthropic 目前為該群組使用的標籤，例如 `Claude Sonnet 4.x`。此標籤僅供顯示用途，且可能會變更。其他群組類型沒有 `display_name`。
* **`group` 內的 `id`：** 一個群組在每個組織及每個工作區覆寫中都具有相同的 `id`，且永遠不會變更。使用它來比對不同組織之間的項目，或與您自己的目錄進行比對。項目本身的 `id` 在每個組織中都不同，而當 Anthropic 將模型移至其他群組時，`models` 也會改變。兩者都不是群組的穩定鍵值。
* **`group_type`：** 已棄用，改用 `group` 內的 `type`。它仍會被回傳，其值永遠等於該值，且沒有移除日期。`group_type` 查詢參數並未被棄用。請參閱[依群組類型篩選](https://platform.claude.com/docs/zh-TW/manage-claude/rate-limits-api#filtering-by-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` 是所設定的限制。請參閱[速率限制](https://platform.claude.com/docs/zh-TW/api/rate-limits)以了解每個限制器的測量與執行方式。
* **工作區限制上的 `source`：** 在工作區端點上，每個限制值還帶有 `source`，說明 `value` 的來源：`{"type": "workspace"}` 表示儲存在工作區上的覆寫，`{"type": "organization"}` 表示從組織繼承的值。預設情況下，工作區端點只回傳覆寫，因此 `source.type` 在該處一律為 `workspace`；當您傳入 `include_inherited=true` 時，才會出現繼承的值。請參閱[工作區速率限制](https://platform.claude.com/docs/zh-TW/manage-claude/rate-limits-api#workspace-rate-limits)。

如需完整的參數詳細資訊和回應結構描述，請參閱[組織速率限制 API 參考](https://platform.claude.com/docs/zh-TW/api/organization/rate_limits/list)。

### 列出所有組織速率限制

<CodeGroup>
  ```bash cURL
  curl "https://api.anthropic.com/v1/organizations/rate_limits" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01"
  ```

  ```bash CLI
  ant organization:rate-limits list
  ```

  ```python Python
  client = anthropic.Anthropic()

  rate_limits = client.organization.rate_limits.list()

  for entry in rate_limits:
      models = f" ({', '.join(entry.models)})" if entry.models else ""
      print(f"{entry.group.type}{models}")
      for limit in entry.limits:
          print(f"  {limit.type}: {limit.value}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const rateLimits = await client.organization.rateLimits.list();

  for await (const entry of rateLimits) {
    const models = entry.models ? ` (${entry.models.join(", ")})` : "";
    console.log(`${entry.group.type}${models}`);
    for (const limit of entry.limits) {
      console.log(`  ${limit.type}: ${limit.value}`);
    }
  }
  ```

  ```csharp C#
  AnthropicClient client = new();

  var rateLimits = await client.Organization.RateLimits.List();

  await foreach (var entry in rateLimits.Paginate())
  {
      var models = entry.Models is null ? "" : $" ({string.Join(", ", entry.Models)})";
      Console.WriteLine($"{entry.Group.Type.GetString()}{models}");
      foreach (var limit in entry.Limits)
      {
          Console.WriteLine($"  {limit.Type}: {limit.Value}");
      }
  }
  ```

  ```go Go
  client := anthropic.NewClient()

  rateLimits := client.Organization.RateLimits.ListAutoPaging(context.Background(), anthropic.OrganizationRateLimitListParams{})

  for rateLimits.Next() {
  	entry := rateLimits.Current()
  	models := ""
  	if len(entry.Models) > 0 {
  		models = fmt.Sprintf(" (%s)", strings.Join(entry.Models, ", "))
  	}
  	fmt.Printf("%s%s\n", entry.Group.Type, models)
  	for _, limit := range entry.Limits {
  		fmt.Printf("  %s: %d\n", limit.Type, limit.Value)
  	}
  }
  if err := rateLimits.Err(); err != nil {
  	log.Fatal(err)
  }
  ```

  ```java Java
  AnthropicClient client = AnthropicOkHttpClient.fromEnv();

  var rateLimits = client.organization().rateLimits().list();

  for (var entry : rateLimits.autoPager()) {
      var models = entry.models()
          .map(modelIds -> " (" + String.join(", ", modelIds) + ")")
          .orElse("");
      IO.println(entry.group().type().asString() + models);
      for (var limit : entry.limits()) {
          IO.println("  " + limit.type() + ": " + limit.value());
      }
  }
  ```

  ```php PHP
  $client = new Client();

  $rateLimits = $client->organization->rateLimits->list();

  foreach ($rateLimits->data as $entry) {
      $models = $entry->models ? ' (' . implode(', ', $entry->models) . ')' : '';
      echo "{$entry->group->type}{$models}\n";
      foreach ($entry->limits as $limit) {
          echo "  {$limit->type}: {$limit->value}\n";
      }
  }
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  rate_limits = client.organization.rate_limits.list

  rate_limits.data.each do |entry|
    models = entry.models ? " (#{entry.models.join(", ")})" : ""
    puts "#{entry.group.type}#{models}"
    entry.limits.each do |limit|
      puts "  #{limit.type}: #{limit.value}"
    end
  end
  ```
</CodeGroup>

```text wrap
{
  "data": [
    {
      "type": "rate_limit",
      "group_type": "model_group",
      "group": {
        "type": "model_group",
        "id": "rlg_01Hq7YkP3mZ9dTwRx4cVbN2s",
        "display_name": "Claude Opus 5.5"
      },
      "models": ["claude-opus-5-5"],
      "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": "model_group",
      "group": {
        "type": "model_group",
        "id": "rlg_01Kd5wMv8nSq2LcXy6tRfJ4b",
        "display_name": "Claude Opus 4.x"
      },
      "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",
      "group": { "type": "batch", "id": "rlg_01Wn3pBz6kCg9vHtQ7mLxD5a" },
      "models": null,
      "limits": [{ "type": "enqueued_batch_requests", "value": 500000 }]
    }
  ],
  "next_page": null
}
```

### 查詢特定模型的限制

將任何模型 ID 或別名作為 `model` 查詢參數傳入，即可只回傳包含該模型的項目：

<CodeGroup>
  ```bash cURL
  curl "https://api.anthropic.com/v1/organizations/rate_limits?model=claude-opus-5-5" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01"
  ```

  ```bash CLI
  ant organization:rate-limits list --model claude-opus-5-5
  ```

  ```python Python
  client = anthropic.Anthropic()

  rate_limits = client.organization.rate_limits.list(model="claude-opus-5-5")

  for entry in rate_limits:
      models = f" ({', '.join(entry.models)})" if entry.models else ""
      print(f"{entry.group.type}{models}")
      for limit in entry.limits:
          print(f"  {limit.type}: {limit.value}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const rateLimits = await client.organization.rateLimits.list({
    model: "claude-opus-5-5"
  });

  for await (const entry of rateLimits) {
    const models = entry.models ? ` (${entry.models.join(", ")})` : "";
    console.log(`${entry.group.type}${models}`);
    for (const limit of entry.limits) {
      console.log(`  ${limit.type}: ${limit.value}`);
    }
  }
  ```

  ```csharp C#
  AnthropicClient client = new();

  var rateLimits = await client.Organization.RateLimits.List(new()
  {
      Model = "claude-opus-5-5"
  });

  await foreach (var entry in rateLimits.Paginate())
  {
      var models = entry.Models is null ? "" : $" ({string.Join(", ", entry.Models)})";
      Console.WriteLine($"{entry.Group.Type.GetString()}{models}");
      foreach (var limit in entry.Limits)
      {
          Console.WriteLine($"  {limit.Type}: {limit.Value}");
      }
  }
  ```

  ```go Go
  client := anthropic.NewClient()

  rateLimits := client.Organization.RateLimits.ListAutoPaging(context.Background(), anthropic.OrganizationRateLimitListParams{
  	Model: anthropic.String(anthropic.ModelClaudeOpus5_5),
  })

  for rateLimits.Next() {
  	entry := rateLimits.Current()
  	models := ""
  	if len(entry.Models) > 0 {
  		models = fmt.Sprintf(" (%s)", strings.Join(entry.Models, ", "))
  	}
  	fmt.Printf("%s%s\n", entry.Group.Type, models)
  	for _, limit := range entry.Limits {
  		fmt.Printf("  %s: %d\n", limit.Type, limit.Value)
  	}
  }
  if err := rateLimits.Err(); err != nil {
  	log.Fatal(err)
  }
  ```

  ```java Java
  import com.anthropic.models.organization.ratelimits.RateLimitListParams;
  import com.anthropic.models.messages.Model;

  void main() {
      AnthropicClient client = AnthropicOkHttpClient.fromEnv();

      var params = RateLimitListParams.builder()
          .model(Model.CLAUDE_OPUS_5_5.asString())
          .build();
      var rateLimits = client.organization().rateLimits().list(params);

      for (var entry : rateLimits.autoPager()) {
          var models = entry.models()
              .map(modelIds -> " (" + String.join(", ", modelIds) + ")")
              .orElse("");
          IO.println(entry.group().type().asString() + models);
          for (var limit : entry.limits()) {
              IO.println("  " + limit.type() + ": " + limit.value());
          }
      }
  }
  ```

  ```php PHP
  use Anthropic\Messages\Model;

  $client = new Client();

  $rateLimits = $client->organization->rateLimits->list(
      model: Model::CLAUDE_OPUS_5_5->value,
  );

  foreach ($rateLimits->data as $entry) {
      $models = $entry->models ? ' (' . implode(', ', $entry->models) . ')' : '';
      echo "{$entry->group->type}{$models}\n";
      foreach ($entry->limits as $limit) {
          echo "  {$limit->type}: {$limit->value}\n";
      }
  }
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  rate_limits = client.organization.rate_limits.list(model: Anthropic::Model::CLAUDE_OPUS_5_5)

  rate_limits.data.each do |entry|
    models = entry.models ? " (#{entry.models.join(", ")})" : ""
    puts "#{entry.group.type}#{models}"
    entry.limits.each do |limit|
      puts "  #{limit.type}: #{limit.value}"
    end
  end
  ```
</CodeGroup>

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

## 工作區速率限制

`/v1/organizations/workspaces/{workspace_id}/rate_limits` 端點會回傳為單一工作區設定的速率限制覆寫。若也要查看工作區繼承的值，請傳入 `include_inherited=true`（請參閱[包含繼承的值](https://platform.claude.com/docs/zh-TW/manage-claude/rate-limits-api#include-inherited-values)）。

預設情況下，回應只包含覆寫，因此其中缺少的任何內容都是從組織繼承而來：

* 不存在於 `data` 中的群組完全沒有工作區覆寫。該工作區會繼承該群組的組織層級限制（並非無限制）。
* 在存在的群組中，不存在於 `limits[]` 中的限制器類型沒有針對該限制器的工作區覆寫。該工作區會繼承其組織值。
* 對於每個存在的限制器，`org_limit` 是同一限制器的組織層級值，若組織未為該限制器類型設定限制則為 `null`，而 `source` 為 `{"type": "workspace"}`。

如需完整的參數詳細資訊和回應結構描述，請參閱[工作區速率限制 API 參考](https://platform.claude.com/docs/zh-TW/api/organization/workspaces/rate_limits/list)。

<Tip>
  若要取得您組織的工作區 ID，請使用 [List Workspaces](https://platform.claude.com/docs/zh-TW/api/organization/workspaces/list) 端點，或在 [Claude Console](https://platform.claude.com/settings/workspaces) 中查找。預設工作區無法設定速率限制覆寫，無論是否使用 `include_inherited`，此端點都會對其回傳 404 錯誤；請使用組織端點來讀取其限制。
</Tip>

<CodeGroup>
  ```bash cURL
  curl "https://api.anthropic.com/v1/organizations/workspaces/wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ/rate_limits" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01"
  ```

  ```bash CLI
  ant organization:workspaces:rate-limits list \
    --workspace-id wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ
  ```

  ```python Python
  client = anthropic.Anthropic()

  rate_limits = client.organization.workspaces.rate_limits.list(
      "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
  )

  for entry in rate_limits:
      models = f" ({', '.join(entry.models)})" if entry.models else ""
      print(f"{entry.group.type}{models}")
      for limit in entry.limits:
          print(f"  {limit.type}: {limit.value}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const rateLimits = await client.organization.workspaces.rateLimits.list(
    "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
  );

  for await (const entry of rateLimits) {
    const models = entry.models ? ` (${entry.models.join(", ")})` : "";
    console.log(`${entry.group.type}${models}`);
    for (const limit of entry.limits) {
      console.log(`  ${limit.type}: ${limit.value}`);
    }
  }
  ```

  ```csharp C#
  AnthropicClient client = new();

  var rateLimits = await client.Organization.Workspaces.RateLimits.List(
      "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
  );

  await foreach (var entry in rateLimits.Paginate())
  {
      var models = entry.Models is null ? "" : $" ({string.Join(", ", entry.Models)})";
      Console.WriteLine($"{entry.Group.Type.GetString()}{models}");
      foreach (var limit in entry.Limits)
      {
          Console.WriteLine($"  {limit.Type}: {limit.Value}");
      }
  }
  ```

  ```go Go
  client := anthropic.NewClient()

  rateLimits := client.Organization.Workspaces.RateLimits.ListAutoPaging(
  	context.Background(),
  	"wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
  	anthropic.OrganizationWorkspaceRateLimitListParams{},
  )

  for rateLimits.Next() {
  	entry := rateLimits.Current()
  	models := ""
  	if len(entry.Models) > 0 {
  		models = fmt.Sprintf(" (%s)", strings.Join(entry.Models, ", "))
  	}
  	fmt.Printf("%s%s\n", entry.Group.Type, models)
  	for _, limit := range entry.Limits {
  		fmt.Printf("  %s: %d\n", limit.Type, limit.Value)
  	}
  }
  if err := rateLimits.Err(); err != nil {
  	log.Fatal(err)
  }
  ```

  ```java Java
  AnthropicClient client = AnthropicOkHttpClient.fromEnv();

  var rateLimits = client.organization().workspaces().rateLimits()
      .list("wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ");

  for (var entry : rateLimits.autoPager()) {
      var models = entry.models()
          .map(modelIds -> " (" + String.join(", ", modelIds) + ")")
          .orElse("");
      IO.println(entry.group().type().asString() + models);
      for (var limit : entry.limits()) {
          IO.println("  " + limit.type() + ": " + limit.value());
      }
  }
  ```

  ```php PHP
  $client = new Client();

  $rateLimits = $client->organization->workspaces->rateLimits->list(
      workspaceID: 'wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ',
  );

  foreach ($rateLimits->data as $entry) {
      $models = $entry->models ? ' (' . implode(', ', $entry->models) . ')' : '';
      echo "{$entry->group->type}{$models}\n";
      foreach ($entry->limits as $limit) {
          echo "  {$limit->type}: {$limit->value}\n";
      }
  }
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  workspace_id = "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
  rate_limits = client.organization.workspaces.rate_limits.list(workspace_id)

  rate_limits.data.each do |entry|
    models = entry.models ? " (#{entry.models.join(", ")})" : ""
    puts "#{entry.group.type}#{models}"
    entry.limits.each do |limit|
      puts "  #{limit.type}: #{limit.value}"
    end
  end
  ```
</CodeGroup>

```text wrap
{
  "data": [
    {
      "type": "workspace_rate_limit",
      "group_type": "model_group",
      "group": {
        "type": "model_group",
        "id": "rlg_01Hq7YkP3mZ9dTwRx4cVbN2s",
        "display_name": "Claude Opus 5.5"
      },
      "models": ["claude-opus-5-5"],
      "limits": [
        {
          "type": "requests_per_minute",
          "value": 1000,
          "org_limit": 4000,
          "source": { "type": "workspace" }
        },
        {
          "type": "input_tokens_per_minute",
          "value": 500000,
          "org_limit": 10000000,
          "source": { "type": "workspace" }
        }
      ]
    },
    {
      "type": "workspace_rate_limit",
      "group_type": "model_group",
      "group": {
        "type": "model_group",
        "id": "rlg_01Kd5wMv8nSq2LcXy6tRfJ4b",
        "display_name": "Claude Opus 4.x"
      },
      "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,
          "source": { "type": "workspace" }
        },
        {
          "type": "input_tokens_per_minute",
          "value": 500000,
          "org_limit": 10000000,
          "source": { "type": "workspace" }
        }
      ]
    }
  ],
  "next_page": null
}
```

### 包含繼承的值

若要在一次請求中讀取工作區適用的限制，請加入選用的 `include_inherited` 查詢參數。其預設值為 `false`；非布林值會回傳 400 錯誤。使用 `include_inherited=true` 時：

* `data` 會為每個適用於該工作區且具有組織層級值的群組提供一個項目，即使工作區未覆寫其中任何內容也是如此。當工作區可以存取模型群組中至少一個模型時，該模型群組即適用。
* 每個項目的 `limits[]` 會列出組織在該群組上具有值的每個限制器類型，以及工作區覆寫的任何類型。每個類型只出現一次，若有儲存工作區的覆寫則使用該覆寫，否則使用組織的值，因此一個項目可能混合兩者。
* 每個值的 `source` 可用來區分兩者：`{"type": "workspace"}` 是儲存的覆寫，而 `{"type": "organization"}` 是繼承的值，其中 `value` 等於 `org_limit`。

<CodeGroup>
  ```bash cURL
  curl "https://api.anthropic.com/v1/organizations/workspaces/wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ/rate_limits?include_inherited=true" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01"
  ```

  ```bash CLI
  ant organization:workspaces:rate-limits list \
    --workspace-id wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ \
    --include-inherited
  ```

  ```python Python
  client = anthropic.Anthropic()

  rate_limits = client.organization.workspaces.rate_limits.list(
      "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
      include_inherited=True,
  )

  for entry in rate_limits:
      models = f" ({', '.join(entry.models)})" if entry.models else ""
      print(f"{entry.group.type}{models}")
      for limit in entry.limits:
          print(f"  {limit.type}: {limit.value} ({limit.source.type})")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const rateLimits = await client.organization.workspaces.rateLimits.list(
    "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
    { include_inherited: true }
  );

  for await (const entry of rateLimits) {
    const models = entry.models ? ` (${entry.models.join(", ")})` : "";
    console.log(`${entry.group.type}${models}`);
    for (const limit of entry.limits) {
      console.log(`  ${limit.type}: ${limit.value} (${limit.source.type})`);
    }
  }
  ```

  ```csharp C#
  AnthropicClient client = new();

  var rateLimits = await client.Organization.Workspaces.RateLimits.List(
      "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
      new() { IncludeInherited = true }
  );

  await foreach (var entry in rateLimits.Paginate())
  {
      var models = entry.Models is null ? "" : $" ({string.Join(", ", entry.Models)})";
      Console.WriteLine($"{entry.Group.Type.GetString()}{models}");
      foreach (var limit in entry.Limits)
      {
          Console.WriteLine($"  {limit.Type}: {limit.Value} ({limit.Source.Type.GetString()})");
      }
  }
  ```

  ```go Go
  client := anthropic.NewClient()

  rateLimits := client.Organization.Workspaces.RateLimits.ListAutoPaging(
  	context.Background(),
  	"wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",
  	anthropic.OrganizationWorkspaceRateLimitListParams{
  		IncludeInherited: anthropic.Bool(true),
  	},
  )

  for rateLimits.Next() {
  	entry := rateLimits.Current()
  	models := ""
  	if len(entry.Models) > 0 {
  		models = fmt.Sprintf(" (%s)", strings.Join(entry.Models, ", "))
  	}
  	fmt.Printf("%s%s\n", entry.Group.Type, models)
  	for _, limit := range entry.Limits {
  		fmt.Printf("  %s: %d (%s)\n", limit.Type, limit.Value, limit.Source.Type)
  	}
  }
  if err := rateLimits.Err(); err != nil {
  	log.Fatal(err)
  }
  ```

  ```java Java
  import com.anthropic.models.organization.workspaces.ratelimits.RateLimitListParams;

  void main() {
      AnthropicClient client = AnthropicOkHttpClient.fromEnv();

      var params = RateLimitListParams.builder()
          .includeInherited(true)
          .build();
      var rateLimits = client.organization().workspaces().rateLimits()
          .list("wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ", params);

      for (var entry : rateLimits.autoPager()) {
          var models = entry.models()
              .map(modelIds -> " (" + String.join(", ", modelIds) + ")")
              .orElse("");
          IO.println(entry.group().type().asString() + models);
          for (var limit : entry.limits()) {
              IO.println("  " + limit.type() + ": " + limit.value()
                  + " (" + limit.source().type().asString() + ")");
          }
      }
  }
  ```

  ```php PHP
  $client = new Client();

  $rateLimits = $client->organization->workspaces->rateLimits->list(
      workspaceID: 'wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ',
      includeInherited: true,
  );

  foreach ($rateLimits->data as $entry) {
      $models = $entry->models ? ' (' . implode(', ', $entry->models) . ')' : '';
      echo "{$entry->group->type}{$models}\n";
      foreach ($entry->limits as $limit) {
          echo "  {$limit->type}: {$limit->value} ({$limit->source->type})\n";
      }
  }
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  workspace_id = "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"
  rate_limits = client.organization.workspaces.rate_limits.list(workspace_id, include_inherited: true)

  rate_limits.data.each do |entry|
    models = entry.models ? " (#{entry.models.join(", ")})" : ""
    puts "#{entry.group.type}#{models}"
    entry.limits.each do |limit|
      puts "  #{limit.type}: #{limit.value} (#{limit.source.type})"
    end
  end
  ```
</CodeGroup>

```text wrap
{
  "data": [
    {
      "type": "workspace_rate_limit",
      "group_type": "model_group",
      "group": {
        "type": "model_group",
        "id": "rlg_01Hq7YkP3mZ9dTwRx4cVbN2s",
        "display_name": "Claude Opus 5.5"
      },
      "models": ["claude-opus-5-5"],
      "limits": [
        {
          "type": "requests_per_minute",
          "value": 1000,
          "org_limit": 4000,
          "source": { "type": "workspace" }
        },
        {
          "type": "input_tokens_per_minute",
          "value": 500000,
          "org_limit": 10000000,
          "source": { "type": "workspace" }
        },
        {
          "type": "output_tokens_per_minute",
          "value": 800000,
          "org_limit": 800000,
          "source": { "type": "organization" }
        }
      ]
    },
    {
      "type": "workspace_rate_limit",
      "group_type": "model_group",
      "group": {
        "type": "model_group",
        "id": "rlg_01Kd5wMv8nSq2LcXy6tRfJ4b",
        "display_name": "Claude Opus 4.x"
      },
      "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,
          "source": { "type": "workspace" }
        },
        {
          "type": "input_tokens_per_minute",
          "value": 500000,
          "org_limit": 10000000,
          "source": { "type": "workspace" }
        },
        {
          "type": "output_tokens_per_minute",
          "value": 800000,
          "org_limit": 800000,
          "source": { "type": "organization" }
        }
      ]
    },
    {
      "type": "workspace_rate_limit",
      "group_type": "batch",
      "group": { "type": "batch", "id": "rlg_01Wn3pBz6kCg9vHtQ7mLxD5a" },
      "models": null,
      "limits": [
        {
          "type": "enqueued_batch_requests",
          "value": 500000,
          "org_limit": 500000,
          "source": { "type": "organization" }
        }
      ]
    }
  ],
  "next_page": null
}
```

## 依群組類型篩選

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

<CodeGroup>
  ```bash cURL
  curl "https://api.anthropic.com/v1/organizations/rate_limits?group_type=batch" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01"
  ```

  ```bash CLI
  ant organization:rate-limits list --group-type batch
  ```

  ```python Python
  client = anthropic.Anthropic()

  rate_limits = client.organization.rate_limits.list(group_type="batch")

  for entry in rate_limits:
      models = f" ({', '.join(entry.models)})" if entry.models else ""
      print(f"{entry.group.type}{models}")
      for limit in entry.limits:
          print(f"  {limit.type}: {limit.value}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const rateLimits = await client.organization.rateLimits.list({ group_type: "batch" });

  for await (const entry of rateLimits) {
    const models = entry.models ? ` (${entry.models.join(", ")})` : "";
    console.log(`${entry.group.type}${models}`);
    for (const limit of entry.limits) {
      console.log(`  ${limit.type}: ${limit.value}`);
    }
  }
  ```

  ```csharp C#
  using Anthropic.Models.Organization.RateLimits;

  AnthropicClient client = new();

  var rateLimits = await client.Organization.RateLimits.List(new()
  {
      GroupType = GroupType.Batch
  });

  await foreach (var entry in rateLimits.Paginate())
  {
      var models = entry.Models is null ? "" : $" ({string.Join(", ", entry.Models)})";
      Console.WriteLine($"{entry.Group.Type.GetString()}{models}");
      foreach (var limit in entry.Limits)
      {
          Console.WriteLine($"  {limit.Type}: {limit.Value}");
      }
  }
  ```

  ```go Go
  client := anthropic.NewClient()

  rateLimits := client.Organization.RateLimits.ListAutoPaging(context.Background(), anthropic.OrganizationRateLimitListParams{
  	GroupType: anthropic.OrganizationRateLimitListParamsGroupTypeBatch,
  })

  for rateLimits.Next() {
  	entry := rateLimits.Current()
  	models := ""
  	if len(entry.Models) > 0 {
  		models = fmt.Sprintf(" (%s)", strings.Join(entry.Models, ", "))
  	}
  	fmt.Printf("%s%s\n", entry.Group.Type, models)
  	for _, limit := range entry.Limits {
  		fmt.Printf("  %s: %d\n", limit.Type, limit.Value)
  	}
  }
  if err := rateLimits.Err(); err != nil {
  	log.Fatal(err)
  }
  ```

  ```java Java
  import com.anthropic.models.organization.ratelimits.RateLimitListParams;

  void main() {
      AnthropicClient client = AnthropicOkHttpClient.fromEnv();

      var params = RateLimitListParams.builder()
          .groupType(RateLimitListParams.GroupType.BATCH)
          .build();
      var rateLimits = client.organization().rateLimits().list(params);

      for (var entry : rateLimits.autoPager()) {
          var models = entry.models()
              .map(modelIds -> " (" + String.join(", ", modelIds) + ")")
              .orElse("");
          IO.println(entry.group().type().asString() + models);
          for (var limit : entry.limits()) {
              IO.println("  " + limit.type() + ": " + limit.value());
          }
      }
  }
  ```

  ```php PHP
  use Anthropic\Organization\RateLimits\RateLimitListParams\GroupType;
  // ...

  $client = new Client();

  $rateLimits = $client->organization->rateLimits->list(
      groupType: GroupType::BATCH,
  );

  foreach ($rateLimits->data as $entry) {
      $models = $entry->models ? ' (' . implode(', ', $entry->models) . ')' : '';
      echo "{$entry->group->type}{$models}\n";
      foreach ($entry->limits as $limit) {
          echo "  {$limit->type}: {$limit->value}\n";
      }
  }
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  rate_limits = client.organization.rate_limits.list(group_type: :batch)

  rate_limits.data.each do |entry|
    models = entry.models ? " (#{entry.models.join(", ")})" : ""
    puts "#{entry.group.type}#{models}"
    entry.limits.each do |limit|
      puts "  #{limit.type}: #{limit.value}"
    end
  end
  ```
</CodeGroup>

有效值為 `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` 項目中找到它。

### 如果工作區回應中缺少某個群組，代表什麼意思？

預設情況下，工作區回應只列出覆寫，因此缺少的群組沒有工作區覆寫，並繼承組織層級的限制。傳入 `include_inherited=true` 即可在工作區端點上查看繼承的值，或查詢組織端點。使用 `include_inherited=true` 時，只有當群組不適用於該工作區，或組織未為其設定限制時，該群組才會缺少。

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

不可以。若要設定工作區速率限制，請前往 Claude Console 中的[速率限制](https://platform.claude.com/usage/limits)頁面，從**工作區**下拉選單中選擇工作區，然後點擊模型旁的**編輯**。

## 另請參閱

* [速率限制](https://platform.claude.com/docs/zh-TW/api/rate-limits)
* [Admin API](https://platform.claude.com/docs/zh-TW/manage-claude/admin-api)
* [Admin API 參考](https://platform.claude.com/docs/zh-TW/api/organization)
* [工作區](https://platform.claude.com/docs/zh-TW/manage-claude/workspaces)
* [用量與成本 API](https://platform.claude.com/docs/zh-TW/manage-claude/usage-cost-api)
