Mengatur Batas Pengeluaran
POST/v1/organizations/spend_limits
Mengatur batas pengeluaran.
Upsert dengan kunci (scope, period): mengatur batas yang sudah ada akan menimpanya di tempat. Organisasi Claude Enterprise mengatur batas user. Default tingkat seat, grup, dan tingkat organisasinya dikonfigurasi di claude.ai. Organisasi Claude Console mengatur batas organization dan workspace, yang bersifat bulanan dan selalu memiliki jumlah. Pengaturan batas tersebut masih dalam pratinjau akses awal. Untuk meminta akses, hubungi tim akun Anthropic Anda.
Parameters
Returns
Mengatur Batas Pengeluaran
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.set(
amount="50000",
scope={
"type": "user",
"user_id": "user_01WCz1FkmYMm4gnmykNKUu3Q",
},
)
print(beta_spend_limit.id)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"
}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"
}