Claude Platform Docs

获取支出限额

beta.organization.spend_limits.retrieve(spend_limit_id) -> BetaSpendLimit
GET/v1/organizations/spend_limits/{spend_limit_id}

按 ID 检索支出限额。

Parameters
spend_limit_id: str⁠Path parameter

ID of the Spend Limit.

Returns
class BetaSpendLimit: type: "spend_limit"; id; amount; ... # 6 more

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

获取支出限额
import os
from anthropic import Anthropic

client = Anthropic(
    api_key=os.environ.get(
        "ANTHROPIC_API_KEY"
    ),  # This is the default and can be omitted
)
beta_spend_limit = client.beta.organization.spend_limits.retrieve(
    "spend_limit_id",
)
print(beta_spend_limit.id)
Returns Examples
Response 200
{
  "id": "id",
  "amount": "50000",
  "created_at": "2019-12-27T18:11:19.117Z",
  "currency": "USD",
  "is_enabled": true,
  "period": "daily",
  "scope": {
    "type": "user",
    "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
  },
  "type": "spend_limit",
  "updated_at": "2019-12-27T18:11:19.117Z"
}