Claude Platform Docs

设置工作区速率限制

$client->beta->organization->workspaces->rateLimits->update(string rateLimitID, string workspaceID, list<BetaWorkspaceRateLimitUpdateValue> limits): BetaWorkspaceRateLimit
POST/v1/organizations/workspaces/{workspace_id}/rate_limits/{rate_limit_id}

为工作区中的某个速率限制组设置或清除速率限制覆盖值。

只有 limits 中指定的限制器类型会发生变化:整数 value 设置该类型的覆盖值,null 则清除它。未指定的类型保持其当前值。高于组织自身限制的值会被存储,但组织限制仍然适用,因此实际执行的是两者中较低的值。

返回应用此请求后目标组的条目,其格式与 GET /v1/organizations/workspaces/{workspace_id}/rate_limits 返回的格式相同。更改将在大约一小时内生效。

Parameters
workspaceID: string⁠Path parameter

The ID of the workspace.

rateLimitID: string⁠Path parameter

The id of the organization's rate-limit entry to set overrides for.

Limits to set or clear. Unspecified limit types are unchanged.

Returns
class BetaWorkspaceRateLimit { $type = 'workspace_rate_limit'; $group; $limits; /* 3 more */ }
"workspace_rate_limit" type

Object type. Always workspace_rate_limit for workspace rate-limit entries.

Group group

The rate-limit group this entry's limits apply to.

The workspace's limiter values for this group. By default only the limiter types with a workspace-level override are listed. With include_inherited set to true, the limiter types the workspace inherits from the organization are listed too, each marked by source.

?list<string> models

Model names this entry's limits apply to, including aliases. null when group.type is not "model_group". The list covers the models this workspace has access to, so it can differ between workspaces.

string rateLimitID

The id of the organization's RateLimit entry this entry applies to.

string workspaceID

ID of the Workspace this entry applies to.

设置工作区速率限制
<?php

require_once dirname(__DIR__) . '/vendor/autoload.php';

use Anthropic\Client;
use Anthropic\Beta\Organization\Workspaces\RateLimits\BetaWorkspaceRateLimitType;

$client = new Client(apiKey: 'my-anthropic-api-key');

$betaWorkspaceRateLimit = $client
  ->beta
  ->organization
  ->workspaces
  ->rateLimits
  ->update(
  'rate_limit_id',
  workspaceID: 'workspace_id',
  limits: [['type' => BetaWorkspaceRateLimitType::FAST_ITPMCA, 'value' => 0]],
);

var_dump($betaWorkspaceRateLimit);
Returns Examples
Response 200
{
  "group": {
    "id": "id",
    "display_name": "display_name",
    "type": "model_group"
  },
  "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"
}