SPB Git

Repository Public

rate-limits-api.md 26.6 KB 815 lines markdown

1---2title: Rate Limits API3url: https://platform.claude.com/docs/en/manage-claude/rate-limits-api4description: Programmatically query your organization's API rate limits with the Rate Limits API.5---67<Tip>8  **The Admin API is unavailable for individual accounts.** To collaborate with teammates and add members, set up your organization in **Console → Settings → Organization**.9</Tip>1011The Rate Limits API provides programmatic access to the rate limits configured for your organization and its workspaces. This is the same information shown on the [Rate limits](https://platform.claude.com/settings/limits) page in the Claude Console.1213Use this API to:1415* **Keep gateways and proxies in sync:** Read your current limits at startup and on a schedule instead of hardcoding values that drift when Anthropic adjusts them.16* **Power internal alerting:** Compare usage data from the [Usage and Cost API](https://platform.claude.com/docs/en/manage-claude/usage-cost-api) against your configured limits.17* **Audit workspace configuration:** Verify that workspace overrides match what your provisioning automation expects.1819<Check>20  **Admin API credentials required.** These endpoints are part of the Admin API. You can access them using an [Admin API key](https://platform.claude.com/docs/en/manage-claude/admin-api-keys), an OAuth token with the `org:admin` scope, or a personal or service account key that isn't scoped to a workspace; workspace API keys don't work. See [Authentication](https://platform.claude.com/docs/en/manage-claude/admin-api#authentication) for details.21</Check>2223The SDK and CLI examples on this page construct the default client, which reads the Admin API key from the `ANTHROPIC_API_KEY` environment variable. The SDKs expose these endpoints as `client.beta.organization.rate_limits` and `client.beta.organization.workspaces.rate_limits`; the Python, TypeScript, C#, Go, and Java list methods return an iterator that follows `next_page` for you, while the PHP, Ruby, and curl examples read one page.2425## Quick start2627List the rate limits configured for your organization:2829<CodeGroup>30  ```bash cURL31  curl "https://api.anthropic.com/v1/organizations/rate_limits" \32    -H "x-api-key: $ANTHROPIC_API_KEY" \33    -H "anthropic-version: 2023-06-01"34  ```3536  ```bash CLI37  ant beta:organization:rate-limits list38  ```3940  ```python Python41  client = anthropic.Anthropic()4243  rate_limits = client.beta.organization.rate_limits.list()4445  for group in rate_limits:46      models = f" ({', '.join(group.models)})" if group.models else ""47      print(f"{group.group_type}{models}")48      for limit in group.limits:49          print(f"  {limit.type}: {limit.value}")50  ```5152  ```typescript TypeScript53  const client = new Anthropic();5455  const rateLimits = await client.beta.organization.rateLimits.list();5657  for await (const group of rateLimits) {58    const models = group.models ? ` (${group.models.join(", ")})` : "";59    console.log(`${group.group_type}${models}`);60    for (const limit of group.limits) {61      console.log(`  ${limit.type}: ${limit.value}`);62    }63  }64  ```6566  ```csharp C#67  AnthropicClient client = new();6869  var rateLimits = await client.Beta.Organization.RateLimits.List();7071  await foreach (var group in rateLimits.Paginate())72  {73      var models = group.Models is null ? "" : $" ({string.Join(", ", group.Models)})";74      Console.WriteLine($"{group.GroupType.Raw()}{models}");75      foreach (var limit in group.Limits)76      {77          Console.WriteLine($"  {limit.Type}: {limit.Value}");78      }79  }80  ```8182  ```go Go83  client := anthropic.NewClient()8485  rateLimits := client.Beta.Organization.RateLimits.ListAutoPaging(context.Background(), anthropic.BetaOrganizationRateLimitListParams{})8687  for rateLimits.Next() {88  	group := rateLimits.Current()89  	models := ""90  	if len(group.Models) > 0 {91  		models = fmt.Sprintf(" (%s)", strings.Join(group.Models, ", "))92  	}93  	fmt.Printf("%s%s\n", group.GroupType, models)94  	for _, limit := range group.Limits {95  		fmt.Printf("  %s: %d\n", limit.Type, limit.Value)96  	}97  }98  if err := rateLimits.Err(); err != nil {99  	log.Fatal(err)100  }101  ```102103  ```java Java104  AnthropicClient client = AnthropicOkHttpClient.fromEnv();105106  var rateLimits = client.beta().organization().rateLimits().list();107108  for (var group : rateLimits.autoPager()) {109      var models = group.models()110          .map(modelIds -> " (" + String.join(", ", modelIds) + ")")111          .orElse("");112      IO.println(group.groupType().asString() + models);113      for (var limit : group.limits()) {114          IO.println("  " + limit.type() + ": " + limit.value());115      }116  }117  ```118119  ```php PHP120  $client = new Client();121122  $rateLimits = $client->beta->organization->rateLimits->list();123124  foreach ($rateLimits->data as $group) {125      $models = $group->models ? ' (' . implode(', ', $group->models) . ')' : '';126      echo "{$group->groupType}{$models}\n";127      foreach ($group->limits as $limit) {128          echo "  {$limit->type}: {$limit->value}\n";129      }130  }131  ```132133  ```ruby Ruby134  client = Anthropic::Client.new135136  rate_limits = client.beta.organization.rate_limits.list137138  rate_limits.data.each do |group|139    models = group.models ? " (#{group.models.join(", ")})" : ""140    puts "#{group.group_type}#{models}"141    group.limits.each do |limit|142      puts "  #{limit.type}: #{limit.value}"143    end144  end145  ```146</CodeGroup>147148## Organization rate limits149150The `/v1/organizations/rate_limits` endpoint returns the rate limits applied at the organization level for the Messages API and its supporting resources. Limits for other products, such as [Claude Managed Agents](https://platform.claude.com/docs/en/managed-agents/overview), are not included.151152### Key concepts153154* **Rate limit groups:** Each entry in the response represents one rate limit group. Model rate limits are grouped so that several model versions share a single set of limits, and other groups cover resources such as the Message Batches API, the Files API, the Token Counting API, agent skills, and the web search tool.155* **`group_type`:** Identifies which category of limits the entry covers. See [Filtering by group type](https://platform.claude.com/docs/en/manage-claude/rate-limits-api#filtering-by-group-type) for the list of values.156* **`models` list:** For `model_group` entries, the `models` field lists every model ID and alias that counts against that group's limits. Use this list to look up which group any model string falls under. For other group types, `models` is `null`.157* **`limits` list:** Each group carries a list of `{type, value}` pairs. The `type` field identifies the limiter (such as `requests_per_minute`, `input_tokens_per_minute`, or `output_tokens_per_minute`) and `value` is the configured limit. See [Rate limits](https://platform.claude.com/docs/en/api/rate-limits) for how each limiter is measured and enforced.158159For complete parameter details and response schemas, see the [Organization Rate Limits API reference](https://platform.claude.com/docs/en/api/admin/rate_limits/list).160161### List all organization rate limits162163<CodeGroup>164  ```bash cURL165  curl "https://api.anthropic.com/v1/organizations/rate_limits" \166    -H "x-api-key: $ANTHROPIC_API_KEY" \167    -H "anthropic-version: 2023-06-01"168  ```169170  ```bash CLI171  ant beta:organization:rate-limits list172  ```173174  ```python Python175  client = anthropic.Anthropic()176177  rate_limits = client.beta.organization.rate_limits.list()178179  for group in rate_limits:180      models = f" ({', '.join(group.models)})" if group.models else ""181      print(f"{group.group_type}{models}")182      for limit in group.limits:183          print(f"  {limit.type}: {limit.value}")184  ```185186  ```typescript TypeScript187  const client = new Anthropic();188189  const rateLimits = await client.beta.organization.rateLimits.list();190191  for await (const group of rateLimits) {192    const models = group.models ? ` (${group.models.join(", ")})` : "";193    console.log(`${group.group_type}${models}`);194    for (const limit of group.limits) {195      console.log(`  ${limit.type}: ${limit.value}`);196    }197  }198  ```199200  ```csharp C#201  AnthropicClient client = new();202203  var rateLimits = await client.Beta.Organization.RateLimits.List();204205  await foreach (var group in rateLimits.Paginate())206  {207      var models = group.Models is null ? "" : $" ({string.Join(", ", group.Models)})";208      Console.WriteLine($"{group.GroupType.Raw()}{models}");209      foreach (var limit in group.Limits)210      {211          Console.WriteLine($"  {limit.Type}: {limit.Value}");212      }213  }214  ```215216  ```go Go217  client := anthropic.NewClient()218219  rateLimits := client.Beta.Organization.RateLimits.ListAutoPaging(context.Background(), anthropic.BetaOrganizationRateLimitListParams{})220221  for rateLimits.Next() {222  	group := rateLimits.Current()223  	models := ""224  	if len(group.Models) > 0 {225  		models = fmt.Sprintf(" (%s)", strings.Join(group.Models, ", "))226  	}227  	fmt.Printf("%s%s\n", group.GroupType, models)228  	for _, limit := range group.Limits {229  		fmt.Printf("  %s: %d\n", limit.Type, limit.Value)230  	}231  }232  if err := rateLimits.Err(); err != nil {233  	log.Fatal(err)234  }235  ```236237  ```java Java238  AnthropicClient client = AnthropicOkHttpClient.fromEnv();239240  var rateLimits = client.beta().organization().rateLimits().list();241242  for (var group : rateLimits.autoPager()) {243      var models = group.models()244          .map(modelIds -> " (" + String.join(", ", modelIds) + ")")245          .orElse("");246      IO.println(group.groupType().asString() + models);247      for (var limit : group.limits()) {248          IO.println("  " + limit.type() + ": " + limit.value());249      }250  }251  ```252253  ```php PHP254  $client = new Client();255256  $rateLimits = $client->beta->organization->rateLimits->list();257258  foreach ($rateLimits->data as $group) {259      $models = $group->models ? ' (' . implode(', ', $group->models) . ')' : '';260      echo "{$group->groupType}{$models}\n";261      foreach ($group->limits as $limit) {262          echo "  {$limit->type}: {$limit->value}\n";263      }264  }265  ```266267  ```ruby Ruby268  client = Anthropic::Client.new269270  rate_limits = client.beta.organization.rate_limits.list271272  rate_limits.data.each do |group|273    models = group.models ? " (#{group.models.join(", ")})" : ""274    puts "#{group.group_type}#{models}"275    group.limits.each do |limit|276      puts "  #{limit.type}: #{limit.value}"277    end278  end279  ```280</CodeGroup>281282```json283{284  "data": [285    {286      "type": "rate_limit",287      "group_type": "model_group",288      "models": ["claude-opus-5"],289      "limits": [290        { "type": "requests_per_minute", "value": 4000 },291        { "type": "input_tokens_per_minute", "value": 10000000 },292        { "type": "output_tokens_per_minute", "value": 800000 }293      ]294    },295    {296      "type": "rate_limit",297      "group_type": "model_group",298      "models": [299        "claude-opus-4-5",300        "claude-opus-4-5-20251101",301        "claude-opus-4-6",302        "claude-opus-4-7",303        "claude-opus-4-8"304      ],305      "limits": [306        { "type": "requests_per_minute", "value": 4000 },307        { "type": "input_tokens_per_minute", "value": 10000000 },308        { "type": "output_tokens_per_minute", "value": 800000 }309      ]310    },311    {312      "type": "rate_limit",313      "group_type": "batch",314      "models": null,315      "limits": [{ "type": "enqueued_batch_requests", "value": 500000 }]316    }317  ],318  "next_page": null319}320```321322### Look up the limits for a specific model323324Pass any model ID or alias as the `model` query parameter to return only the entry that contains it:325326<CodeGroup>327  ```bash cURL328  curl "https://api.anthropic.com/v1/organizations/rate_limits?model=claude-opus-5" \329    -H "x-api-key: $ANTHROPIC_API_KEY" \330    -H "anthropic-version: 2023-06-01"331  ```332333  ```bash CLI334  ant beta:organization:rate-limits list --model claude-opus-5335  ```336337  ```python Python338  client = anthropic.Anthropic()339340  rate_limits = client.beta.organization.rate_limits.list(model="claude-opus-5")341342  for group in rate_limits:343      models = f" ({', '.join(group.models)})" if group.models else ""344      print(f"{group.group_type}{models}")345      for limit in group.limits:346          print(f"  {limit.type}: {limit.value}")347  ```348349  ```typescript TypeScript350  const client = new Anthropic();351352  const rateLimits = await client.beta.organization.rateLimits.list({ model: "claude-opus-5" });353354  for await (const group of rateLimits) {355    const models = group.models ? ` (${group.models.join(", ")})` : "";356    console.log(`${group.group_type}${models}`);357    for (const limit of group.limits) {358      console.log(`  ${limit.type}: ${limit.value}`);359    }360  }361  ```362363  ```csharp C#364  AnthropicClient client = new();365366  var rateLimits = await client.Beta.Organization.RateLimits.List(new()367  {368      Model = "claude-opus-5"369  });370371  await foreach (var group in rateLimits.Paginate())372  {373      var models = group.Models is null ? "" : $" ({string.Join(", ", group.Models)})";374      Console.WriteLine($"{group.GroupType.Raw()}{models}");375      foreach (var limit in group.Limits)376      {377          Console.WriteLine($"  {limit.Type}: {limit.Value}");378      }379  }380  ```381382  ```go Go383  client := anthropic.NewClient()384385  rateLimits := client.Beta.Organization.RateLimits.ListAutoPaging(context.Background(), anthropic.BetaOrganizationRateLimitListParams{386  	Model: anthropic.String(anthropic.ModelClaudeOpus5),387  })388389  for rateLimits.Next() {390  	group := rateLimits.Current()391  	models := ""392  	if len(group.Models) > 0 {393  		models = fmt.Sprintf(" (%s)", strings.Join(group.Models, ", "))394  	}395  	fmt.Printf("%s%s\n", group.GroupType, models)396  	for _, limit := range group.Limits {397  		fmt.Printf("  %s: %d\n", limit.Type, limit.Value)398  	}399  }400  if err := rateLimits.Err(); err != nil {401  	log.Fatal(err)402  }403  ```404405  ```java Java406  import com.anthropic.models.beta.organization.ratelimits.RateLimitListParams;407  import com.anthropic.models.messages.Model;408409  void main() {410      AnthropicClient client = AnthropicOkHttpClient.fromEnv();411412      var params = RateLimitListParams.builder()413          .model(Model.CLAUDE_OPUS_5.asString())414          .build();415      var rateLimits = client.beta().organization().rateLimits().list(params);416417      for (var group : rateLimits.autoPager()) {418          var models = group.models()419              .map(modelIds -> " (" + String.join(", ", modelIds) + ")")420              .orElse("");421          IO.println(group.groupType().asString() + models);422          for (var limit : group.limits()) {423              IO.println("  " + limit.type() + ": " + limit.value());424          }425      }426  }427  ```428429  ```php PHP430  use Anthropic\Messages\Model;431432  $client = new Client();433434  $rateLimits = $client->beta->organization->rateLimits->list(435      model: Model::CLAUDE_OPUS_5->value,436  );437438  foreach ($rateLimits->data as $group) {439      $models = $group->models ? ' (' . implode(', ', $group->models) . ')' : '';440      echo "{$group->groupType}{$models}\n";441      foreach ($group->limits as $limit) {442          echo "  {$limit->type}: {$limit->value}\n";443      }444  }445  ```446447  ```ruby Ruby448  client = Anthropic::Client.new449450  rate_limits = client.beta.organization.rate_limits.list(model: Anthropic::Model::CLAUDE_OPUS_5)451452  rate_limits.data.each do |group|453    models = group.models ? " (#{group.models.join(", ")})" : ""454    puts "#{group.group_type}#{models}"455    group.limits.each do |limit|456      puts "  #{limit.type}: #{limit.value}"457    end458  end459  ```460</CodeGroup>461462If the model string doesn't match any group, the endpoint returns a 404 error. The `model` parameter is supported on the organization endpoint only; the workspace endpoint doesn't accept it.463464## Workspace rate limits465466The `/v1/organizations/workspaces/{workspace_id}/rate_limits` endpoint returns the rate limit overrides configured for a single workspace.467468The response only includes overrides, so anything missing from it is inherited from the organization:469470* A group that is absent from `data` has no workspace override at all. The workspace inherits the organization-level limits for that group (it is not unlimited).471* Within a group that is present, a limiter type that is absent from `limits[]` has no workspace override for that limiter. The workspace inherits the organization value for it.472* For each limiter that is present, `org_limit` is the organization-level value for the same limiter, or `null` if the organization has no configured limit for that limiter type.473474For complete parameter details and response schemas, see the [Workspace Rate Limits API reference](https://platform.claude.com/docs/en/api/admin/workspaces/rate_limits/list).475476<Tip>477  To retrieve your organization's workspace IDs, use the [List Workspaces](https://platform.claude.com/docs/en/api/admin/workspaces/list) endpoint, or find them in the [Claude Console](https://platform.claude.com/settings/workspaces). The default workspace cannot have rate limit overrides, so it has no entry on this endpoint; use the organization endpoint to read its limits.478</Tip>479480<CodeGroup>481  ```bash cURL482  curl "https://api.anthropic.com/v1/organizations/workspaces/wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ/rate_limits" \483    -H "x-api-key: $ANTHROPIC_API_KEY" \484    -H "anthropic-version: 2023-06-01"485  ```486487  ```bash CLI488  ant beta:organization:workspaces:rate-limits list \489    --workspace-id wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ490  ```491492  ```python Python493  client = anthropic.Anthropic()494495  rate_limits = client.beta.organization.workspaces.rate_limits.list(496      "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"497  )498499  for group in rate_limits:500      models = f" ({', '.join(group.models)})" if group.models else ""501      print(f"{group.group_type}{models}")502      for limit in group.limits:503          print(f"  {limit.type}: {limit.value}")504  ```505506  ```typescript TypeScript507  const client = new Anthropic();508509  const rateLimits = await client.beta.organization.workspaces.rateLimits.list(510    "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"511  );512513  for await (const group of rateLimits) {514    const models = group.models ? ` (${group.models.join(", ")})` : "";515    console.log(`${group.group_type}${models}`);516    for (const limit of group.limits) {517      console.log(`  ${limit.type}: ${limit.value}`);518    }519  }520  ```521522  ```csharp C#523  AnthropicClient client = new();524525  var rateLimits = await client.Beta.Organization.Workspaces.RateLimits.List(526      "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"527  );528529  await foreach (var group in rateLimits.Paginate())530  {531      var models = group.Models is null ? "" : $" ({string.Join(", ", group.Models)})";532      Console.WriteLine($"{group.GroupType.Raw()}{models}");533      foreach (var limit in group.Limits)534      {535          Console.WriteLine($"  {limit.Type}: {limit.Value}");536      }537  }538  ```539540  ```go Go541  client := anthropic.NewClient()542543  rateLimits := client.Beta.Organization.Workspaces.RateLimits.ListAutoPaging(544  	context.Background(),545  	"wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ",546  	anthropic.BetaOrganizationWorkspaceRateLimitListParams{},547  )548549  for rateLimits.Next() {550  	group := rateLimits.Current()551  	models := ""552  	if len(group.Models) > 0 {553  		models = fmt.Sprintf(" (%s)", strings.Join(group.Models, ", "))554  	}555  	fmt.Printf("%s%s\n", group.GroupType, models)556  	for _, limit := range group.Limits {557  		fmt.Printf("  %s: %d\n", limit.Type, limit.Value)558  	}559  }560  if err := rateLimits.Err(); err != nil {561  	log.Fatal(err)562  }563  ```564565  ```java Java566  AnthropicClient client = AnthropicOkHttpClient.fromEnv();567568  var rateLimits = client.beta().organization().workspaces().rateLimits()569      .list("wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ");570571  for (var group : rateLimits.autoPager()) {572      var models = group.models()573          .map(modelIds -> " (" + String.join(", ", modelIds) + ")")574          .orElse("");575      IO.println(group.groupType().asString() + models);576      for (var limit : group.limits()) {577          IO.println("  " + limit.type() + ": " + limit.value());578      }579  }580  ```581582  ```php PHP583  $client = new Client();584585  $rateLimits = $client->beta->organization->workspaces->rateLimits->list(586      workspaceID: 'wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ',587  );588589  foreach ($rateLimits->data as $group) {590      $models = $group->models ? ' (' . implode(', ', $group->models) . ')' : '';591      echo "{$group->groupType}{$models}\n";592      foreach ($group->limits as $limit) {593          echo "  {$limit->type}: {$limit->value}\n";594      }595  }596  ```597598  ```ruby Ruby599  client = Anthropic::Client.new600601  workspace_id = "wrkspc_01JwQvzr7rXLA5AGx3HKfFUJ"602  rate_limits = client.beta.organization.workspaces.rate_limits.list(workspace_id)603604  rate_limits.data.each do |group|605    models = group.models ? " (#{group.models.join(", ")})" : ""606    puts "#{group.group_type}#{models}"607    group.limits.each do |limit|608      puts "  #{limit.type}: #{limit.value}"609    end610  end611  ```612</CodeGroup>613614```json615{616  "data": [617    {618      "type": "workspace_rate_limit",619      "group_type": "model_group",620      "models": ["claude-opus-5"],621      "limits": [622        { "type": "requests_per_minute", "value": 1000, "org_limit": 4000 },623        { "type": "input_tokens_per_minute", "value": 500000, "org_limit": 10000000 }624      ]625    },626    {627      "type": "workspace_rate_limit",628      "group_type": "model_group",629      "models": [630        "claude-opus-4-5",631        "claude-opus-4-5-20251101",632        "claude-opus-4-6",633        "claude-opus-4-7",634        "claude-opus-4-8"635      ],636      "limits": [637        { "type": "requests_per_minute", "value": 1000, "org_limit": 4000 },638        { "type": "input_tokens_per_minute", "value": 500000, "org_limit": 10000000 }639      ]640    }641  ],642  "next_page": null643}644```645646## Filtering by group type647648Both endpoints accept an optional `group_type` query parameter that restricts the response to a single category:649650<CodeGroup>651  ```bash cURL652  curl "https://api.anthropic.com/v1/organizations/rate_limits?group_type=batch" \653    -H "x-api-key: $ANTHROPIC_API_KEY" \654    -H "anthropic-version: 2023-06-01"655  ```656657  ```bash CLI658  ant beta:organization:rate-limits list --group-type batch659  ```660661  ```python Python662  client = anthropic.Anthropic()663664  rate_limits = client.beta.organization.rate_limits.list(group_type="batch")665666  for group in rate_limits:667      models = f" ({', '.join(group.models)})" if group.models else ""668      print(f"{group.group_type}{models}")669      for limit in group.limits:670          print(f"  {limit.type}: {limit.value}")671  ```672673  ```typescript TypeScript674  const client = new Anthropic();675676  const rateLimits = await client.beta.organization.rateLimits.list({ group_type: "batch" });677678  for await (const group of rateLimits) {679    const models = group.models ? ` (${group.models.join(", ")})` : "";680    console.log(`${group.group_type}${models}`);681    for (const limit of group.limits) {682      console.log(`  ${limit.type}: ${limit.value}`);683    }684  }685  ```686687  ```csharp C#688  using Anthropic.Models.Beta.Organization.RateLimits;689690  AnthropicClient client = new();691692  var rateLimits = await client.Beta.Organization.RateLimits.List(new()693  {694      GroupType = GroupType.Batch695  });696697  await foreach (var group in rateLimits.Paginate())698  {699      var models = group.Models is null ? "" : $" ({string.Join(", ", group.Models)})";700      Console.WriteLine($"{group.GroupType.Raw()}{models}");701      foreach (var limit in group.Limits)702      {703          Console.WriteLine($"  {limit.Type}: {limit.Value}");704      }705  }706  ```707708  ```go Go709  client := anthropic.NewClient()710711  rateLimits := client.Beta.Organization.RateLimits.ListAutoPaging(context.Background(), anthropic.BetaOrganizationRateLimitListParams{712  	GroupType: anthropic.BetaOrganizationRateLimitListParamsGroupTypeBatch,713  })714715  for rateLimits.Next() {716  	group := rateLimits.Current()717  	models := ""718  	if len(group.Models) > 0 {719  		models = fmt.Sprintf(" (%s)", strings.Join(group.Models, ", "))720  	}721  	fmt.Printf("%s%s\n", group.GroupType, models)722  	for _, limit := range group.Limits {723  		fmt.Printf("  %s: %d\n", limit.Type, limit.Value)724  	}725  }726  if err := rateLimits.Err(); err != nil {727  	log.Fatal(err)728  }729  ```730731  ```java Java732  import com.anthropic.models.beta.organization.ratelimits.RateLimitListParams;733734  void main() {735      AnthropicClient client = AnthropicOkHttpClient.fromEnv();736737      var params = RateLimitListParams.builder()738          .groupType(RateLimitListParams.GroupType.BATCH)739          .build();740      var rateLimits = client.beta().organization().rateLimits().list(params);741742      for (var group : rateLimits.autoPager()) {743          var models = group.models()744              .map(modelIds -> " (" + String.join(", ", modelIds) + ")")745              .orElse("");746          IO.println(group.groupType().asString() + models);747          for (var limit : group.limits()) {748              IO.println("  " + limit.type() + ": " + limit.value());749          }750      }751  }752  ```753754  ```php PHP755  use Anthropic\Beta\Organization\RateLimits\RateLimitListParams\GroupType;756  // ...757758  $client = new Client();759760  $rateLimits = $client->beta->organization->rateLimits->list(761      groupType: GroupType::BATCH,762  );763764  foreach ($rateLimits->data as $group) {765      $models = $group->models ? ' (' . implode(', ', $group->models) . ')' : '';766      echo "{$group->groupType}{$models}\n";767      foreach ($group->limits as $limit) {768          echo "  {$limit->type}: {$limit->value}\n";769      }770  }771  ```772773  ```ruby Ruby774  client = Anthropic::Client.new775776  rate_limits = client.beta.organization.rate_limits.list(group_type: :batch)777778  rate_limits.data.each do |group|779    models = group.models ? " (#{group.models.join(", ")})" : ""780    puts "#{group.group_type}#{models}"781    group.limits.each do |limit|782      puts "  #{limit.type}: #{limit.value}"783    end784  end785  ```786</CodeGroup>787788Valid values are `model_group`, `batch`, `token_count`, `files`, `skills`, and `web_search`.789790## Pagination791792Both endpoints accept a `page` query parameter and return a `next_page` field. Responses are currently always a single page, so `next_page` is `null`. Loop on `next_page` so your client paginates correctly without changes when the response grows.793794## Frequently asked questions795796### Which model strings appear in the `models` list?797798Every model ID and alias that counts against the group, including dated IDs (such as `claude-sonnet-4-5-20250929`) and undated aliases (such as `claude-sonnet-4-5`). Look up any model string you pass to the Messages API and you'll find it in exactly one `model_group` entry.799800### What does it mean if a group is missing from the workspace response?801802The workspace has no override for that group and inherits the organization-level limit. Query the organization endpoint to see the inherited values.803804### Can I update rate limits with this API?805806No. To set workspace rate limits, open the workspace in the [Claude Console](https://platform.claude.com/settings/workspaces) and use the **Rate limits** tab.807808## See also809810* [Rate limits](https://platform.claude.com/docs/en/api/rate-limits)811* [Admin API](https://platform.claude.com/docs/en/manage-claude/admin-api)812* [Admin API reference](https://platform.claude.com/docs/en/api/admin)813* [Workspaces](https://platform.claude.com/docs/en/manage-claude/workspaces)814* [Usage and Cost API](https://platform.claude.com/docs/en/manage-claude/usage-cost-api)815
Files main
Menu

Theme