Claude Platform Docs

速率限制

列出工作區速率限制
client.Beta.Organization.Workspaces.RateLimits.List(ctx, workspaceID, query) (*PageCursor[BetaWorkspaceRateLimit], error)
GET/v1/organizations/workspaces/{workspace_id}/rate_limits

列出工作區的速率限制。

設定工作區速率限制
client.Beta.Organization.Workspaces.RateLimits.Update(ctx, rateLimitID, params) (*BetaWorkspaceRateLimit, error)
POST/v1/organizations/workspaces/{workspace_id}/rate_limits/{rate_limit_id}

為工作區中的單一速率限制群組設定或清除速率限制覆寫。

Models
type BetaWorkspaceRateLimit struct { Type: "workspace_rate_limit"; Group; Limits; /* 3 more */ }
type BetaWorkspaceRateLimitOrganizationSource struct { Type: "organization" }
Type Organization

Always organization: no workspace-level override is stored, so the organization's value applies.

defaultorganization
type BetaWorkspaceRateLimitType string

Rate limiter type. input_tokens_per_minute counts every input token, cache reads included. input_tokens_per_minute_cache_aware does not count cache reads, and on current models the organization's input-token limit usually has this type. A workspace limit of either type applies alongside the organization's limit, not in place of it. Because cache reads count toward an input_tokens_per_minute limit, it can reject requests that read mostly from the cache while the organization's limit still has room.

One of the following:
const BetaWorkspaceRateLimitTypeFastItpmca BetaWorkspaceRateLimitType = "fast_itpmca"
const BetaWorkspaceRateLimitTypeFastOtpm BetaWorkspaceRateLimitType = "fast_otpm"
const BetaWorkspaceRateLimitTypeInputTokensPerMinute BetaWorkspaceRateLimitType = "input_tokens_per_minute"
const BetaWorkspaceRateLimitTypeInputTokensPerMinuteCacheAware BetaWorkspaceRateLimitType = "input_tokens_per_minute_cache_aware"
const BetaWorkspaceRateLimitTypeOutputTokensPerMinute BetaWorkspaceRateLimitType = "output_tokens_per_minute"
const BetaWorkspaceRateLimitTypeRequestsPerMinute BetaWorkspaceRateLimitType = "requests_per_minute"
const BetaWorkspaceRateLimitTypeTokensPerDay BetaWorkspaceRateLimitType = "tokens_per_day"
const BetaWorkspaceRateLimitTypeTokensPerMinute BetaWorkspaceRateLimitType = "tokens_per_minute"
const BetaWorkspaceRateLimitTypeToolUsesPerSecond BetaWorkspaceRateLimitType = "tool_uses_per_second"
type BetaWorkspaceRateLimitUpdateValueParam struct { Type; Value }
type BetaWorkspaceRateLimitValue struct { Type; OrgLimit; Source; Value }
Type string

The limiter type (for example, requests_per_minute or input_tokens_per_minute_cache_aware).

OrgLimit int64

The organization-level value for the same limiter type, for reference. null when the organization has no limit configured for this limiter type.

Source BetaWorkspaceRateLimitValueSourceUnion

Where value comes from. organization values are listed only when include_inherited is true, and then value equals org_limit.

One of the following:
type BetaWorkspaceRateLimitWorkspaceSource struct { Type: "workspace" }
Type Workspace

Always workspace: a workspace-level override is stored.

defaultworkspace
type BetaWorkspaceRateLimitOrganizationSource struct { Type: "organization" }
Type Organization

Always organization: no workspace-level override is stored, so the organization's value applies.

defaultorganization
Value int64

The workspace's value for this limiter type: the workspace-level override when source.type is workspace, otherwise the organization's value.

type BetaWorkspaceRateLimitWorkspaceSource struct { Type: "workspace" }
Type Workspace

Always workspace: a workspace-level override is stored.

defaultworkspace