---
title: Spend Limits API
url: https://platform.claude.com/docs/de/manage-claude/spend-limits-api
description: Lege für jedes Claude Enterprise-Mitglied ein Ausgabenlimit fest, sieh nach, woher das Ausgabenlimit jedes Mitglieds vererbt wird, und prüfe oder bearbeite Anfragen von Mitgliedern nach einem höheren Limit.
---

Mit der Spend Limits API kannst du für jedes Claude Enterprise-Mitglied ein „spend limit“ (Ausgabenlimit) festlegen, nachsehen, woher das Ausgabenlimit jedes Mitglieds vererbt wird, und Anfragen von Mitgliedern nach einem höheren Limit prüfen oder bearbeiten.

Für Nutzungs- und Kosten-*Berichte* pro Benutzer und nach Zeiträumen siehe [Analytics APIs](https://platform.claude.com/docs/de/manage-claude/analytics-api).

<Check>
  **Admin-API-Key mit Scope erforderlich**

  Diese Endpunkte erfordern einen Admin-API-Key mit dem „scope" (Berechtigungsbereich) `read:spend_limits` (für `GET`-Endpunkte) oder dem Scope `write:spend_limits` (für `POST`- und `DELETE`-Endpunkte). Unter [Admin-API-Key erstellen](https://platform.claude.com/docs/de/manage-claude/admin-api-keys#create-a-key-for-a-claude-enterprise-organization) erfährst du, wo dein Primary Owner einen solchen Key erstellt und welche Scopes auszuwählen sind. Übergib den Key bei jeder Anfrage im Header `x-api-key`, zusammen mit dem Header [`anthropic-version`](https://platform.claude.com/docs/de/api/versioning).
</Check>

<Note>
  Die Spend Limits API ist nur für Claude Enterprise-Organisationen verfügbar. Sie ist nicht für Claude Platform-Organisationen (Claude Console) verfügbar.
</Note>

## Überblick

Die API stellt acht Endpunkte über zwei Ressourcen hinweg bereit:

| Ressource                                    | Endpunkte                                                                                                                                                                                                                                                            | Verwendung für                                                                                                                                                 |
| -------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Ausgabenlimits**                           | `GET /v1/organizations/spend_limits/effective`<br />`GET /v1/organizations/spend_limits/{spend_limit_id}`<br />`POST /v1/organizations/spend_limits`<br />`DELETE /v1/organizations/spend_limits/{spend_limit_id}`                                                   | Das effektive Ausgabenlimit und die bisherigen Ausgaben im laufenden Zeitraum jedes Mitglieds lesen; eine nutzerbezogene Überschreibung setzen oder entfernen. |
| **Anfragen zur Erhöhung des Ausgabenlimits** | `GET /v1/organizations/spend_limit_increase_requests`<br />`GET /v1/organizations/spend_limit_increase_requests/{id}`<br />`POST /v1/organizations/spend_limit_increase_requests/{id}/approve`<br />`POST /v1/organizations/spend_limit_increase_requests/{id}/deny` | Anfragen von Mitgliedern nach einem höheren Ausgabenlimit auflisten, mit dem für die Entscheidung nötigen Kontext; jede Anfrage genehmigen oder ablehnen.      |

Verwende die Endpunkte für **Ausgabenlimits**, um die Frage „Welches Ausgabenlimit gilt für jedes Mitglied, woher kommt es und wie nah ist das Mitglied daran?“ zu beantworten und um eine nutzerbezogene Überschreibung zu setzen. Verwende die Endpunkte für **Anfragen zur Erhöhung des Ausgabenlimits**, um die Warteschlange der von Mitgliedern eingereichten Anfragen abzuarbeiten.

## Voraussetzungen

* Deine Organisation muss einen Claude Enterprise-Plan haben.
* Nutzungsguthaben müssen für deine Organisation aktiviert sein. Dein primärer Eigentümer kann sie in den Abrechnungseinstellungen von claude.ai aktivieren.

Das SDK stellt diese Endpunkte unter `client.beta.organization.spend_limits` (typescript: `client.beta.organization.spendLimits`; csharp, go: `client.Beta.Organization.SpendLimits`; java: `client.beta().organization().spendLimits()`; php: `$client->beta->organization->spendLimits`) bereit und die `ant`-CLI unter `ant beta:organization:spend-limits`. Beide senden den Header `anthropic-version` für dich. Die Beispiele lesen den Admin-API-Key aus der Umgebungsvariable `ANTHROPIC_API_KEY`. Das SDK und die CLI rufen beim Durchlaufen der Ergebnisse automatisch weitere Seiten ab, daher legt `limit` die Seitengröße fest, nicht die Gesamtzahl (siehe [Paginierung](https://platform.claude.com/docs/de/manage-claude/spend-limits-api#pagination)).

## Schnellstart

Liste das effektive monatliche Ausgabenlimit und die bisherigen Ausgaben im laufenden Zeitraum jedes Mitglieds auf:

<CodeGroup>
  ```bash cURL
  curl "https://api.anthropic.com/v1/organizations/spend_limits/effective?limit=20" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01"
  ```

  ```bash CLI
  ant beta:organization:spend-limits:effective list --limit 20
  ```

  ```python Python
  client = anthropic.Anthropic()

  effective_limits = client.beta.organization.spend_limits.effective.list(limit=20)

  for effective_limit in effective_limits:
      scope = effective_limit.scope
      if scope.type == "user":
          amount = effective_limit.amount or "unlimited"
          print(f"{scope.user_id}: {effective_limit.period_to_date_spend} of {amount}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const effectiveLimits = await client.beta.organization.spendLimits.effective.list({
    limit: 20
  });

  for await (const effectiveLimit of effectiveLimits) {
    const { scope } = effectiveLimit;
    if (scope.type === "user") {
      const amount = effectiveLimit.amount ?? "unlimited";
      console.log(`${scope.user_id}: ${effectiveLimit.period_to_date_spend} of ${amount}`);
    }
  }
  ```

  ```csharp C#
  AnthropicClient client = new();

  var page = await client.Beta.Organization.SpendLimits.Effective.List(
      new() { Limit = 20 }
  );

  await foreach (var effectiveLimit in page.Paginate())
  {
      if (effectiveLimit.Scope.TryPickBetaSpendLimitUser(out var userScope))
      {
          var amount = effectiveLimit.Amount ?? "unlimited";
          Console.WriteLine($"{userScope.UserID}: {effectiveLimit.PeriodToDateSpend} of {amount}");
      }
  }
  ```

  ```go Go
  client := anthropic.NewClient()

  effectiveLimits := client.Beta.Organization.SpendLimits.Effective.ListAutoPaging(context.Background(), anthropic.BetaOrganizationSpendLimitEffectiveListParams{
  	Limit: anthropic.Int(20),
  })

  for effectiveLimits.Next() {
  	effectiveLimit := effectiveLimits.Current()
  	if userScope, ok := effectiveLimit.Scope.AsAny().(anthropic.BetaSpendLimitUserScope); ok {
  		amount := effectiveLimit.Amount
  		if !effectiveLimit.JSON.Amount.Valid() {
  			amount = "unlimited"
  		}
  		fmt.Printf("%s: %s of %s\n", userScope.UserID, effectiveLimit.PeriodToDateSpend, amount)
  	}
  }
  if err := effectiveLimits.Err(); err != nil {
  	log.Fatal(err)
  }
  ```

  ```java Java
  import com.anthropic.models.beta.organization.spendlimits.effective.EffectiveListParams;

  void main() {
      AnthropicClient client = AnthropicOkHttpClient.fromEnv();

      var params = EffectiveListParams.builder()
          .limit(20)
          .build();
      var effectiveLimits = client.beta().organization().spendLimits().effective().list(params);

      for (var effectiveLimit : effectiveLimits.autoPager()) {
          var amount = effectiveLimit.amount().orElse("unlimited");
          effectiveLimit.scope().user().ifPresent(userScope ->
              IO.println(userScope.userId() + ": " + effectiveLimit.periodToDateSpend() + " of " + amount)
          );
      }
  }
  ```

  ```php PHP
  use Anthropic\Beta\Organization\SpendLimits\SpendLimitUserScope;
  // ...

  $client = new Client();

  $effectiveLimits = $client->beta->organization->spendLimits->effective->list(limit: 20);

  foreach ($effectiveLimits->pagingEachItem() as $effectiveLimit) {
      $scope = $effectiveLimit->scope;
      if ($scope instanceof SpendLimitUserScope) {
          $amount = $effectiveLimit->amount ?? 'unlimited';
          echo "{$scope->userID}: {$effectiveLimit->periodToDateSpend} of {$amount}\n";
      }
  }
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  page = client.beta.organization.spend_limits.effective.list(limit: 20)

  page.auto_paging_each do |effective_limit|
    scope = effective_limit.scope
    if scope.is_a?(Anthropic::Models::Beta::Organization::BetaSpendLimitUserScope)
      amount = effective_limit.amount || "unlimited"
      puts "#{scope.user_id}: #{effective_limit.period_to_date_spend} of #{amount}"
    end
  end
  ```
</CodeGroup>

## Wichtige Konzepte

### Die Hierarchie der Ausgabenlimits

Für die Ausgaben jedes Mitglieds gilt ein **effektives Ausgabenlimit** („effective spend limit“), das aus einer Hierarchie von Scope-Ebenen aufgelöst wird. Wenn ein Mitglied keine nutzerbezogene Überschreibung hat, erbt es das Ausgabenlimit, das für seine Gruppe (falls deine Organisation gruppenbasierte Limits verwendet), seine Seat-Stufe oder den organisationsweiten Standard konfiguriert ist. Ein Gruppen-Ausgabenlimit ist ein Standardwert pro Mitglied: Jedes Mitglied, das es erbt, wird anhand seiner eigenen Ausgaben begrenzt, nicht anhand eines gemeinsamen Gruppenbudgets.

Das Lesen von `GET /v1/organizations/spend_limits/effective` gibt jedes aktuelle Mitglied mit seinem aufgelösten effektiven Ausgabenlimit zurück, dazu, woher dieses Limit aufgelöst wurde (`source`), sowie seine bisherigen Ausgaben im laufenden Zeitraum. Das Setzen einer nutzerbezogenen Überschreibung mit `POST /v1/organizations/spend_limits` fixiert ein Mitglied auf ein bestimmtes Ausgabenlimit, unabhängig davon, was es sonst erben würde. Das Löschen der Überschreibung setzt es auf das geerbte Ausgabenlimit zurück (oder lässt es unbegrenzt, falls keines existiert).

Das Feld `source` in der Zeile jedes Mitglieds gibt an, von welcher Ebene sein Ausgabenlimit aufgelöst wurde: `user` (eine nutzerbezogene Überschreibung), `seat_tier`, `rbac_group` oder `organization`. Behandle Scope-Typen als offene Menge; überspringe unbekannte Werte, anstatt fehlzuschlagen.

### Zeitraum

`period` ist das wiederkehrende Zeitfenster, über das das Ausgabenlimit durchgesetzt wird und die Ausgaben zurückgesetzt werden. Ein Ausgabenlimit wird durch sein Paar `(scope, period)` identifiziert. Derzeit ist `monthly` der einzige unterstützte Zeitraum; monatliche Ausgaben werden um 00:00 UTC am ersten Tag jedes Kalendermonats zurückgesetzt. Behandle `period` als offene Menge.

### Beträge und Währung

Alle Geldwerte sind Strings in **Untereinheiten der Abrechnungswährung der Organisation** (Cent bei USD). Zum Beispiel steht `"50000"` für 500,00 USD. Parse den Wert als Dezimalzahl und teile durch 100, um Dollar anzuzeigen; vermeide binäre Gleitkommazahlen bei großen Werten.

`amount` ist **nullable**. In der effektiven Zeile eines Mitglieds bedeutet `null` **unbegrenzt** (kein Ausgabenlimit) und `"0"` bedeutet, dass das Mitglied Claude nicht über die im Plan enthaltene Nutzung hinaus verwenden kann. In einer konfigurierten Ausgabenlimit-Zeile (wie von `GET /v1/organizations/spend_limits/{id}` zurückgegeben) bedeutet `null` lediglich, dass kein numerisches Ausgabenlimit gesetzt ist; lies die effektive Zeile des Mitglieds, um unbegrenzt von „nur enthaltene Nutzung“ zu unterscheiden.

`period_to_date_spend` sind die seit Beginn des aktuellen `period` aufgelaufenen Ausgaben des Mitglieds, im selben Untereinheiten-Format; der Wert kann einen Nachkommaanteil enthalten (zum Beispiel `"41280.125"`). Er kann als `"0"` erscheinen, wenn der Ausgabenwert vorübergehend nicht verfügbar ist; behandle ihn als informativ, nicht als transaktional.

### Lebenszyklus einer Erhöhungsanfrage

Eine **Anfrage zur Erhöhung des Ausgabenlimits** („spend limit increase request“) wird erstellt, wenn ein Mitglied in claude.ai auf **Request more usage** klickt. Anfragen werden nicht über diese API erstellt. Der `status` einer Anfrage ist einer der folgenden:

| Status     | Bedeutung                                                                                                                                                                                                                                                                                                                      |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `pending`  | Wartet auf eine Admin-Aktion. Die Anfrage enthält normalerweise eine aktuelle `spend_summary`, sodass du das aktuelle effektive Ausgabenlimit und die bisherigen Ausgaben im laufenden Zeitraum des Mitglieds sehen kannst, während du entscheidest; `spend_summary` kann `null` sein, wenn sie nicht berechnet werden konnte. |
| `approved` | Die Anfrage wurde mit Genehmigung abgeschlossen: Entweder hat ein Admin sie ausdrücklich genehmigt, eine andere Admin-Aktion hat das Ausgabenlimit des Mitglieds erhöht, oder der Anthropic-Support hat im Namen der Organisation ein Ausgabenlimit erhöht. `spend_summary` ist `null`.                                        |
| `denied`   | Ein Admin hat abgelehnt. `spend_summary` ist `null`. Das Mitglied kann sofort eine neue Anfrage senden; nur eine `pending`-Anfrage blockiert eine neue. Ein Admin kann das Ausgabenlimit des Mitglieds jederzeit weiterhin direkt erhöhen.                                                                                     |

Sowohl `approved` als auch `denied` sind Endzustände. Ein Mitglied hat zu jedem Zeitpunkt höchstens eine `pending`-Anfrage.

Das Genehmigen mit `POST /v1/organizations/spend_limit_increase_requests/{id}/approve` schreibt dieselbe nutzerbezogene Ausgabenlimit-Zeile, die auch `POST /v1/organizations/spend_limits` schreibt. Das direkte Setzen eines Ausgabenlimits überführt eine ausstehende Anfrage **nicht** in einen anderen Status; verwende den Approve-Endpunkt, um eine Anfrage abzuschließen.

Standardmäßig sendet Anthropic dem Mitglied eine E-Mail, wenn seine Anfrage genehmigt oder abgelehnt wird. Übergib `suppress_notification: true` beim Genehmigen oder Ablehnen, um diese E-Mail zu unterdrücken (zum Beispiel, wenn dein eigenes System das Mitglied benachrichtigt).

## Versionierung

Sende bei jeder Anfrage den Header `anthropic-version`; die verfügbaren Versionen findest du unter [API-Versionen](https://platform.claude.com/docs/de/api/versioning).

## Ratenlimits

Alle acht Endpunkte teilen sich ein einziges „rate limit“ (Ratenlimit) pro Organisation von **60 Anfragen pro Minute**. Anfragen über dem Limit geben **429 Too Many Requests** zurück.

## Paginierung

`GET /v1/organizations/spend_limits/effective` und `GET /v1/organizations/spend_limit_increase_requests` werden mit einem **opaken Cursor** paginiert. Die erste Anfrage gibt bis zu `limit` Zeilen plus einen `next_page`-Cursor zurück; übergib diesen Cursor unverändert als Parameter `page` bei der nächsten Anfrage und wiederhole dies, bis `next_page` `null` ist.

**Ändere Query-Parameter nicht mitten in einer Sequenz.** Cursor sind an die Filter gebunden, die sie ausgegeben haben. Wenn du `user_ids[]`, `period[]`, `status[]` oder `actor_ids[]` änderst und einen alten Cursor übergibst, erhältst du einen 400-Fehler mit *„cursor does not match current query parameters“*. Beginne stattdessen eine neue Sequenz ab der ersten Seite.

## Serialisierung von Listenparametern

Listenparameter verwenden die Klammernotation: Wiederhole den Parameternamen mit `[]` für jeden Wert.

```text wrap
user_ids[]=user_01AbCdEfGh&user_ids[]=user_01JkLmNoPq
```

## Fehlerantworten

Fehlerantworten folgen der Standardform, die unter [Fehler](https://platform.claude.com/docs/de/api/errors) dokumentiert ist. Gib die `request_id` aus dem Antwort-Body an, wenn du den Support kontaktierst.

## Ausgabenlimits

### Das effektive Ausgabenlimit jedes Mitglieds auflisten

`GET /v1/organizations/spend_limits/effective` gibt eine Zeile pro aktuellem Mitglied zurück, die das effektive Ausgabenlimit jedes Mitglieds, dessen `source` in der Scope-Hierarchie und dessen `period_to_date_spend` widerspiegelt. Erfordert den Scope `read:spend_limits`.

Vollständige Parameterdetails und Antwortschemata findest du unter [Effektive Ausgabenlimits auflisten](https://platform.claude.com/docs/de/api/beta/organization/spend_limits/effective/list) in der API-Referenz.

<CodeGroup>
  ```bash cURL
  curl "https://api.anthropic.com/v1/organizations/spend_limits/effective?limit=20" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01"
  ```

  ```bash CLI
  ant beta:organization:spend-limits:effective list --limit 20
  ```

  ```python Python
  client = anthropic.Anthropic()

  effective_limits = client.beta.organization.spend_limits.effective.list(limit=20)

  for effective_limit in effective_limits:
      scope = effective_limit.scope
      if scope.type == "user":
          amount = effective_limit.amount or "unlimited"
          print(f"{scope.user_id}: {effective_limit.period_to_date_spend} of {amount}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const effectiveLimits = await client.beta.organization.spendLimits.effective.list({
    limit: 20
  });

  for await (const effectiveLimit of effectiveLimits) {
    const { scope } = effectiveLimit;
    if (scope.type === "user") {
      const amount = effectiveLimit.amount ?? "unlimited";
      console.log(`${scope.user_id}: ${effectiveLimit.period_to_date_spend} of ${amount}`);
    }
  }
  ```

  ```csharp C#
  AnthropicClient client = new();

  var page = await client.Beta.Organization.SpendLimits.Effective.List(
      new() { Limit = 20 }
  );

  await foreach (var effectiveLimit in page.Paginate())
  {
      if (effectiveLimit.Scope.TryPickBetaSpendLimitUser(out var userScope))
      {
          var amount = effectiveLimit.Amount ?? "unlimited";
          Console.WriteLine($"{userScope.UserID}: {effectiveLimit.PeriodToDateSpend} of {amount}");
      }
  }
  ```

  ```go Go
  client := anthropic.NewClient()

  effectiveLimits := client.Beta.Organization.SpendLimits.Effective.ListAutoPaging(context.Background(), anthropic.BetaOrganizationSpendLimitEffectiveListParams{
  	Limit: anthropic.Int(20),
  })

  for effectiveLimits.Next() {
  	effectiveLimit := effectiveLimits.Current()
  	if userScope, ok := effectiveLimit.Scope.AsAny().(anthropic.BetaSpendLimitUserScope); ok {
  		amount := effectiveLimit.Amount
  		if !effectiveLimit.JSON.Amount.Valid() {
  			amount = "unlimited"
  		}
  		fmt.Printf("%s: %s of %s\n", userScope.UserID, effectiveLimit.PeriodToDateSpend, amount)
  	}
  }
  if err := effectiveLimits.Err(); err != nil {
  	log.Fatal(err)
  }
  ```

  ```java Java
  import com.anthropic.models.beta.organization.spendlimits.effective.EffectiveListParams;

  void main() {
      AnthropicClient client = AnthropicOkHttpClient.fromEnv();

      var params = EffectiveListParams.builder()
          .limit(20)
          .build();
      var effectiveLimits = client.beta().organization().spendLimits().effective().list(params);

      for (var effectiveLimit : effectiveLimits.autoPager()) {
          var amount = effectiveLimit.amount().orElse("unlimited");
          effectiveLimit.scope().user().ifPresent(userScope ->
              IO.println(userScope.userId() + ": " + effectiveLimit.periodToDateSpend() + " of " + amount)
          );
      }
  }
  ```

  ```php PHP
  use Anthropic\Beta\Organization\SpendLimits\SpendLimitUserScope;
  // ...

  $client = new Client();

  $effectiveLimits = $client->beta->organization->spendLimits->effective->list(limit: 20);

  foreach ($effectiveLimits->pagingEachItem() as $effectiveLimit) {
      $scope = $effectiveLimit->scope;
      if ($scope instanceof SpendLimitUserScope) {
          $amount = $effectiveLimit->amount ?? 'unlimited';
          echo "{$scope->userID}: {$effectiveLimit->periodToDateSpend} of {$amount}\n";
      }
  }
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  page = client.beta.organization.spend_limits.effective.list(limit: 20)

  page.auto_paging_each do |effective_limit|
    scope = effective_limit.scope
    if scope.is_a?(Anthropic::Models::Beta::Organization::BetaSpendLimitUserScope)
      amount = effective_limit.amount || "unlimited"
      puts "#{scope.user_id}: #{effective_limit.period_to_date_spend} of #{amount}"
    end
  end
  ```
</CodeGroup>

```json
{
  "data": [
    {
      "scope": { "type": "user", "user_id": "user_01AbCdEfGh" },
      "actor": {
        "type": "user_actor",
        "user_id": "user_01AbCdEfGh",
        "name": "Jane Smith",
        "email_address": "jane@example.com",
        "deleted": false
      },
      "amount": "50000",
      "currency": "USD",
      "period": "monthly",
      "source": { "type": "seat_tier", "seat_tier": "enterprise_standard" },
      "spend_limit_id": "spl_01XyZaBcDeFgHiJkLmNoPq",
      "period_to_date_spend": "31402.5"
    }
  ],
  "next_page": "page_..."
}
```

### Ein einzelnes Ausgabenlimit abrufen

`GET /v1/organizations/spend_limits/{spend_limit_id}` gibt ein konfiguriertes Ausgabenlimit anhand seiner ID zurück. Verwende es, um die Zeile zu untersuchen, auf die ein Feld `spend_limit_id` verwiesen hat. Erfordert den Scope `read:spend_limits`.

Vollständige Parameterdetails und Antwortschemata findest du unter [Ein Ausgabenlimit abrufen](https://platform.claude.com/docs/de/api/beta/organization/spend_limits/retrieve) in der API-Referenz.

<CodeGroup>
  ```bash cURL
  curl "https://api.anthropic.com/v1/organizations/spend_limits/spl_01AbCdEfGhIjKlMnOpQrSt" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01"
  ```

  ```bash CLI
  ant beta:organization:spend-limits retrieve \
    --spend-limit-id spl_01AbCdEfGhIjKlMnOpQrSt
  ```

  ```python Python
  client = anthropic.Anthropic()

  spend_limit = client.beta.organization.spend_limits.retrieve(
      "spl_01AbCdEfGhIjKlMnOpQrSt"
  )

  amount = spend_limit.amount or "none"
  print(f"id: {spend_limit.id}")
  print(f"amount: {amount}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const spendLimit = await client.beta.organization.spendLimits.retrieve(
    "spl_01AbCdEfGhIjKlMnOpQrSt"
  );

  const amount = spendLimit.amount ?? "none";
  console.log(`id: ${spendLimit.id}`);
  console.log(`amount: ${amount}`);
  ```

  ```csharp C#
  AnthropicClient client = new();

  var spendLimit = await client.Beta.Organization.SpendLimits.Retrieve(
      "spl_01AbCdEfGhIjKlMnOpQrSt"
  );

  var amount = spendLimit.Amount ?? "none";
  Console.WriteLine($"id: {spendLimit.ID}");
  Console.WriteLine($"amount: {amount}");
  ```

  ```go Go
  client := anthropic.NewClient()

  spendLimit, err := client.Beta.Organization.SpendLimits.Get(context.Background(), "spl_01AbCdEfGhIjKlMnOpQrSt")
  if err != nil {
  	log.Fatal(err)
  }

  amount := spendLimit.Amount
  if !spendLimit.JSON.Amount.Valid() {
  	amount = "none"
  }

  fmt.Printf("id: %s\n", spendLimit.ID)
  fmt.Printf("amount: %s\n", amount)
  ```

  ```java Java
  AnthropicClient client = AnthropicOkHttpClient.fromEnv();

  var spendLimit = client.beta().organization().spendLimits()
      .retrieve("spl_01AbCdEfGhIjKlMnOpQrSt");

  var amount = spendLimit.amount().orElse("none");
  IO.println("id: " + spendLimit.id());
  IO.println("amount: " + amount);
  ```

  ```php PHP
  $client = new Client();

  $spendLimit = $client->beta->organization->spendLimits->retrieve('spl_01AbCdEfGhIjKlMnOpQrSt');

  $amount = $spendLimit->amount ?? 'none';
  echo "id: {$spendLimit->id}\n";
  echo "amount: {$amount}\n";
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  spend_limit = client.beta.organization.spend_limits.retrieve("spl_01AbCdEfGhIjKlMnOpQrSt")

  amount = spend_limit.amount || "none"
  puts "id: #{spend_limit.id}"
  puts "amount: #{amount}"
  ```
</CodeGroup>

### Eine nutzerbezogene Überschreibung setzen

`POST /v1/organizations/spend_limits` setzt eine nutzerbezogene Überschreibung des Ausgabenlimits. Dies ist ein Upsert mit dem Schlüssel `(scope, period)`: Das Setzen eines Limits für einen Nutzer und Zeitraum, für die bereits eines existiert, überschreibt es an Ort und Stelle. Dieser Endpunkt akzeptiert nur `scope.type: "user"`; Standardwerte auf Seat-Stufen-, Gruppen- und Organisationsebene werden in den claude.ai-Einstellungen konfiguriert. Erfordert den Scope `write:spend_limits`.

Vollständige Parameterdetails und Antwortschemata findest du unter [Ein Ausgabenlimit erstellen](https://platform.claude.com/docs/de/api/beta/organization/spend_limits/set) in der API-Referenz.

<CodeGroup>
  ```bash cURL
  curl -X POST "https://api.anthropic.com/v1/organizations/spend_limits" \
    -H "content-type: application/json" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01" \
    -d '{"scope": {"type": "user", "user_id": "user_01AbCdEfGh"}, "amount": "75000"}'
  ```

  ```bash CLI
  ant beta:organization:spend-limits set \
    --scope '{type: user, user_id: user_01AbCdEfGh}' \
    --amount 75000
  ```

  ```python Python
  client = anthropic.Anthropic()

  spend_limit = client.beta.organization.spend_limits.set(
      scope={"type": "user", "user_id": "user_01AbCdEfGh"}, amount="75000"
  )

  print(f"id: {spend_limit.id}")
  print(f"amount: {spend_limit.amount}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const spendLimit = await client.beta.organization.spendLimits.set({
    scope: { type: "user", user_id: "user_01AbCdEfGh" },
    amount: "75000"
  });

  console.log(`id: ${spendLimit.id}`);
  console.log(`amount: ${spendLimit.amount}`);
  ```

  ```csharp C#
  using Anthropic.Models.Beta.Organization.SpendLimits;

  AnthropicClient client = new();

  var spendLimit = await client.Beta.Organization.SpendLimits.Set(
      new()
      {
          Scope = new BetaSpendLimitUserScope("user_01AbCdEfGh"),
          Amount = "75000",
      }
  );

  Console.WriteLine($"id: {spendLimit.ID}");
  Console.WriteLine($"amount: {spendLimit.Amount}");
  ```

  ```go Go
  client := anthropic.NewClient()

  spendLimit, err := client.Beta.Organization.SpendLimits.Set(context.Background(), anthropic.BetaOrganizationSpendLimitSetParams{
  	Scope: anthropic.BetaOrganizationSpendLimitSetParamsScopeUnion{
  		OfUser: &anthropic.BetaSpendLimitUserScopeParam{UserID: "user_01AbCdEfGh"},
  	},
  	Amount: anthropic.String("75000"),
  })
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Printf("id: %s\n", spendLimit.ID)
  fmt.Printf("amount: %s\n", spendLimit.Amount)
  ```

  ```java Java
  import com.anthropic.models.beta.organization.spendlimits.SpendLimitSetParams;

  void main() {
      AnthropicClient client = AnthropicOkHttpClient.fromEnv();

      var params = SpendLimitSetParams.builder()
          .userScope("user_01AbCdEfGh")
          .amount("75000")
          .build();
      var spendLimit = client.beta().organization().spendLimits().set(params);

      IO.println("id: " + spendLimit.id());
      IO.println("amount: " + spendLimit.amount().orElseThrow());
  }
  ```

  ```php PHP
  use Anthropic\Beta\Organization\SpendLimits\SpendLimitUserScope;
  // ...

  $client = new Client();

  $spendLimit = $client->beta->organization->spendLimits->set(
      scope: SpendLimitUserScope::with(userID: 'user_01AbCdEfGh'),
      amount: '75000',
  );

  echo "id: {$spendLimit->id}\n";
  echo "amount: {$spendLimit->amount}\n";
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  spend_limit = client.beta.organization.spend_limits.set(
    scope: { type: :user, user_id: "user_01AbCdEfGh" },
    amount: "75000"
  )

  puts "id: #{spend_limit.id}"
  puts "amount: #{spend_limit.amount}"
  ```
</CodeGroup>

```json
{
  "type": "spend_limit",
  "id": "spl_01RsTuVwXyZaBcDeFgHiJk",
  "created_at": "2026-05-11T10:02:44Z",
  "updated_at": "2026-05-11T10:02:44Z",
  "scope": { "type": "user", "user_id": "user_01AbCdEfGh" },
  "amount": "75000",
  "currency": "USD",
  "period": "monthly"
}
```

### Eine nutzerbezogene Überschreibung entfernen

`DELETE /v1/organizations/spend_limits/{spend_limit_id}` entfernt eine nutzerbezogene Überschreibung, woraufhin das Mitglied auf einen etwaigen geerbten Standardwert der Seat-Stufe, Gruppe oder Organisation zurückfällt. Zeilen auf Seat-Stufen-, Gruppen- und Organisationsebene können über diesen Endpunkt nicht gelöscht werden. Erfordert den Scope `write:spend_limits`.

Vollständige Parameterdetails und Antwortschemata findest du unter [Ein Ausgabenlimit löschen](https://platform.claude.com/docs/de/api/beta/organization/spend_limits/delete) in der API-Referenz.

<CodeGroup>
  ```bash cURL
  curl -X DELETE "https://api.anthropic.com/v1/organizations/spend_limits/spl_01RsTuVwXyZaBcDeFgHiJk" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01"
  ```

  ```bash CLI
  ant beta:organization:spend-limits delete \
    --spend-limit-id spl_01RsTuVwXyZaBcDeFgHiJk
  ```

  ```python Python
  client = anthropic.Anthropic()

  deleted_spend_limit = client.beta.organization.spend_limits.delete(
      "spl_01RsTuVwXyZaBcDeFgHiJk"
  )

  print(f"id: {deleted_spend_limit.id}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const deletedSpendLimit = await client.beta.organization.spendLimits.delete(
    "spl_01RsTuVwXyZaBcDeFgHiJk"
  );

  console.log(`id: ${deletedSpendLimit.id}`);
  ```

  ```csharp C#
  AnthropicClient client = new();

  var deletedSpendLimit = await client.Beta.Organization.SpendLimits.Delete(
      "spl_01RsTuVwXyZaBcDeFgHiJk"
  );

  Console.WriteLine($"id: {deletedSpendLimit.ID}");
  ```

  ```go Go
  client := anthropic.NewClient()

  deletedSpendLimit, err := client.Beta.Organization.SpendLimits.Delete(context.Background(), "spl_01RsTuVwXyZaBcDeFgHiJk")
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Printf("id: %s\n", deletedSpendLimit.ID)
  ```

  ```java Java
  AnthropicClient client = AnthropicOkHttpClient.fromEnv();

  var deletedSpendLimit = client.beta().organization().spendLimits()
      .delete("spl_01RsTuVwXyZaBcDeFgHiJk");

  IO.println("id: " + deletedSpendLimit.id());
  ```

  ```php PHP
  $client = new Client();

  $deletedSpendLimit = $client->beta->organization->spendLimits->delete('spl_01RsTuVwXyZaBcDeFgHiJk');

  echo "id: {$deletedSpendLimit->id}\n";
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  deleted_spend_limit = client.beta.organization.spend_limits.delete("spl_01RsTuVwXyZaBcDeFgHiJk")

  puts "id: #{deleted_spend_limit.id}"
  ```
</CodeGroup>

## Anfragen zur Erhöhung des Ausgabenlimits

### Erhöhungsanfragen auflisten

`GET /v1/organizations/spend_limit_increase_requests` listet Anfragen auf, die neuesten zuerst. Filtere nach `status[]` (`pending`, `approved`, `denied`) und `actor_ids[]`. Die Liste schließt Anfragen aus, deren Antragsteller nicht mehr Mitglied der Organisation ist. Erfordert den Scope `read:spend_limits`.

Vollständige Parameterdetails und Antwortschemata findest du unter [Anfragen zur Erhöhung des Ausgabenlimits auflisten](https://platform.claude.com/docs/de/api/beta/organization/spend_limits/increase_requests/list) in der API-Referenz.

<CodeGroup>
  ```bash cURL
  curl -g "https://api.anthropic.com/v1/organizations/spend_limit_increase_requests?status[]=pending&limit=50" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01"
  ```

  ```bash CLI
  ant beta:organization:spend-limits:increase-requests list \
    --status pending \
    --limit 50
  ```

  ```python Python
  client = anthropic.Anthropic()

  increase_requests = client.beta.organization.spend_limits.increase_requests.list(
      status=["pending"], limit=50
  )

  for increase_request in increase_requests:
      print(f"{increase_request.id}: {increase_request.status}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const increaseRequests = await client.beta.organization.spendLimits.increaseRequests.list({
    status: ["pending"],
    limit: 50
  });

  for await (const increaseRequest of increaseRequests) {
    console.log(`${increaseRequest.id}: ${increaseRequest.status}`);
  }
  ```

  ```csharp C#
  using Anthropic.Models.Beta.Organization.SpendLimits.IncreaseRequests;

  AnthropicClient client = new();

  var page = await client.Beta.Organization.SpendLimits.IncreaseRequests.List(
      new() { Status = [BetaSpendLimitIncreaseRequestStatus.Pending], Limit = 50 }
  );

  await foreach (var increaseRequest in page.Paginate())
  {
      Console.WriteLine($"{increaseRequest.ID}: {increaseRequest.Status.Raw()}");
  }
  ```

  ```go Go
  client := anthropic.NewClient()

  increaseRequests := client.Beta.Organization.SpendLimits.IncreaseRequests.ListAutoPaging(context.Background(), anthropic.BetaOrganizationSpendLimitIncreaseRequestListParams{
  	Status: []anthropic.BetaSpendLimitIncreaseRequestStatus{anthropic.BetaSpendLimitIncreaseRequestStatusPending},
  	Limit:  anthropic.Int(50),
  })

  for increaseRequests.Next() {
  	increaseRequest := increaseRequests.Current()
  	fmt.Printf("%s: %s\n", increaseRequest.ID, increaseRequest.Status)
  }
  if err := increaseRequests.Err(); err != nil {
  	log.Fatal(err)
  }
  ```

  ```java Java
  import com.anthropic.models.beta.organization.spendlimits.increaserequests.BetaSpendLimitIncreaseRequestStatus;
  import com.anthropic.models.beta.organization.spendlimits.increaserequests.IncreaseRequestListParams;

  void main() {
      AnthropicClient client = AnthropicOkHttpClient.fromEnv();

      var params = IncreaseRequestListParams.builder()
          .addStatus(BetaSpendLimitIncreaseRequestStatus.PENDING)
          .limit(50)
          .build();
      var increaseRequests = client.beta().organization().spendLimits().increaseRequests().list(params);

      for (var increaseRequest : increaseRequests.autoPager()) {
          IO.println(increaseRequest.id() + ": " + increaseRequest.status().asString());
      }
  }
  ```

  ```php PHP
  $client = new Client();

  $increaseRequests = $client->beta->organization->spendLimits->increaseRequests->list(
      status: ['pending'],
      limit: 50,
  );

  foreach ($increaseRequests->pagingEachItem() as $increaseRequest) {
      echo "{$increaseRequest->id}: {$increaseRequest->status}\n";
  }
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  page = client.beta.organization.spend_limits.increase_requests.list(status: [:pending], limit: 50)

  page.auto_paging_each do |increase_request|
    puts "#{increase_request.id}: #{increase_request.status}"
  end
  ```
</CodeGroup>

Jede ausstehende Anfrage enthält eine aktuelle `spend_summary`, die das aktuelle effektive Ausgabenlimit und die bisherigen Ausgaben im laufenden Zeitraum des Antragstellers zeigt – genug, um ohne separate Abfrage zu entscheiden.

### Eine einzelne Erhöhungsanfrage abrufen

`GET /v1/organizations/spend_limit_increase_requests/{id}` gibt eine Anfrage anhand ihrer ID zurück. Erfordert den Scope `read:spend_limits`.

Vollständige Parameterdetails und Antwortschemata findest du unter [Eine Anfrage zur Erhöhung des Ausgabenlimits abrufen](https://platform.claude.com/docs/de/api/beta/organization/spend_limits/increase_requests/retrieve) in der API-Referenz.

<CodeGroup>
  ```bash cURL
  curl "https://api.anthropic.com/v1/organizations/spend_limit_increase_requests/slir_01AbCdEfGhIjKlMnOpQrSt" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01"
  ```

  ```bash CLI
  ant beta:organization:spend-limits:increase-requests retrieve \
    --spend-limit-increase-request-id slir_01AbCdEfGhIjKlMnOpQrSt
  ```

  ```python Python
  client = anthropic.Anthropic()

  increase_request = client.beta.organization.spend_limits.increase_requests.retrieve(
      "slir_01AbCdEfGhIjKlMnOpQrSt"
  )

  print(f"id: {increase_request.id}")
  print(f"status: {increase_request.status}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const increaseRequest = await client.beta.organization.spendLimits.increaseRequests.retrieve(
    "slir_01AbCdEfGhIjKlMnOpQrSt"
  );

  console.log(`id: ${increaseRequest.id}`);
  console.log(`status: ${increaseRequest.status}`);
  ```

  ```csharp C#
  AnthropicClient client = new();

  var increaseRequest = await client.Beta.Organization.SpendLimits.IncreaseRequests.Retrieve(
      "slir_01AbCdEfGhIjKlMnOpQrSt"
  );

  Console.WriteLine($"id: {increaseRequest.ID}");
  Console.WriteLine($"status: {increaseRequest.Status.Raw()}");
  ```

  ```go Go
  client := anthropic.NewClient()

  increaseRequest, err := client.Beta.Organization.SpendLimits.IncreaseRequests.Get(context.Background(), "slir_01AbCdEfGhIjKlMnOpQrSt")
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Printf("id: %s\n", increaseRequest.ID)
  fmt.Printf("status: %s\n", increaseRequest.Status)
  ```

  ```java Java
  AnthropicClient client = AnthropicOkHttpClient.fromEnv();

  var increaseRequest = client.beta().organization().spendLimits().increaseRequests()
      .retrieve("slir_01AbCdEfGhIjKlMnOpQrSt");

  IO.println("id: " + increaseRequest.id());
  IO.println("status: " + increaseRequest.status().asString());
  ```

  ```php PHP
  $client = new Client();

  $increaseRequest = $client->beta->organization->spendLimits->increaseRequests->retrieve(
      'slir_01AbCdEfGhIjKlMnOpQrSt',
  );

  echo "id: {$increaseRequest->id}\n";
  echo "status: {$increaseRequest->status}\n";
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  increase_request = client.beta.organization.spend_limits.increase_requests.retrieve(
    "slir_01AbCdEfGhIjKlMnOpQrSt"
  )

  puts "id: #{increase_request.id}"
  puts "status: #{increase_request.status}"
  ```
</CodeGroup>

### Eine Erhöhungsanfrage genehmigen

`POST /v1/organizations/spend_limit_increase_requests/{id}/approve` genehmigt eine ausstehende Anfrage: Es schreibt ein nutzerbezogenes Ausgabenlimit in Höhe des vom Admin angegebenen `amount` für den Antragsteller und überführt die Anfrage in den Status `approved`. Die Anfrage enthält keinen angefragten Betrag; du gibst das neue Ausgabenlimit bei der Genehmigung an. Erfordert den Scope `write:spend_limits`.

Vollständige Parameterdetails und Antwortschemata findest du unter [Eine Anfrage zur Erhöhung des Ausgabenlimits genehmigen](https://platform.claude.com/docs/de/api/beta/organization/spend_limits/increase_requests/approve) in der API-Referenz.

<CodeGroup>
  ```bash cURL
  curl -X POST "https://api.anthropic.com/v1/organizations/spend_limit_increase_requests/slir_01AbCdEfGhIjKlMnOpQrSt/approve" \
    -H "content-type: application/json" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01" \
    -d '{"amount": "75000", "suppress_notification": true}'
  ```

  ```bash CLI
  ant beta:organization:spend-limits:increase-requests approve \
    --spend-limit-increase-request-id slir_01AbCdEfGhIjKlMnOpQrSt \
    --amount 75000 \
    --suppress-notification
  ```

  ```python Python
  client = anthropic.Anthropic()

  increase_request = client.beta.organization.spend_limits.increase_requests.approve(
      "slir_01AbCdEfGhIjKlMnOpQrSt", amount="75000", suppress_notification=True
  )

  print(f"id: {increase_request.id}")
  print(f"status: {increase_request.status}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const increaseRequest = await client.beta.organization.spendLimits.increaseRequests.approve(
    "slir_01AbCdEfGhIjKlMnOpQrSt",
    {
      amount: "75000",
      suppress_notification: true
    }
  );

  console.log(`id: ${increaseRequest.id}`);
  console.log(`status: ${increaseRequest.status}`);
  ```

  ```csharp C#
  AnthropicClient client = new();

  var increaseRequest = await client.Beta.Organization.SpendLimits.IncreaseRequests.Approve(
      "slir_01AbCdEfGhIjKlMnOpQrSt",
      new() { Amount = "75000", SuppressNotification = true }
  );

  Console.WriteLine($"id: {increaseRequest.ID}");
  Console.WriteLine($"status: {increaseRequest.Status.Raw()}");
  ```

  ```go Go
  client := anthropic.NewClient()

  increaseRequest, err := client.Beta.Organization.SpendLimits.IncreaseRequests.Approve(
  	context.Background(),
  	"slir_01AbCdEfGhIjKlMnOpQrSt",
  	anthropic.BetaOrganizationSpendLimitIncreaseRequestApproveParams{
  		Amount:               "75000",
  		SuppressNotification: anthropic.Bool(true),
  	},
  )
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Printf("id: %s\n", increaseRequest.ID)
  fmt.Printf("status: %s\n", increaseRequest.Status)
  ```

  ```java Java
  import com.anthropic.models.beta.organization.spendlimits.increaserequests.IncreaseRequestApproveParams;

  void main() {
      AnthropicClient client = AnthropicOkHttpClient.fromEnv();

      var params = IncreaseRequestApproveParams.builder()
          .amount("75000")
          .suppressNotification(true)
          .build();
      var increaseRequest = client.beta().organization().spendLimits().increaseRequests()
          .approve("slir_01AbCdEfGhIjKlMnOpQrSt", params);

      IO.println("id: " + increaseRequest.id());
      IO.println("status: " + increaseRequest.status().asString());
  }
  ```

  ```php PHP
  $client = new Client();

  $increaseRequest = $client->beta->organization->spendLimits->increaseRequests->approve(
      'slir_01AbCdEfGhIjKlMnOpQrSt',
      amount: '75000',
      suppressNotification: true,
  );

  echo "id: {$increaseRequest->id}\n";
  echo "status: {$increaseRequest->status}\n";
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  increase_request = client.beta.organization.spend_limits.increase_requests.approve(
    "slir_01AbCdEfGhIjKlMnOpQrSt",
    amount: "75000",
    suppress_notification: true
  )

  puts "id: #{increase_request.id}"
  puts "status: #{increase_request.status}"
  ```
</CodeGroup>

### Eine Erhöhungsanfrage ablehnen

`POST /v1/organizations/spend_limit_increase_requests/{id}/deny` lehnt eine ausstehende Anfrage ab. Idempotent bei `denied`: Das Ablehnen einer bereits abgelehnten Anfrage gibt 200 mit der bestehenden Ressource zurück. Der Endpunkt weist den Versuch zurück, eine bereits genehmigte Anfrage abzulehnen, damit Automatisierungen einen Wiederholungsversuch von einer widersprüchlichen Entscheidung unterscheiden können. Erfordert den Scope `write:spend_limits`.

Vollständige Parameterdetails und Antwortschemata findest du unter [Eine Anfrage zur Erhöhung des Ausgabenlimits ablehnen](https://platform.claude.com/docs/de/api/beta/organization/spend_limits/increase_requests/deny) in der API-Referenz.

<CodeGroup>
  ```bash cURL
  curl -X POST "https://api.anthropic.com/v1/organizations/spend_limit_increase_requests/slir_01AbCdEfGhIjKlMnOpQrSt/deny" \
    -H "content-type: application/json" \
    -H "x-api-key: $ANTHROPIC_API_KEY" \
    -H "anthropic-version: 2023-06-01" \
    -d '{"suppress_notification": true}'
  ```

  ```bash CLI
  ant beta:organization:spend-limits:increase-requests deny \
    --spend-limit-increase-request-id slir_01AbCdEfGhIjKlMnOpQrSt \
    --suppress-notification
  ```

  ```python Python
  client = anthropic.Anthropic()

  increase_request = client.beta.organization.spend_limits.increase_requests.deny(
      "slir_01AbCdEfGhIjKlMnOpQrSt", suppress_notification=True
  )

  print(f"id: {increase_request.id}")
  print(f"status: {increase_request.status}")
  ```

  ```typescript TypeScript
  const client = new Anthropic();

  const increaseRequest = await client.beta.organization.spendLimits.increaseRequests.deny(
    "slir_01AbCdEfGhIjKlMnOpQrSt",
    {
      suppress_notification: true
    }
  );

  console.log(`id: ${increaseRequest.id}`);
  console.log(`status: ${increaseRequest.status}`);
  ```

  ```csharp C#
  AnthropicClient client = new();

  var increaseRequest = await client.Beta.Organization.SpendLimits.IncreaseRequests.Deny(
      "slir_01AbCdEfGhIjKlMnOpQrSt",
      new() { SuppressNotification = true }
  );

  Console.WriteLine($"id: {increaseRequest.ID}");
  Console.WriteLine($"status: {increaseRequest.Status.Raw()}");
  ```

  ```go Go
  client := anthropic.NewClient()

  increaseRequest, err := client.Beta.Organization.SpendLimits.IncreaseRequests.Deny(
  	context.Background(),
  	"slir_01AbCdEfGhIjKlMnOpQrSt",
  	anthropic.BetaOrganizationSpendLimitIncreaseRequestDenyParams{
  		SuppressNotification: anthropic.Bool(true),
  	},
  )
  if err != nil {
  	log.Fatal(err)
  }

  fmt.Printf("id: %s\n", increaseRequest.ID)
  fmt.Printf("status: %s\n", increaseRequest.Status)
  ```

  ```java Java
  import com.anthropic.models.beta.organization.spendlimits.increaserequests.IncreaseRequestDenyParams;

  void main() {
      AnthropicClient client = AnthropicOkHttpClient.fromEnv();

      var params = IncreaseRequestDenyParams.builder()
          .suppressNotification(true)
          .build();
      var increaseRequest = client.beta().organization().spendLimits().increaseRequests()
          .deny("slir_01AbCdEfGhIjKlMnOpQrSt", params);

      IO.println("id: " + increaseRequest.id());
      IO.println("status: " + increaseRequest.status().asString());
  }
  ```

  ```php PHP
  $client = new Client();

  $increaseRequest = $client->beta->organization->spendLimits->increaseRequests->deny(
      'slir_01AbCdEfGhIjKlMnOpQrSt',
      suppressNotification: true,
  );

  echo "id: {$increaseRequest->id}\n";
  echo "status: {$increaseRequest->status}\n";
  ```

  ```ruby Ruby
  client = Anthropic::Client.new

  increase_request = client.beta.organization.spend_limits.increase_requests.deny(
    "slir_01AbCdEfGhIjKlMnOpQrSt",
    suppress_notification: true
  )

  puts "id: #{increase_request.id}"
  puts "status: #{increase_request.status}"
  ```
</CodeGroup>

## Beispiel-Workflows

Einige dieser Workflows kombinieren die Spend Limits API mit den Kosten-Endpunkten der [Analytics APIs](https://platform.claude.com/docs/de/manage-claude/analytics-api). Die Analytics-Kosten-Endpunkte sind für organisationsweite Ausgabenberichte über einen Datumsbereich konzipiert. `GET /spend_limits/effective` gibt die Obergrenze zurück, die derzeit für jedes Mitglied gilt. Beginne einen Durchlauf mit Analytics, um herauszufinden, welche Mitglieder du dir ansehen solltest, und lies dann ihre aktuellen Obergrenzen mit `/effective`.

Spend-Limits-Endpunkte erfordern die `spend_limits`-Scopes und Analytics-Kosten-Endpunkte erfordern `read:analytics`; unter [Analytics APIs](https://platform.claude.com/docs/de/manage-claude/analytics-api) erfährst du, wie du den Zugriff einrichtest. Die Beispiele verwenden einen Admin-API-Key, der die Scopes aller aufgerufenen APIs besitzt. Ein primärer Eigentümer [wählt diese Scopes beim Erstellen des Keys aus](https://platform.claude.com/docs/de/manage-claude/admin-api-keys#choose-scopes-for-a-claude-enterprise-key). Alle Geldwerte sind bei beiden APIs Dezimal-Strings in Untereinheiten (Cent). Beide APIs paginieren mit einem opaken Cursor. Lege ein explizites `limit` fest und blättere durch `next_page`, bis es `null` ist, um die gesamte Organisation abzudecken.

### Den Prüfprozess für Erhöhungsanfragen automatisieren

Führe einen geplanten Job aus, der ausstehende Anfragen abruft, die Genehmigungsrichtlinie deiner Organisation anwendet und jede Anfrage abschließt.

1. Liste ausstehende Anfragen auf:

   <CodeGroup>
     ```bash cURL
     curl -g "https://api.anthropic.com/v1/organizations/spend_limit_increase_requests?status[]=pending&limit=100" \
       -H "x-api-key: $ANTHROPIC_API_KEY" \
       -H "anthropic-version: 2023-06-01"
     ```

     ```bash CLI
     ant beta:organization:spend-limits:increase-requests list \
       --status pending \
       --limit 100
     ```

     ```python Python
     client = anthropic.Anthropic()

     increase_requests = client.beta.organization.spend_limits.increase_requests.list(
         status=["pending"], limit=100
     )

     for increase_request in increase_requests:
         print(f"{increase_request.id}: {increase_request.status}")
     ```

     ```typescript TypeScript
     const client = new Anthropic();

     const increaseRequests = await client.beta.organization.spendLimits.increaseRequests.list({
       status: ["pending"],
       limit: 100
     });

     for await (const increaseRequest of increaseRequests) {
       console.log(`${increaseRequest.id}: ${increaseRequest.status}`);
     }
     ```

     ```csharp C#
     using Anthropic.Models.Beta.Organization.SpendLimits.IncreaseRequests;

     AnthropicClient client = new();

     var page = await client.Beta.Organization.SpendLimits.IncreaseRequests.List(
         new() { Status = [BetaSpendLimitIncreaseRequestStatus.Pending], Limit = 100 }
     );

     await foreach (var increaseRequest in page.Paginate())
     {
         Console.WriteLine($"{increaseRequest.ID}: {increaseRequest.Status.Raw()}");
     }
     ```

     ```go Go
     client := anthropic.NewClient()

     increaseRequests := client.Beta.Organization.SpendLimits.IncreaseRequests.ListAutoPaging(context.Background(), anthropic.BetaOrganizationSpendLimitIncreaseRequestListParams{
     	Status: []anthropic.BetaSpendLimitIncreaseRequestStatus{anthropic.BetaSpendLimitIncreaseRequestStatusPending},
     	Limit:  anthropic.Int(100),
     })

     for increaseRequests.Next() {
     	increaseRequest := increaseRequests.Current()
     	fmt.Printf("%s: %s\n", increaseRequest.ID, increaseRequest.Status)
     }
     if err := increaseRequests.Err(); err != nil {
     	log.Fatal(err)
     }
     ```

     ```java Java
     import com.anthropic.models.beta.organization.spendlimits.increaserequests.BetaSpendLimitIncreaseRequestStatus;
     import com.anthropic.models.beta.organization.spendlimits.increaserequests.IncreaseRequestListParams;

     void main() {
         AnthropicClient client = AnthropicOkHttpClient.fromEnv();

         var params = IncreaseRequestListParams.builder()
             .addStatus(BetaSpendLimitIncreaseRequestStatus.PENDING)
             .limit(100)
             .build();
         var increaseRequests = client.beta().organization().spendLimits().increaseRequests().list(params);

         for (var increaseRequest : increaseRequests.autoPager()) {
             IO.println(increaseRequest.id() + ": " + increaseRequest.status().asString());
         }
     }
     ```

     ```php PHP
     $client = new Client();

     $increaseRequests = $client->beta->organization->spendLimits->increaseRequests->list(
         status: ['pending'],
         limit: 100,
     );

     foreach ($increaseRequests->pagingEachItem() as $increaseRequest) {
         echo "{$increaseRequest->id}: {$increaseRequest->status}\n";
     }
     ```

     ```ruby Ruby
     client = Anthropic::Client.new

     page = client.beta.organization.spend_limits.increase_requests.list(status: [:pending], limit: 100)

     page.auto_paging_each do |increase_request|
       puts "#{increase_request.id}: #{increase_request.status}"
     end
     ```
   </CodeGroup>

   Jede Anfrage enthält die `actor.user_id` des Antragstellers und eine aktuelle `spend_summary` mit seinem aktuellen effektiven `amount` und `period_to_date_spend` – genug, um ohne separate Abfrage zu entscheiden.

2. Wende deine Richtlinie an. Genehmige zum Beispiel automatisch, wenn der aktuelle `amount` des Mitglieds unter einem Schwellenwert liegt, und leite größere Obergrenzen zur manuellen Prüfung weiter.

3. Schließe jede Anfrage ab. Zum Genehmigen gib die neue Obergrenze an:

   <CodeGroup>
     ```bash cURL
     curl -X POST "https://api.anthropic.com/v1/organizations/spend_limit_increase_requests/slir_01AbCdEfGhIjKlMnOpQrSt/approve" \
       -H "content-type: application/json" \
       -H "x-api-key: $ANTHROPIC_API_KEY" \
       -H "anthropic-version: 2023-06-01" \
       -d '{"amount": "75000", "suppress_notification": true}'
     ```

     ```bash CLI
     ant beta:organization:spend-limits:increase-requests approve \
       --spend-limit-increase-request-id slir_01AbCdEfGhIjKlMnOpQrSt \
       --amount 75000 \
       --suppress-notification
     ```

     ```python Python
     client = anthropic.Anthropic()

     increase_request = client.beta.organization.spend_limits.increase_requests.approve(
         "slir_01AbCdEfGhIjKlMnOpQrSt", amount="75000", suppress_notification=True
     )

     print(f"id: {increase_request.id}")
     print(f"status: {increase_request.status}")
     ```

     ```typescript TypeScript
     const client = new Anthropic();

     const increaseRequest = await client.beta.organization.spendLimits.increaseRequests.approve(
       "slir_01AbCdEfGhIjKlMnOpQrSt",
       {
         amount: "75000",
         suppress_notification: true
       }
     );

     console.log(`id: ${increaseRequest.id}`);
     console.log(`status: ${increaseRequest.status}`);
     ```

     ```csharp C#
     AnthropicClient client = new();

     var increaseRequest = await client.Beta.Organization.SpendLimits.IncreaseRequests.Approve(
         "slir_01AbCdEfGhIjKlMnOpQrSt",
         new() { Amount = "75000", SuppressNotification = true }
     );

     Console.WriteLine($"id: {increaseRequest.ID}");
     Console.WriteLine($"status: {increaseRequest.Status.Raw()}");
     ```

     ```go Go
     client := anthropic.NewClient()

     increaseRequest, err := client.Beta.Organization.SpendLimits.IncreaseRequests.Approve(
     	context.Background(),
     	"slir_01AbCdEfGhIjKlMnOpQrSt",
     	anthropic.BetaOrganizationSpendLimitIncreaseRequestApproveParams{
     		Amount:               "75000",
     		SuppressNotification: anthropic.Bool(true),
     	},
     )
     if err != nil {
     	log.Fatal(err)
     }

     fmt.Printf("id: %s\n", increaseRequest.ID)
     fmt.Printf("status: %s\n", increaseRequest.Status)
     ```

     ```java Java
     import com.anthropic.models.beta.organization.spendlimits.increaserequests.IncreaseRequestApproveParams;

     void main() {
         AnthropicClient client = AnthropicOkHttpClient.fromEnv();

         var params = IncreaseRequestApproveParams.builder()
             .amount("75000")
             .suppressNotification(true)
             .build();
         var increaseRequest = client.beta().organization().spendLimits().increaseRequests()
             .approve("slir_01AbCdEfGhIjKlMnOpQrSt", params);

         IO.println("id: " + increaseRequest.id());
         IO.println("status: " + increaseRequest.status().asString());
     }
     ```

     ```php PHP
     $client = new Client();

     $increaseRequest = $client->beta->organization->spendLimits->increaseRequests->approve(
         'slir_01AbCdEfGhIjKlMnOpQrSt',
         amount: '75000',
         suppressNotification: true,
     );

     echo "id: {$increaseRequest->id}\n";
     echo "status: {$increaseRequest->status}\n";
     ```

     ```ruby Ruby
     client = Anthropic::Client.new

     increase_request = client.beta.organization.spend_limits.increase_requests.approve(
       "slir_01AbCdEfGhIjKlMnOpQrSt",
       amount: "75000",
       suppress_notification: true
     )

     puts "id: #{increase_request.id}"
     puts "status: #{increase_request.status}"
     ```
   </CodeGroup>

   Rufe zum Ablehnen stattdessen den [Deny-Endpunkt](https://platform.claude.com/docs/de/manage-claude/spend-limits-api#deny-an-increase-request) mit derselben ID auf. Übergib `suppress_notification: true`, wenn dein eigenes System den Antragsteller benachrichtigt.

### Mitglieder identifizieren, die nahe an ihrem Ausgabenlimit sind

Finde Mitglieder, die sich ihrer Obergrenze nähern, damit du sie erhöhen kannst, bevor sie blockiert werden.

1. Rufe die Ausgaben jedes Mitglieds im laufenden Monat aus der Analytics API ab (eine Zeile pro Mitglied, standardmäßig höchste Ausgaben zuerst):

   <CodeGroup>
     ```bash cURL
     curl "https://api.anthropic.com/v1/organizations/analytics/user_cost_report?starting_at=2026-06-01T00:00:00Z&limit=1000" \
       -H "x-api-key: $ANTHROPIC_API_KEY" \
       -H "anthropic-version: 2023-06-01"
     ```

     ```bash CLI
     ant beta:organization:analytics:user-cost-report list \
       --starting-at 2026-06-01T00:00:00Z \
       --limit 1000
     ```

     ```python Python
     client = anthropic.Anthropic()

     cost_rows = client.beta.organization.analytics.user_cost_report.list(
         starting_at="2026-06-01T00:00:00Z", limit=1000
     )

     for cost_row in cost_rows:
         print(f"{cost_row.actor.user_id}: {cost_row.amount}")
     ```

     ```typescript TypeScript
     const client = new Anthropic();

     const costRows = await client.beta.organization.analytics.userCostReport.list({
       starting_at: "2026-06-01T00:00:00Z",
       limit: 1000
     });

     for await (const costRow of costRows) {
       console.log(`${costRow.actor.user_id}: ${costRow.amount}`);
     }
     ```

     ```csharp C#
     AnthropicClient client = new();

     var page = await client.Beta.Organization.Analytics.UserCostReport.List(
         new()
         {
             StartingAt = DateTimeOffset.Parse("2026-06-01T00:00:00Z"),
             Limit = 1000,
         }
     );

     await foreach (var costRow in page.Paginate())
     {
         Console.WriteLine($"{costRow.Actor.UserID}: {costRow.Amount}");
     }
     ```

     ```go Go
     client := anthropic.NewClient()

     costRows := client.Beta.Organization.Analytics.UserCostReport.ListAutoPaging(context.Background(), anthropic.BetaOrganizationAnalyticsUserCostReportListParams{
     	StartingAt: time.Date(2026, time.June, 1, 0, 0, 0, 0, time.UTC),
     	Limit:      anthropic.Int(1000),
     })

     for costRows.Next() {
     	costRow := costRows.Current()
     	fmt.Printf("%s: %s\n", costRow.Actor.UserID, costRow.Amount)
     }
     if err := costRows.Err(); err != nil {
     	log.Fatal(err)
     }
     ```

     ```java Java
     import com.anthropic.models.beta.organization.analytics.usercostreport.UserCostReportListParams;
     import java.time.OffsetDateTime;

     void main() {
         AnthropicClient client = AnthropicOkHttpClient.fromEnv();

         var params = UserCostReportListParams.builder()
             .startingAt(OffsetDateTime.parse("2026-06-01T00:00:00Z"))
             .limit(1000)
             .build();
         var costRows = client.beta().organization().analytics().userCostReport().list(params);

         for (var costRow : costRows.autoPager()) {
             IO.println(costRow.actor().userId() + ": " + costRow.amount());
         }
     }
     ```

     ```php PHP
     $client = new Client();

     $costRows = $client->beta->organization->analytics->userCostReport->list(
         startingAt: new \DateTimeImmutable('2026-06-01T00:00:00Z'),
         limit: 1000,
     );

     foreach ($costRows->pagingEachItem() as $costRow) {
         echo "{$costRow->actor->userID}: {$costRow->amount}\n";
     }
     ```

     ```ruby Ruby
     client = Anthropic::Client.new

     page = client.beta.organization.analytics.user_cost_report.list(
       starting_at: Time.utc(2026, 6, 1),
       limit: 1000
     )

     page.auto_paging_each do |cost_row|
       puts "#{cost_row.actor.user_id}: #{cost_row.amount}"
     end
     ```
   </CodeGroup>

   Jede Zeile enthält `actor.user_id`, `actor.email_address` und `amount` (die Ausgaben des Mitglieds in Cent). Blättere durch `next_page`, um die gesamte Organisation abzudecken.

2. Rufe für die Mitglieder mit den höchsten Ausgaben (oder alle über einem Dollar-Schwellenwert) die effektiven Obergrenzen in Batches ab:

   <CodeGroup>
     ```bash cURL
     curl -g "https://api.anthropic.com/v1/organizations/spend_limits/effective?user_ids[]=user_01AbCdEfGh&user_ids[]=user_01JkLmNoPq&limit=100" \
       -H "x-api-key: $ANTHROPIC_API_KEY" \
       -H "anthropic-version: 2023-06-01"
     ```

     ```bash CLI
     ant beta:organization:spend-limits:effective list \
       --user-id user_01AbCdEfGh \
       --user-id user_01JkLmNoPq \
       --limit 100
     ```

     ```python Python
     client = anthropic.Anthropic()

     effective_limits = client.beta.organization.spend_limits.effective.list(
         user_ids=["user_01AbCdEfGh", "user_01JkLmNoPq"], limit=100
     )

     for effective_limit in effective_limits:
         scope = effective_limit.scope
         if scope.type == "user":
             amount = effective_limit.amount or "unlimited"
             print(f"{scope.user_id}: {effective_limit.period_to_date_spend} of {amount}")
     ```

     ```typescript TypeScript
     const client = new Anthropic();

     const effectiveLimits = await client.beta.organization.spendLimits.effective.list({
       user_ids: ["user_01AbCdEfGh", "user_01JkLmNoPq"],
       limit: 100
     });

     for await (const effectiveLimit of effectiveLimits) {
       const { scope } = effectiveLimit;
       if (scope.type === "user") {
         const amount = effectiveLimit.amount ?? "unlimited";
         console.log(`${scope.user_id}: ${effectiveLimit.period_to_date_spend} of ${amount}`);
       }
     }
     ```

     ```csharp C#
     AnthropicClient client = new();

     var page = await client.Beta.Organization.SpendLimits.Effective.List(
         new() { UserIds = ["user_01AbCdEfGh", "user_01JkLmNoPq"], Limit = 100 }
     );

     await foreach (var effectiveLimit in page.Paginate())
     {
         if (effectiveLimit.Scope.TryPickBetaSpendLimitUser(out var userScope))
         {
             var amount = effectiveLimit.Amount ?? "unlimited";
             Console.WriteLine($"{userScope.UserID}: {effectiveLimit.PeriodToDateSpend} of {amount}");
         }
     }
     ```

     ```go Go
     client := anthropic.NewClient()

     effectiveLimits := client.Beta.Organization.SpendLimits.Effective.ListAutoPaging(context.Background(), anthropic.BetaOrganizationSpendLimitEffectiveListParams{
     	UserIDs: []string{"user_01AbCdEfGh", "user_01JkLmNoPq"},
     	Limit:   anthropic.Int(100),
     })

     for effectiveLimits.Next() {
     	effectiveLimit := effectiveLimits.Current()
     	if userScope, ok := effectiveLimit.Scope.AsAny().(anthropic.BetaSpendLimitUserScope); ok {
     		amount := effectiveLimit.Amount
     		if !effectiveLimit.JSON.Amount.Valid() {
     			amount = "unlimited"
     		}
     		fmt.Printf("%s: %s of %s\n", userScope.UserID, effectiveLimit.PeriodToDateSpend, amount)
     	}
     }
     if err := effectiveLimits.Err(); err != nil {
     	log.Fatal(err)
     }
     ```

     ```java Java
     import com.anthropic.models.beta.organization.spendlimits.effective.EffectiveListParams;

     void main() {
         AnthropicClient client = AnthropicOkHttpClient.fromEnv();

         var params = EffectiveListParams.builder()
             .addUserId("user_01AbCdEfGh")
             .addUserId("user_01JkLmNoPq")
             .limit(100)
             .build();
         var effectiveLimits = client.beta().organization().spendLimits().effective().list(params);

         for (var effectiveLimit : effectiveLimits.autoPager()) {
             var amount = effectiveLimit.amount().orElse("unlimited");
             effectiveLimit.scope().user().ifPresent(userScope ->
                 IO.println(userScope.userId() + ": " + effectiveLimit.periodToDateSpend() + " of " + amount)
             );
         }
     }
     ```

     ```php PHP
     use Anthropic\Beta\Organization\SpendLimits\SpendLimitUserScope;
     // ...

     $client = new Client();

     $effectiveLimits = $client->beta->organization->spendLimits->effective->list(
         userIDs: ['user_01AbCdEfGh', 'user_01JkLmNoPq'],
         limit: 100,
     );

     foreach ($effectiveLimits->pagingEachItem() as $effectiveLimit) {
         $scope = $effectiveLimit->scope;
         if ($scope instanceof SpendLimitUserScope) {
             $amount = $effectiveLimit->amount ?? 'unlimited';
             echo "{$scope->userID}: {$effectiveLimit->periodToDateSpend} of {$amount}\n";
         }
     }
     ```

     ```ruby Ruby
     client = Anthropic::Client.new

     page = client.beta.organization.spend_limits.effective.list(
       user_ids: ["user_01AbCdEfGh", "user_01JkLmNoPq"],
       limit: 100
     )

     page.auto_paging_each do |effective_limit|
       scope = effective_limit.scope
       if scope.is_a?(Anthropic::Models::Beta::Organization::BetaSpendLimitUserScope)
         amount = effective_limit.amount || "unlimited"
         puts "#{scope.user_id}: #{effective_limit.period_to_date_spend} of #{amount}"
       end
     end
     ```
   </CodeGroup>

   Jede Zeile gibt die Obergrenze als `amount` zurück (`null` = unbegrenzt, `"0"` = nur enthaltene Nutzung) zusammen mit `period_to_date_spend`.

3. Berechne für jedes Mitglied mit einer positiven Obergrenze `period_to_date_spend / amount` und markiere diejenigen, die bei oder über deinem Schwellenwert liegen (zum Beispiel 80 Prozent). Behandle eine Obergrenze von `"0"` als bereits am Limit. Es gibt keinen serverseitigen Filter für dieses Verhältnis.

4. Handle bei markierten Mitgliedern: Erhöhe die Obergrenze mit `POST /v1/organizations/spend_limits`, genehmige eine ausstehende Erhöhungsanfrage, falls eine existiert, oder nimm Kontakt mit dem Mitglied auf.

### Mitglieder mit sich schnell ändernder Nutzung finden

Mache Mitglieder sichtbar, deren Ausgaben von Woche zu Woche sprunghaft gestiegen sind.

1. Rufe die täglichen Kosten pro Mitglied für die letzten zwei Wochen aus der Analytics API ab:

   <CodeGroup>
     ```bash cURL
     curl "https://api.anthropic.com/v1/organizations/analytics/user_cost_report?starting_at=2026-06-09T00:00:00Z&ending_at=2026-06-23T00:00:00Z&bucket_width=1d&limit=1000" \
       -H "x-api-key: $ANTHROPIC_API_KEY" \
       -H "anthropic-version: 2023-06-01"
     ```

     ```bash CLI
     ant beta:organization:analytics:user-cost-report list \
       --starting-at 2026-06-09T00:00:00Z \
       --ending-at 2026-06-23T00:00:00Z \
       --bucket-width 1d \
       --limit 1000
     ```

     ```python Python
     client = anthropic.Anthropic()

     cost_rows = client.beta.organization.analytics.user_cost_report.list(
         starting_at="2026-06-09T00:00:00Z",
         ending_at="2026-06-23T00:00:00Z",
         bucket_width="1d",
         limit=1000,
     )

     for cost_row in cost_rows:
         print(f"{cost_row.actor.user_id} {cost_row.starting_at}: {cost_row.amount}")
     ```

     ```typescript TypeScript
     const client = new Anthropic();

     const costRows = await client.beta.organization.analytics.userCostReport.list({
       starting_at: "2026-06-09T00:00:00Z",
       ending_at: "2026-06-23T00:00:00Z",
       bucket_width: "1d",
       limit: 1000
     });

     for await (const costRow of costRows) {
       console.log(`${costRow.actor.user_id} ${costRow.starting_at}: ${costRow.amount}`);
     }
     ```

     ```csharp C#
     using Anthropic.Models.Beta.Organization.Analytics.UserCostReport;

     AnthropicClient client = new();

     var page = await client.Beta.Organization.Analytics.UserCostReport.List(
         new()
         {
             StartingAt = DateTimeOffset.Parse("2026-06-09T00:00:00Z"),
             EndingAt = DateTimeOffset.Parse("2026-06-23T00:00:00Z"),
             BucketWidth = BucketWidth.Day,
             Limit = 1000,
         }
     );

     await foreach (var costRow in page.Paginate())
     {
         Console.WriteLine($"{costRow.Actor.UserID} {costRow.StartingAt}: {costRow.Amount}");
     }
     ```

     ```go Go
     client := anthropic.NewClient()

     costRows := client.Beta.Organization.Analytics.UserCostReport.ListAutoPaging(context.Background(), anthropic.BetaOrganizationAnalyticsUserCostReportListParams{
     	StartingAt:  time.Date(2026, time.June, 9, 0, 0, 0, 0, time.UTC),
     	EndingAt:    anthropic.Time(time.Date(2026, time.June, 23, 0, 0, 0, 0, time.UTC)),
     	BucketWidth: anthropic.BetaOrganizationAnalyticsUserCostReportListParamsBucketWidthDay,
     	Limit:       anthropic.Int(1000),
     })

     for costRows.Next() {
     	costRow := costRows.Current()
     	fmt.Printf("%s %s: %s\n", costRow.Actor.UserID, costRow.StartingAt, costRow.Amount)
     }
     if err := costRows.Err(); err != nil {
     	log.Fatal(err)
     }
     ```

     ```java Java
     import com.anthropic.models.beta.organization.analytics.usercostreport.UserCostReportListParams;
     import java.time.OffsetDateTime;

     void main() {
         AnthropicClient client = AnthropicOkHttpClient.fromEnv();

         var params = UserCostReportListParams.builder()
             .startingAt(OffsetDateTime.parse("2026-06-09T00:00:00Z"))
             .endingAt(OffsetDateTime.parse("2026-06-23T00:00:00Z"))
             .bucketWidth(UserCostReportListParams.BucketWidth.DAY)
             .limit(1000)
             .build();
         var costRows = client.beta().organization().analytics().userCostReport().list(params);

         for (var costRow : costRows.autoPager()) {
             IO.println(costRow.actor().userId() + " " + costRow.startingAt().orElseThrow() + ": " + costRow.amount());
         }
     }
     ```

     ```php PHP
     $client = new Client();

     $costRows = $client->beta->organization->analytics->userCostReport->list(
         startingAt: new \DateTimeImmutable('2026-06-09T00:00:00Z'),
         endingAt: new \DateTimeImmutable('2026-06-23T00:00:00Z'),
         bucketWidth: '1d',
         limit: 1000,
     );

     foreach ($costRows->pagingEachItem() as $costRow) {
         $startingAt = $costRow->startingAt?->format(\DateTimeInterface::ATOM);
         echo "{$costRow->actor->userID} {$startingAt}: {$costRow->amount}\n";
     }
     ```

     ```ruby Ruby
     client = Anthropic::Client.new

     page = client.beta.organization.analytics.user_cost_report.list(
       starting_at: Time.utc(2026, 6, 9),
       ending_at: Time.utc(2026, 6, 23),
       bucket_width: :"1d",
       limit: 1000
     )

     page.auto_paging_each do |cost_row|
       puts "#{cost_row.actor.user_id} #{cost_row.starting_at}: #{cost_row.amount}"
     end
     ```
   </CodeGroup>

   Wenn `bucket_width` gesetzt ist, umfasst jedes Mitglied eine Zeile pro Tag mit Nutzung. Blättere durch `next_page`, um die vollständige Reihe jedes Mitglieds zu erfassen.

2. Gruppiere die Zeilen nach `actor.user_id`. Summiere für jedes Mitglied die letzten sieben Tage und die sieben Tage davor. Markiere Mitglieder, deren letzte Woche die Vorwoche um das von dir gewählte Vielfache übersteigt (zum Beispiel drei). Die Kosten der letzten Tage sind vorläufig und können nach oben korrigiert werden; setze für wiederholbare Vergleiche `ending_at` auf oder vor einen zuvor zurückgegebenen `data_refreshed_at` (siehe [Datenverfügbarkeit und Aktualität](https://platform.claude.com/docs/de/manage-claude/analytics-api#data-availability-and-freshness)).

3. Handle bei markierten Mitgliedern: Passe die Obergrenze mit `POST /v1/organizations/spend_limits` an oder nimm Kontakt auf.

### Das Ausgabenlimit eines Mitglieds während eines Incidents vorübergehend erhöhen

Gib einem Incident-Responder Spielraum zum Arbeiten, solange ein Incident offen ist: Erhöhe seine Ausgabenobergrenze, wenn der Incident beginnt, und setze sie zurück, nachdem der Incident geschlossen wurde. Knüpfe die Erhöhung an dein Incident-Management-System, zum Beispiel indem du eine aktive Incident-ID verlangst, der das Mitglied zugewiesen ist.

1. Lies die aktuelle Obergrenze des Mitglieds und notiere sie für das Zurücksetzen:

   <CodeGroup>
     ```bash cURL
     curl -g "https://api.anthropic.com/v1/organizations/spend_limits/effective?user_ids[]=user_01AbCdEfGh&period[]=monthly" \
       -H "x-api-key: $ANTHROPIC_API_KEY" \
       -H "anthropic-version: 2023-06-01"
     ```

     ```bash CLI
     ant beta:organization:spend-limits:effective list \
       --user-id user_01AbCdEfGh \
       --period monthly
     ```

     ```python Python
     client = anthropic.Anthropic()

     effective_limits = client.beta.organization.spend_limits.effective.list(
         user_ids=["user_01AbCdEfGh"], period=["monthly"]
     )

     for effective_limit in effective_limits:
         scope = effective_limit.scope
         if scope.type == "user":
             amount = effective_limit.amount or "unlimited"
             print(f"{scope.user_id}: {effective_limit.period_to_date_spend} of {amount}")
     ```

     ```typescript TypeScript
     const client = new Anthropic();

     const effectiveLimits = await client.beta.organization.spendLimits.effective.list({
       user_ids: ["user_01AbCdEfGh"],
       period: ["monthly"]
     });

     for await (const effectiveLimit of effectiveLimits) {
       const { scope } = effectiveLimit;
       if (scope.type === "user") {
         const amount = effectiveLimit.amount ?? "unlimited";
         console.log(`${scope.user_id}: ${effectiveLimit.period_to_date_spend} of ${amount}`);
       }
     }
     ```

     ```csharp C#
     using Anthropic.Models.Beta.Organization.SpendLimits.Effective;

     AnthropicClient client = new();

     var page = await client.Beta.Organization.SpendLimits.Effective.List(
         new() { UserIds = ["user_01AbCdEfGh"], Period = [Period.Monthly] }
     );

     await foreach (var effectiveLimit in page.Paginate())
     {
         if (effectiveLimit.Scope.TryPickBetaSpendLimitUser(out var userScope))
         {
             var amount = effectiveLimit.Amount ?? "unlimited";
             Console.WriteLine($"{userScope.UserID}: {effectiveLimit.PeriodToDateSpend} of {amount}");
         }
     }
     ```

     ```go Go
     client := anthropic.NewClient()

     effectiveLimits := client.Beta.Organization.SpendLimits.Effective.ListAutoPaging(context.Background(), anthropic.BetaOrganizationSpendLimitEffectiveListParams{
     	UserIDs: []string{"user_01AbCdEfGh"},
     	Period:  []string{"monthly"},
     })

     for effectiveLimits.Next() {
     	effectiveLimit := effectiveLimits.Current()
     	if userScope, ok := effectiveLimit.Scope.AsAny().(anthropic.BetaSpendLimitUserScope); ok {
     		amount := effectiveLimit.Amount
     		if !effectiveLimit.JSON.Amount.Valid() {
     			amount = "unlimited"
     		}
     		fmt.Printf("%s: %s of %s\n", userScope.UserID, effectiveLimit.PeriodToDateSpend, amount)
     	}
     }
     if err := effectiveLimits.Err(); err != nil {
     	log.Fatal(err)
     }
     ```

     ```java Java
     import com.anthropic.models.beta.organization.spendlimits.effective.EffectiveListParams;

     void main() {
         AnthropicClient client = AnthropicOkHttpClient.fromEnv();

         var params = EffectiveListParams.builder()
             .addUserId("user_01AbCdEfGh")
             .addPeriod(EffectiveListParams.Period.MONTHLY)
             .build();
         var effectiveLimits = client.beta().organization().spendLimits().effective().list(params);

         for (var effectiveLimit : effectiveLimits.autoPager()) {
             var amount = effectiveLimit.amount().orElse("unlimited");
             effectiveLimit.scope().user().ifPresent(userScope ->
                 IO.println(userScope.userId() + ": " + effectiveLimit.periodToDateSpend() + " of " + amount)
             );
         }
     }
     ```

     ```php PHP
     use Anthropic\Beta\Organization\SpendLimits\SpendLimitUserScope;
     // ...

     $client = new Client();

     $effectiveLimits = $client->beta->organization->spendLimits->effective->list(
         userIDs: ['user_01AbCdEfGh'],
         period: ['monthly'],
     );

     foreach ($effectiveLimits->pagingEachItem() as $effectiveLimit) {
         $scope = $effectiveLimit->scope;
         if ($scope instanceof SpendLimitUserScope) {
             $amount = $effectiveLimit->amount ?? 'unlimited';
             echo "{$scope->userID}: {$effectiveLimit->periodToDateSpend} of {$amount}\n";
         }
     }
     ```

     ```ruby Ruby
     client = Anthropic::Client.new

     page = client.beta.organization.spend_limits.effective.list(
       user_ids: ["user_01AbCdEfGh"],
       period: [:monthly]
     )

     page.auto_paging_each do |effective_limit|
       scope = effective_limit.scope
       if scope.is_a?(Anthropic::Models::Beta::Organization::BetaSpendLimitUserScope)
         amount = effective_limit.amount || "unlimited"
         puts "#{scope.user_id}: #{effective_limit.period_to_date_spend} of #{amount}"
       end
     end
     ```
   </CodeGroup>

2. Erhöhe die Obergrenze:

   <CodeGroup>
     ```bash cURL
     curl -X POST "https://api.anthropic.com/v1/organizations/spend_limits" \
       -H "content-type: application/json" \
       -H "x-api-key: $ANTHROPIC_API_KEY" \
       -H "anthropic-version: 2023-06-01" \
       -d '{"scope": {"type": "user", "user_id": "user_01AbCdEfGh"}, "amount": "500000", "period": "monthly"}'
     ```

     ```bash CLI
     ant beta:organization:spend-limits set \
       --scope '{type: user, user_id: user_01AbCdEfGh}' \
       --amount 500000 \
       --period monthly
     ```

     ```python Python
     client = anthropic.Anthropic()

     spend_limit = client.beta.organization.spend_limits.set(
         scope={"type": "user", "user_id": "user_01AbCdEfGh"},
         amount="500000",
         period="monthly",
     )

     print(f"id: {spend_limit.id}")
     print(f"amount: {spend_limit.amount}")
     ```

     ```typescript TypeScript
     const client = new Anthropic();

     const spendLimit = await client.beta.organization.spendLimits.set({
       scope: { type: "user", user_id: "user_01AbCdEfGh" },
       amount: "500000",
       period: "monthly"
     });

     console.log(`id: ${spendLimit.id}`);
     console.log(`amount: ${spendLimit.amount}`);
     ```

     ```csharp C#
     using Anthropic.Models.Beta.Organization.SpendLimits;

     AnthropicClient client = new();

     var spendLimit = await client.Beta.Organization.SpendLimits.Set(
         new()
         {
             Scope = new BetaSpendLimitUserScope("user_01AbCdEfGh"),
             Amount = "500000",
             Period = BetaSpendLimitPeriod.Monthly,
         }
     );

     Console.WriteLine($"id: {spendLimit.ID}");
     Console.WriteLine($"amount: {spendLimit.Amount}");
     ```

     ```go Go
     client := anthropic.NewClient()

     spendLimit, err := client.Beta.Organization.SpendLimits.Set(context.Background(), anthropic.BetaOrganizationSpendLimitSetParams{
     	Scope: anthropic.BetaOrganizationSpendLimitSetParamsScopeUnion{
     		OfUser: &anthropic.BetaSpendLimitUserScopeParam{UserID: "user_01AbCdEfGh"},
     	},
     	Amount: anthropic.String("500000"),
     	Period: anthropic.BetaSpendLimitPeriodMonthly,
     })
     if err != nil {
     	log.Fatal(err)
     }

     fmt.Printf("id: %s\n", spendLimit.ID)
     fmt.Printf("amount: %s\n", spendLimit.Amount)
     ```

     ```java Java
     import com.anthropic.models.beta.organization.spendlimits.BetaSpendLimitPeriod;
     import com.anthropic.models.beta.organization.spendlimits.SpendLimitSetParams;

     void main() {
         AnthropicClient client = AnthropicOkHttpClient.fromEnv();

         var params = SpendLimitSetParams.builder()
             .userScope("user_01AbCdEfGh")
             .amount("500000")
             .period(BetaSpendLimitPeriod.MONTHLY)
             .build();
         var spendLimit = client.beta().organization().spendLimits().set(params);

         IO.println("id: " + spendLimit.id());
         IO.println("amount: " + spendLimit.amount().orElseThrow());
     }
     ```

     ```php PHP
     use Anthropic\Beta\Organization\SpendLimits\SpendLimitUserScope;
     // ...

     $client = new Client();

     $spendLimit = $client->beta->organization->spendLimits->set(
         scope: SpendLimitUserScope::with(userID: 'user_01AbCdEfGh'),
         amount: '500000',
         period: 'monthly',
     );

     echo "id: {$spendLimit->id}\n";
     echo "amount: {$spendLimit->amount}\n";
     ```

     ```ruby Ruby
     client = Anthropic::Client.new

     spend_limit = client.beta.organization.spend_limits.set(
       scope: { type: :user, user_id: "user_01AbCdEfGh" },
       amount: "500000",
       period: :monthly
     )

     puts "id: #{spend_limit.id}"
     puts "amount: #{spend_limit.amount}"
     ```
   </CodeGroup>

3. Wenn Responder während eines Incidents breiteren Zugriff benötigen, stelle vorab eine Incident-Responder-Gruppe bereit, deren [benutzerdefinierte Rolle](https://platform.claude.com/docs/de/manage-claude/user-management#custom-roles) diesen gewährt, und füge das Mitglied für die Dauer hinzu:

   <CodeGroup>
     ```bash cURL
     curl -X POST "https://api.anthropic.com/v1/organizations/rbac_groups/rbac_group_01UvWxYzAbCdEfGhIjKlMn/members" \
       -H "content-type: application/json" \
       -H "x-api-key: $ANTHROPIC_API_KEY" \
       -H "anthropic-version: 2023-06-01" \
       -d '{"user_id": "user_01AbCdEfGh"}'
     ```

     ```bash CLI
     ant beta:organization:rbac-groups:members add \
       --rbac-group-id rbac_group_01UvWxYzAbCdEfGhIjKlMn \
       --user-id user_01AbCdEfGh
     ```

     ```python Python
     client = anthropic.Anthropic()

     member = client.beta.organization.rbac_groups.members.add(
         "rbac_group_01UvWxYzAbCdEfGhIjKlMn", user_id="user_01AbCdEfGh"
     )

     print(f"user_id: {member.user_id}")
     print(f"rbac_group_id: {member.rbac_group_id}")
     ```

     ```typescript TypeScript
     const client = new Anthropic();

     const member = await client.beta.organization.rbacGroups.members.add(
       "rbac_group_01UvWxYzAbCdEfGhIjKlMn",
       {
         user_id: "user_01AbCdEfGh"
       }
     );

     console.log(`user_id: ${member.user_id}`);
     console.log(`rbac_group_id: ${member.rbac_group_id}`);
     ```

     ```csharp C#
     AnthropicClient client = new();

     var member = await client.Beta.Organization.RbacGroups.Members.Add(
         "rbac_group_01UvWxYzAbCdEfGhIjKlMn",
         new() { UserID = "user_01AbCdEfGh" }
     );

     Console.WriteLine($"user_id: {member.UserID}");
     Console.WriteLine($"rbac_group_id: {member.RbacGroupID}");
     ```

     ```go Go
     client := anthropic.NewClient()

     member, err := client.Beta.Organization.RBACGroups.Members.Add(
     	context.Background(),
     	"rbac_group_01UvWxYzAbCdEfGhIjKlMn",
     	anthropic.BetaOrganizationRBACGroupMemberAddParams{
     		UserID: "user_01AbCdEfGh",
     	},
     )
     if err != nil {
     	log.Fatal(err)
     }

     fmt.Printf("user_id: %s\n", member.UserID)
     fmt.Printf("rbac_group_id: %s\n", member.RBACGroupID)
     ```

     ```java Java
     import com.anthropic.models.beta.organization.rbacgroups.members.MemberAddParams;

     void main() {
         AnthropicClient client = AnthropicOkHttpClient.fromEnv();

         var params = MemberAddParams.builder()
             .userId("user_01AbCdEfGh")
             .build();
         var member = client.beta().organization().rbacGroups().members()
             .add("rbac_group_01UvWxYzAbCdEfGhIjKlMn", params);

         IO.println("user_id: " + member.userId());
         IO.println("rbac_group_id: " + member.rbacGroupId());
     }
     ```

     ```php PHP
     $client = new Client();

     $member = $client->beta->organization->rbacGroups->members->add(
         'rbac_group_01UvWxYzAbCdEfGhIjKlMn',
         userID: 'user_01AbCdEfGh',
     );

     echo "user_id: {$member->userID}\n";
     echo "rbac_group_id: {$member->rbacGroupID}\n";
     ```

     ```ruby Ruby
     client = Anthropic::Client.new

     member = client.beta.organization.rbac_groups.members.add(
       "rbac_group_01UvWxYzAbCdEfGhIjKlMn",
       user_id: "user_01AbCdEfGh"
     )

     puts "user_id: #{member.user_id}"
     puts "rbac_group_id: #{member.rbac_group_id}"
     ```
   </CodeGroup>

   Siehe [Benutzerverwaltung](https://platform.claude.com/docs/de/manage-claude/user-management#groups) für die Gruppen-Endpunkte.

4. Wenn dein Incident-System den Incident als geschlossen markiert, setze beide Änderungen zurück: Stelle das in Schritt 1 notierte Ausgabenlimit wieder her (oder lösche die Überschreibung mit `DELETE /v1/organizations/spend_limits/{spend_limit_id}`, falls das Mitglied keine hatte), und entferne das Mitglied mit `DELETE /v1/organizations/rbac_groups/{rbac_group_id}/members/{user_id}` aus der Gruppe.

## Häufig gestellte Fragen

### Schließt das direkte Setzen eines Ausgabenlimits die ausstehende Erhöhungsanfrage eines Mitglieds ab?

Nein. `POST /v1/organizations/spend_limits` schreibt die Überschreibung, lässt die ausstehende Anfrage aber unberührt. Verwende `POST /v1/organizations/spend_limit_increase_requests/{id}/approve`, um die Anfrage abzuschließen und die Überschreibung in einem einzigen Aufruf zu schreiben.

### Was passiert, wenn ich eine nutzerbezogene Überschreibung lösche?

Das Mitglied fällt auf das zurück, was es aus der Hierarchie erben würde: den Standardwert seiner Gruppe, Seat-Stufe oder Organisation. Wenn auf keiner Ebene ein Standardwert existiert, ist das Mitglied unbegrenzt.

### Kann ich über diese API einen Standardwert für eine Seat-Stufe oder die gesamte Organisation setzen?

Nein. Über diese API können nur nutzerbezogene Überschreibungen geschrieben werden. Standardwerte auf Seat-Stufen-, Gruppen- und Organisationsebene werden in den Organisationseinstellungen von claude.ai konfiguriert.

### Warum erscheint `period_to_date_spend` bei einem aktiven Mitglied manchmal als `"0"`?

Der Ausgabenwert kann vorübergehend nicht verfügbar sein; in diesem Fall zeigt das Feld `"0"` an, anstatt einen Fehler auszugeben. Behandle ihn als informativ.

## Siehe auch

<CardGroup cols={2}>
  <Card title="Spend Limits API-Referenz" href="https://platform.claude.com/docs/de/api/beta/organization/spend_limits">
    Generierte Anfrage- und Antwortschemata für jeden Endpunkt der Spend Limits API.
  </Card>

  <Card title="Spend Limit Increase Requests API-Referenz" href="https://platform.claude.com/docs/de/api/beta/organization/spend_limits/increase_requests">
    Generierte Anfrage- und Antwortschemata für die Endpunkte für Erhöhungsanfragen.
  </Card>

  <Card title="Analytics APIs" href="https://platform.claude.com/docs/de/manage-claude/analytics-api">
    Nutzerbezogene und zeitlich gruppierte Berichte zu Nutzung und Kosten für Claude Enterprise.
  </Card>
</CardGroup>
