支出上限の設定
POST/v1/organizations/spend_limits
支出上限を設定します。
(scope, period) をキーとするアップサートです。既に存在する上限を設定すると、
その場で上書きされます。Claude Enterpriseの組織は user の上限を設定します。
シートティア、グループ、組織レベルのデフォルトはclaude.aiで構成します。
Claude Consoleの組織は organization と workspace の上限を設定します。
これらは月単位で、常に金額を伴います。これらの上限の設定は早期アクセスプレビュー段階です。
アクセスをリクエストするには、Anthropicのアカウントチームにお問い合わせください。
Parameters
Returns
支出上限の設定
<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Anthropic\Client;
use Anthropic\Beta\AnthropicBeta;
use Anthropic\Beta\Organization\SpendLimits\SpendLimitPeriod;
$client = new Client(apiKey: 'my-anthropic-api-key');
$betaSpendLimit = $client->beta->organization->spendLimits->set(
amount: '50000',
scope: ['type' => 'user', 'userID' => 'user_01WxYzAbCdEfGhJkMnPqRsTu'],
period: SpendLimitPeriod::MONTHLY,
betas: [AnthropicBeta::MESSAGE_BATCHES_2024_09_24],
);
var_dump($betaSpendLimit);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_01WxYzAbCdEfGhJkMnPqRsTu"
},
"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_01WxYzAbCdEfGhJkMnPqRsTu"
},
"type": "spend_limit",
"updated_at": "2019-12-27T18:11:19.117Z"
}