速率限制
列出工作區速率限制
client.Organization.Workspaces.RateLimits.List(ctx, workspaceID, query) (*PageCursor[WorkspaceRateLimit], error)列出工作區的速率限制。
設定工作區速率限制
client.Organization.Workspaces.RateLimits.Update(ctx, rateLimitID, params) (*WorkspaceRateLimit, error)為工作區中的單一速率限制群組設定或清除速率限制覆寫。
Models
type WorkspaceRateLimit struct { Type: "workspace_rate_limit"; Group; Limits; /* 3 more */ }
type WorkspaceRateLimitOrganizationSource struct { Type: "organization" }
Type OrganizationAlways organization: no workspace-level override is stored, so the organization's value applies.
Always organization: no workspace-level override is stored, so the organization's value applies.
type WorkspaceRateLimitType stringRate 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.
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.
type WorkspaceRateLimitUpdateValueParam struct { Type; Value }
type WorkspaceRateLimitValue struct { Type; OrgLimit; Source; Value }
The limiter type (for example, requests_per_minute or input_tokens_per_minute_cache_aware).
The organization-level value for the same limiter type, for reference. null when the organization has no limit configured for this limiter type.
Source WorkspaceRateLimitValueSourceUnionWhere value comes from. organization values are listed only when include_inherited is true, and then value equals org_limit.
Where value comes from. organization values are listed only when include_inherited is true, and then value equals org_limit.
type WorkspaceRateLimitWorkspaceSource struct { Type: "workspace" }
Type WorkspaceAlways workspace: a workspace-level override is stored.
Always workspace: a workspace-level override is stored.
type WorkspaceRateLimitOrganizationSource struct { Type: "organization" }
Type OrganizationAlways organization: no workspace-level override is stored, so the organization's value applies.
Always organization: no workspace-level override is stored, so the organization's value applies.
The workspace's value for this limiter type: the workspace-level override when source.type is workspace, otherwise the organization's value.
type WorkspaceRateLimitWorkspaceSource struct { Type: "workspace" }
Type WorkspaceAlways workspace: a workspace-level override is stored.
Always workspace: a workspace-level override is stored.