Ausgabenlimit festlegen
POST/v1/organizations/spend_limits
Legt ein Ausgabenlimit fest.
Upsert mit dem Schlüssel (Scope, Zeitraum): Das Festlegen eines bereits bestehenden Limits
überschreibt es direkt. Eine Claude Enterprise-Organisation legt user-Limits
fest. Ihre Standardwerte auf Seat-Tier-, Gruppen- und Organisationsebene werden
in claude.ai konfiguriert. Eine Claude Console-Organisation legt organization- und
workspace-Limits fest, die monatlich gelten und immer einen Betrag enthalten. Das Festlegen dieser
Limits befindet sich in einer Early-Access-Preview. Um Zugang anzufordern, wende dich an dein
Anthropic-Account-Team.
Parameters
Returns
Ausgabenlimit festlegen
package com.anthropic.example;
import com.anthropic.client.AnthropicClient;
import com.anthropic.client.okhttp.AnthropicOkHttpClient;
import com.anthropic.models.beta.organization.spendlimits.BetaSpendLimit;
import com.anthropic.models.beta.organization.spendlimits.SpendLimitSetParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
AnthropicClient client = AnthropicOkHttpClient.fromEnv();
SpendLimitSetParams params = SpendLimitSetParams.builder()
.amount("50000")
.userScope("user_01WCz1FkmYMm4gnmykNKUu3Q")
.build();
BetaSpendLimit betaSpendLimit = client.beta().organization().spendLimits().set(params);
}
}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"
}