Claude Platform Docs

Limiti di spesa

Models
class SpendLimit { $type = 'spend_limit'; $id; $amount; /* 6 more */ }
"spend_limit" type

Object type. Always spend_limit.

string id

Unique tagged ID of the spend limit (spl_...).

?string amount

Limit amount as a non-negative integer decimal string in the minor unit of currency (cents for USD): "50000" is $500.00. null means no numeric cap is configured at this scope — see the effective report for whether a limit applies.

\Datetime createdAt

RFC 3339 datetime at which the spend limit was created.

string currency

ISO 4217 code of the organization's billing currency; the unit for amount.

bool isEnabled

Read-only. false when extra usage is switched off for this organization (organization limit); amount is kept and applies again when it's switched back on. Always true for other limits.

Length of the window the limit resets over. amount caps spend within each period.

Scope scope

What the limit applies to. A tagged union on type; each variant carries the identifier for its scope.

\Datetime updatedAt

RFC 3339 datetime at which the spend limit was last modified.

class SpendLimitOrganizationScope { $type = 'organization'; }
"organization" type
class SpendLimitOrganizationServiceScope { $type = 'organization_service'; $service; }
"organization_service" type
string service
One of the following:
"daily"
"monthly"
"weekly"
class SpendLimitRBACGroupScope { $type = 'rbac_group'; $rbacGroupID; }
"rbac_group" type
string rbacGroupID
class SpendLimitScopedAPIKeyActor { $type = 'scoped_api_key_actor'; $scopedAPIKeyID; }
"scoped_api_key_actor" type
string scopedAPIKeyID
class SpendLimitSeatTierScope { $type = 'seat_tier'; $seatTier; }
"seat_tier" type
string seatTier
class SpendLimitUsageTierScope { $type = 'usage_tier'; }
"usage_tier" type

Scope type. Always usage_tier for this scope.

class SpendLimitUserActor { $type = 'user_actor'; $deleted; $emailAddress; /* 2 more */ }
"user_actor" type

Actor type. Always user_actor.

bool deleted

True only when the underlying account has been deleted.

?string emailAddress

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

?string name

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

string userID

Tagged ID of the user.

class SpendLimitUserScope { $type = 'user'; $userID; }
"user" type

Scope type. Always user for this scope.

string userID

Tagged ID of the member the spend limit applies to.

class SpendLimitWorkspaceScope { $type = 'workspace'; $workspaceID; }
"workspace" type

Scope type. Always workspace for this scope.

string workspaceID

Tagged ID of the workspace the spend limit applies to.

class SpendSummary { $actor; $amount; $currency; /* 5 more */ }
Actor actor
?string amount

Effective limit amount as a non-negative integer decimal string in the minor unit of currency (cents for USD). null means no limit applies for this row's period — each period resolves independently, so another period may still cap this member.

string currency

ISO 4217 code of the organization's billing currency; the unit for amount and period_to_date_spend.

Period this row's effective limit and spend are reported for.

string periodToDateSpend

The member's spend so far in the current period, as a non-negative decimal string in the minor unit of currency (cents for USD). May carry fractional minor units up to three decimal places (e.g. "12050.5") — metered usage is not rounded to whole cents. Reads as "0" when the spend reading is temporarily unavailable.

Scope scope
Source source
string spendLimitID

Limiti di spesaEffettivi

Elenca limiti di spesa effettivi
$client->organization->spendLimits->effective->list(?int limit, ?string page, ?list<SpendLimitPeriod> period, ?list<string> userIDs): PageCursor<SpendSummary>
GET/v1/organizations/spend_limits/effective

Elenca il limite di spesa effettivo e la spesa dall'inizio del periodo di ciascun membro.

Limiti di spesaRichieste di aumento

Elenca richieste di aumento del limite di spesa
$client->organization->spendLimits->increaseRequests->list(?list<string> actorIDs, ?int limit, ?string page, ?list<SpendLimitIncreaseRequestStatus> status): PageCursor<SpendLimitIncreaseRequest>
GET/v1/organizations/spend_limit_increase_requests

Elenca le richieste di aumento del limite di spesa, dalla più recente.

Ottieni richiesta di aumento del limite di spesa
$client->organization->spendLimits->increaseRequests->retrieve(string spendLimitIncreaseRequestID): SpendLimitIncreaseRequest
GET/v1/organizations/spend_limit_increase_requests/{spend_limit_increase_request_id}

Recupera una richiesta di aumento del limite di spesa.

Approva richiesta di aumento del limite di spesa
$client->organization->spendLimits->increaseRequests->approve(string spendLimitIncreaseRequestID, string amount, ?SpendLimitPeriod period, ?bool suppressNotification): IncreaseRequestApproveResponse
POST/v1/organizations/spend_limit_increase_requests/{spend_limit_increase_request_id}/approve

Approva una richiesta di aumento del limite di spesa in sospeso.

Rifiuta richiesta di aumento del limite di spesa
$client->organization->spendLimits->increaseRequests->deny(string spendLimitIncreaseRequestID, ?bool suppressNotification): SpendLimitIncreaseRequest
POST/v1/organizations/spend_limit_increase_requests/{spend_limit_increase_request_id}/deny

Rifiuta una richiesta di aumento del limite di spesa in sospeso.