Claude Platform Docs

支出限额

Models
type SpendLimit struct { Type: "spend_limit"; ID; Amount; /* 6 more */ }

A configured spend limit: a cap on metered spend for one scope and period.

type SpendLimitOrganizationScope struct { Type: "organization" }
Type Organization
defaultorganization
type SpendLimitOrganizationServiceScope struct { Type: "organization_service"; Service }
Type OrganizationService
defaultorganization_service
Service string
type SpendLimitPeriod string
One of the following:
const SpendLimitPeriodDaily SpendLimitPeriod = "daily"
const SpendLimitPeriodMonthly SpendLimitPeriod = "monthly"
const SpendLimitPeriodWeekly SpendLimitPeriod = "weekly"
type SpendLimitRBACGroupScope struct { Type: "rbac_group"; RBACGroupID }
Type RBACGroup
defaultrbac_group
RBACGroupID string
type SpendLimitScopedAPIKeyActor struct { Type: "scoped_api_key_actor"; ScopedAPIKeyID }

A scoped Admin API key acting on behalf of the organization.

Type ScopedAPIKeyActor
defaultscoped_api_key_actor
ScopedAPIKeyID string
type SpendLimitSeatTierScope struct { Type: "seat_tier"; SeatTier }
Type SeatTier
defaultseat_tier
SeatTier string
type SpendLimitUsageTierScope struct { Type: "usage_tier" }

Scope of the monthly spend cap Anthropic sets for a Claude Console organization from its usage tier, or a higher cap Anthropic granted the organization. Read-only; its created_at and updated_at are the organization's creation time, so amount can change while updated_at stays the same.

Type UsageTier

Scope type. Always usage_tier for this scope.

defaultusage_tier
type SpendLimitUserActor struct { Type: "user_actor"; Deleted; EmailAddress; /* 2 more */ }

A user within the organization. name and email_address are null when the underlying account is unavailable or has been deleted; deleted is true only for deleted accounts.

Type UserActor

Actor type. Always user_actor.

defaultuser_actor
Deleted bool

True only when the underlying account has been deleted.

defaultfalse
EmailAddress string

The user's email address. Null when the account is unavailable or has been deleted.

Name string

The user's current display name. Null when the account is unavailable, has been deleted, or has no name set.

UserID string

Tagged ID of the user.

type SpendLimitUserScope struct { Type: "user"; UserID }

Scope selecting a single member of the organization.

Type User

Scope type. Always user for this scope.

defaultuser
UserID string

Tagged ID of the member the spend limit applies to.

type SpendLimitWorkspaceScope struct { Type: "workspace"; WorkspaceID }

Scope selecting one workspace of a Claude Console organization.

Type Workspace

Scope type. Always workspace for this scope.

defaultworkspace
WorkspaceID string

Tagged ID of the workspace the spend limit applies to.

type SpendSummary struct { Actor; Amount; Currency; /* 5 more */ }

Per-member effective-limit report row (GET /spend_limits/effective).

支出限额生效

列出生效的支出限额
client.Organization.SpendLimits.Effective.List(ctx, query) (*PageCursor[SpendSummary], error)
GET/v1/organizations/spend_limits/effective

列出每位成员的生效支出限额及本周期至今的支出。

支出限额提额请求

列出支出限额提额请求
client.Organization.SpendLimits.IncreaseRequests.List(ctx, query) (*PageCursor[SpendLimitIncreaseRequest], error)
GET/v1/organizations/spend_limit_increase_requests

列出支出限额提额请求,最新的在前。

获取支出限额提额请求
client.Organization.SpendLimits.IncreaseRequests.Get(ctx, spendLimitIncreaseRequestID) (*SpendLimitIncreaseRequest, error)
GET/v1/organizations/spend_limit_increase_requests/{spend_limit_increase_request_id}

检索支出限额提额请求。

批准支出限额提额请求
client.Organization.SpendLimits.IncreaseRequests.Approve(ctx, spendLimitIncreaseRequestID, body) (*OrganizationSpendLimitIncreaseRequestApproveResponse, error)
POST/v1/organizations/spend_limit_increase_requests/{spend_limit_increase_request_id}/approve

批准待处理的支出限额提额请求。

拒绝支出限额提额请求
client.Organization.SpendLimits.IncreaseRequests.Deny(ctx, spendLimitIncreaseRequestID, body) (*SpendLimitIncreaseRequest, error)
POST/v1/organizations/spend_limit_increase_requests/{spend_limit_increase_request_id}/deny

拒绝待处理的支出限额提额请求。