Claude Platform Docs

Mencantumkan Batas Pengeluaran Efektif

beta.organization.spend_limits.effective.list(**kwargs) -> SyncPageCursor[BetaSpendSummary]
GET/v1/organizations/spend_limits/effective

Mencantumkan batas pengeluaran efektif dan pengeluaran periode berjalan (period-to-date) setiap anggota.

Mengembalikan satu baris per (anggota, periode) yang batas pengeluarannya dapat ditentukan untuk anggota tersebut, beserta cakupan source tempat batas pengeluaran tersebut diwarisi. Paginasi dilakukan per anggota, sehingga periode milik seorang anggota tidak pernah terpecah ke beberapa halaman. Pencantuman batas Claude Console masih dalam pratinjau akses awal. Untuk meminta akses, hubungi tim akun Anthropic Anda.

Parameters
limit: Optional[int]⁠Query parameter

Maximum number of members per page. A member's period rows never split across pages, so a page may carry more rows than this. Defaults to 20.

default20
minimum1
maximum1000
page: Optional[str]⁠Query parameter

Opaque cursor from a previous response's next_page field.

period: Optional[List[Literal["daily", "monthly", "weekly"]]]⁠Query parameter

Restrict the report to these limit periods. Omit to return one row per period each member resolves a spend limit for.

maxItems3
One of the following:
"daily"
"monthly"
"weekly"
user_ids: Optional[Sequence[str]]⁠Query parameter

Restrict the report to these members, by tagged user ID (user_...). At most 100 entries.

maxItems100
Returns
class BetaSpendSummary: actor; amount; currency; ... # 5 more

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

Mencantumkan Batas Pengeluaran Efektif
import os
from anthropic import Anthropic

client = Anthropic(
    api_key=os.environ.get(
        "ANTHROPIC_API_KEY"
    ),  # This is the default and can be omitted
)
page = client.beta.organization.spend_limits.effective.list()
page = page.data[0]
print(page.spend_limit_id)
Returns Examples
Response 200
{
  "data": [
    {
      "actor": {
        "deleted": true,
        "email_address": "email_address",
        "name": "name",
        "type": "user_actor",
        "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
      },
      "amount": "50000",
      "currency": "USD",
      "period": "daily",
      "period_to_date_spend": "12050.5",
      "scope": {
        "type": "user",
        "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
      },
      "source": {
        "type": "user",
        "user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q"
      },
      "spend_limit_id": "spend_limit_id"
    }
  ],
  "next_page": "next_page"
}