---
title: Spend Limits API
url: https://platform.claude.com/docs/ja/manage-claude/spend-limits-api
description: Claude Enterprise の各メンバーに支出上限を設定し、各メンバーの支出上限がどこから継承されているかを確認し、上限引き上げを求めるメンバーのリクエストを確認または処理します。
---

Spend Limits API を使用すると、Claude Enterprise の各メンバーに「spend limit」（支出上限）を設定し、各メンバーの支出上限がどこから継承されているかを確認し、上限引き上げを求めるメンバーのリクエストを確認または処理できます。

ユーザーごと、および時間バケットごとの使用量とコストの*レポート*については、[Analytics APIs](https://platform.claude.com/docs/ja/manage-claude/analytics-api) を参照してください。

<Check>
  **スコープ付き Admin APIキーが必要です**

  これらのエンドポイントには、`read:spend_limits`スコープ（`GET`エンドポイントの場合）または`write:spend_limits`スコープ（`POST`および`DELETE`エンドポイントの場合）を持つAdmin APIキーが必要です。プライマリオーナーがキーを作成する場所と選択すべきスコープについては、[Admin APIキーの作成](https://platform.claude.com/docs/ja/manage-claude/admin-api-keys#create-a-key-for-a-claude-enterprise-organization)を参照してください。すべてのリクエストで、[`anthropic-version`](https://platform.claude.com/docs/ja/api/versioning)ヘッダーとともに`x-api-key`ヘッダーでキーを渡してください。
</Check>

<Note>
  Spend Limits API は Claude Enterprise 組織でのみ利用できます。Claude Platform（Claude Console）組織では利用できません。
</Note>

## 概要

この API は、2 つのリソースにわたる 8 つのエンドポイントを公開しています。

| リソース              | エンドポイント                                                                                                                                                                                                                                                              | 用途                                                                  |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------- |
| **支出上限**          | `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}`                                                   | 各メンバーの有効な支出上限と期間累計支出を読み取ります。ユーザーごとのオーバーライドを設定または解除します。              |
| **支出上限引き上げリクエスト** | `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` | 判断に必要なコンテキストとともに、支出上限の引き上げを求めるメンバーのリクエストを一覧表示します。各リクエストを承認または拒否します。 |

**支出上限**エンドポイントは、「各メンバーにどの支出上限が適用されているか、それはどこから来ているか、そしてどれくらい上限に近づいているか」という問いに答えるため、およびユーザーごとのオーバーライドを設定するために使用します。**支出上限引き上げリクエスト**エンドポイントは、メンバーが送信したリクエストのキューを処理するために使用します。

## 前提条件

* 組織が Claude Enterprise プランに加入している必要があります。
* 組織で使用量クレジットが有効になっている必要があります。プライマリオーナーは claude.ai の請求設定で有効にできます。

SDK はこれらのエンドポイントを `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`) の下で公開し、`ant` CLI は `ant beta:organization:spend-limits` の下で公開しています。どちらも `anthropic-version` ヘッダーを自動的に送信します。例では、`ANTHROPIC_API_KEY` 環境変数から Admin APIキーを読み取ります。SDK と CLI は結果を順に処理する際に追加のページを自動的に取得するため、`limit` は合計数ではなくページサイズを設定します（[ページネーション](https://platform.claude.com/docs/ja/manage-claude/spend-limits-api#pagination)を参照）。

## クイックスタート

すべてのメンバーの有効な月次支出上限と期間累計支出を一覧表示します。

<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>

## 主要な概念

### 支出上限の階層

各メンバーの支出には、スコープレベルの階層から解決される「effective spend limit」（有効な支出上限）が適用されます。メンバーにユーザーごとのオーバーライドがない場合、そのメンバーはグループ（組織がグループベースの上限を使用している場合）、シートティア、または組織全体のデフォルトに設定された支出上限を継承します。グループの支出上限はメンバーごとのデフォルトです。これを継承する各メンバーは、プールされたグループ予算ではなく、自分自身の支出に対して制限されます。

`GET /v1/organizations/spend_limits/effective` を読み取ると、現在のすべてのメンバーについて、解決された有効な支出上限、その上限がどこから解決されたか（`source`）、および期間累計支出が返されます。`POST /v1/organizations/spend_limits` でユーザーごとのオーバーライドを設定すると、本来継承するはずの値に関係なく、メンバーを特定の支出上限に固定します。オーバーライドを削除すると、メンバーは継承された支出上限に戻ります（継承される上限が存在しない場合は無制限のままになります）。

各メンバーの行にある `source` フィールドは、支出上限がどのレベルから解決されたかを示します。`user`（ユーザーごとのオーバーライド）、`seat_tier`、`rbac_group`、または `organization` のいずれかです。スコープタイプはオープンセットとして扱い、未知の値に対しては失敗するのではなくフォールスルーしてください。

### 期間

`period` は、支出上限が適用され、支出がリセットされる繰り返しのウィンドウです。支出上限は `(scope, period)` のペアで識別されます。現在サポートされている期間は `monthly` のみです。月次支出は各暦月の 1 日 00:00 UTC にリセットされます。`period` はオープンセットとして扱ってください。

### 金額と通貨

すべての金額は、**組織の請求通貨の補助単位**（USD の場合はセント）で表された文字列です。たとえば、`"50000"` は 500.00 USD を表します。10 進数として解析し、100 で割ってドル表示にしてください。大きな値には 2 進浮動小数点を使用しないでください。

`amount` は **null 許容**です。メンバーの有効な行では、`null` は**無制限**（支出上限なし）を意味し、`"0"` はメンバーがプランに含まれる使用量を超えて Claude を使用できないことを意味します。設定済みの支出上限行（`GET /v1/organizations/spend_limits/{id}` が返すもの）では、`null` は数値の支出上限が設定されていないことのみを意味します。無制限と「含まれる使用量のみ」を区別するには、メンバーの有効な行を読み取ってください。

`period_to_date_spend` は、現在の `period` の開始以降に発生したメンバーの支出で、同じ補助単位形式です。小数部分を含む場合があります（例：`"41280.125"`）。支出の読み取りが一時的に利用できない場合は `"0"` と表示されることがあります。トランザクション用ではなく参考情報として扱ってください。

### 引き上げリクエストのライフサイクル

「spend limit increase request」（支出上限引き上げリクエスト）は、メンバーが claude.ai で **Request more usage** をクリックしたときに作成されます。リクエストはこの API を通じては作成されません。リクエストの `status` は次のいずれかです。

| ステータス      | 意味                                                                                                                                          |
| ---------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| `pending`  | 管理者のアクション待ちです。リクエストには通常、ライブの `spend_summary` が含まれており、判断中にメンバーの現在の有効な支出上限と期間累計支出を確認できます。計算できなかった場合、`spend_summary` は `null` になることがあります。      |
| `approved` | リクエストは承認により解決されました。管理者が明示的に承認したか、別の管理者アクションによってメンバーの支出上限が引き上げられたか、または Anthropic サポートが組織に代わって支出上限を引き上げたかのいずれかです。`spend_summary` は `null` です。 |
| `denied`   | 管理者が拒否しました。`spend_summary` は `null` です。メンバーはすぐに新しいリクエストを送信できます。新しいリクエストをブロックするのは `pending` のリクエストのみです。管理者はいつでもメンバーの支出上限を直接引き上げることができます。     |

`approved` と `denied` はどちらも終端状態です。メンバーが同時に持てる `pending` リクエストは最大 1 件です。

`POST /v1/organizations/spend_limit_increase_requests/{id}/approve` で承認すると、`POST /v1/organizations/spend_limits` が書き込むのと同じユーザーごとの支出上限行が書き込まれます。支出上限を直接設定しても、保留中のリクエストは遷移**しません**。リクエストを解決するには approve エンドポイントを使用してください。

デフォルトでは、リクエストが承認または拒否されると、Anthropic がメンバーにメールを送信します。そのメールを抑制するには（たとえば、独自のシステムでメンバーに通知する場合）、approve または deny で `suppress_notification: true` を渡してください。

## バージョニング

すべてのリクエストで`anthropic-version`ヘッダーを送信してください。利用可能なバージョンについては、[APIバージョン](https://platform.claude.com/docs/ja/api/versioning)を参照してください。

## レート制限

8 つのエンドポイントすべてが、組織ごとに**1 分あたり 60 リクエスト**という単一の「rate limit」（レート制限）を共有します。上限を超えたリクエストは **429 Too Many Requests** を返します。

## ページネーション

`GET /v1/organizations/spend_limits/effective` と `GET /v1/organizations/spend_limit_increase_requests` は、**不透明なカーソル**でページネーションされます。最初のリクエストは最大 `limit` 行と `next_page` カーソルを返します。そのカーソルを変更せずに次のリクエストの `page` パラメータとして渡し、`next_page` が `null` になるまで繰り返してください。

**シーケンスの途中でクエリパラメータを変更しないでください。**&#x30AB;ーソルは、それを発行したフィルターに紐付けられています。`user_ids[]`、`period[]`、`status[]`、または `actor_ids[]` を変更して古いカーソルを渡すと、*"cursor does not match current query parameters"* という 400 エラーが返されます。代わりに最初のページから新しいシーケンスを開始してください。

## リストパラメータのシリアライズ

リストパラメータはブラケット記法を使用します。各値ごとに `[]` を付けてパラメータ名を繰り返してください。

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

## エラーレスポンス

エラーレスポンスは、[エラー](https://platform.claude.com/docs/ja/api/errors)に記載されている標準的な形式に従います。サポートに問い合わせる際は、レスポンス本文の `request_id` を引用してください。

## 支出上限

### 各メンバーの有効な支出上限を一覧表示する

`GET /v1/organizations/spend_limits/effective` は、現在のメンバーごとに 1 行を返し、各メンバーの有効な支出上限、スコープ階層におけるその `source`、および `period_to_date_spend` を反映します。`read:spend_limits` スコープが必要です。

パラメータの詳細とレスポンススキーマについては、API リファレンスの[有効な支出上限を一覧表示する](https://platform.claude.com/docs/ja/api/beta/organization/spend_limits/effective/list)を参照してください。

<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_..."
}
```

### 単一の支出上限を取得する

`GET /v1/organizations/spend_limits/{spend_limit_id}` は、設定済みの支出上限を ID で 1 件返します。`spend_limit_id` フィールドが参照していた行を調べるために使用します。`read:spend_limits` スコープが必要です。

パラメータの詳細とレスポンススキーマについては、API リファレンスの[支出上限を取得する](https://platform.claude.com/docs/ja/api/beta/organization/spend_limits/retrieve)を参照してください。

<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>

### ユーザーごとのオーバーライドを設定する

`POST /v1/organizations/spend_limits` は、ユーザーごとの支出上限オーバーライドを設定します。これは `(scope, period)` をキーとするアップサートです。すでに上限があるユーザーと期間に対して上限を設定すると、その場で上書きされます。このエンドポイントは `scope.type: "user"` のみを受け付けます。シートティア、グループ、および組織レベルのデフォルトは claude.ai の設定で構成します。`write:spend_limits` スコープが必要です。

パラメータの詳細とレスポンススキーマについては、API リファレンスの[支出上限を作成する](https://platform.claude.com/docs/ja/api/beta/organization/spend_limits/set)を参照してください。

<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"
}
```

### ユーザーごとのオーバーライドを削除する

`DELETE /v1/organizations/spend_limits/{spend_limit_id}` はユーザーごとのオーバーライドを削除します。その後、メンバーは継承されるシートティア、グループ、または組織のデフォルトにフォールバックします。シートティア、グループ、および組織レベルの行は、このエンドポイントでは削除できません。`write:spend_limits` スコープが必要です。

パラメータの詳細とレスポンススキーマについては、API リファレンスの[支出上限を削除する](https://platform.claude.com/docs/ja/api/beta/organization/spend_limits/delete)を参照してください。

<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>

## 支出上限引き上げリクエスト

### 引き上げリクエストを一覧表示する

`GET /v1/organizations/spend_limit_increase_requests` は、リクエストを新しい順に一覧表示します。`status[]`（`pending`、`approved`、`denied`）および `actor_ids[]` でフィルタリングできます。リクエスト者がすでに組織のメンバーでないリクエストは一覧から除外されます。`read:spend_limits` スコープが必要です。

パラメータの詳細とレスポンススキーマについては、API リファレンスの[支出上限引き上げリクエストを一覧表示する](https://platform.claude.com/docs/ja/api/beta/organization/spend_limits/increase_requests/list)を参照してください。

<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>

保留中の各リクエストには、リクエスト者の現在の有効な支出上限と期間累計支出を示すライブの `spend_summary` が含まれており、別途検索することなく判断するのに十分です。

### 単一の引き上げリクエストを取得する

`GET /v1/organizations/spend_limit_increase_requests/{id}` は、リクエストを ID で 1 件返します。`read:spend_limits` スコープが必要です。

パラメータの詳細とレスポンススキーマについては、API リファレンスの[支出上限引き上げリクエストを取得する](https://platform.claude.com/docs/ja/api/beta/organization/spend_limits/increase_requests/retrieve)を参照してください。

<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>

### 引き上げリクエストを承認する

`POST /v1/organizations/spend_limit_increase_requests/{id}/approve` は保留中のリクエストを承認します。管理者が指定した `amount` でリクエスト者にユーザーごとの支出上限を書き込み、リクエストを `approved` に遷移させます。リクエストには希望金額は含まれていません。承認時に新しい支出上限を指定します。`write:spend_limits` スコープが必要です。

パラメータの詳細とレスポンススキーマについては、API リファレンスの[支出上限引き上げリクエストを承認する](https://platform.claude.com/docs/ja/api/beta/organization/spend_limits/increase_requests/approve)を参照してください。

<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>

### 引き上げリクエストを拒否する

`POST /v1/organizations/spend_limit_increase_requests/{id}/deny` は保留中のリクエストを拒否します。`denied` に対してべき等です。すでに拒否済みのリクエストを拒否すると、既存のリソースとともに 200 が返されます。自動化がリトライと矛盾する決定を区別できるように、このエンドポイントはすでに承認済みのリクエストを拒否しようとする試みを却下します。`write:spend_limits` スコープが必要です。

パラメータの詳細とレスポンススキーマについては、API リファレンスの[支出上限引き上げリクエストを拒否する](https://platform.claude.com/docs/ja/api/beta/organization/spend_limits/increase_requests/deny)を参照してください。

<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>

## ワークフローの例

これらのワークフローの一部は、Spend Limits API と [Analytics APIs](https://platform.claude.com/docs/ja/manage-claude/analytics-api) のコストエンドポイントを組み合わせています。Analytics のコストエンドポイントは、日付範囲にわたる組織全体の支出レポート用に設計されています。`GET /spend_limits/effective` は、各メンバーに現在適用されている上限を返します。まず Analytics で全体を調べてどのメンバーに注目すべきかを見つけ、次に `/effective` でそのメンバーの現在の上限を読み取ってください。

Spend Limits エンドポイントには `spend_limits` スコープが必要で、Analytics のコストエンドポイントには `read:analytics` が必要です。アクセスのプロビジョニング方法については [Analytics APIs](https://platform.claude.com/docs/ja/manage-claude/analytics-api) を参照してください。例では、呼び出すすべての API のスコープを持つ 1 つの Admin APIキーを使用しています。プライマリオーナーは[キーの作成時にこれらのスコープを選択します](https://platform.claude.com/docs/ja/manage-claude/admin-api-keys#choose-scopes-for-a-claude-enterprise-key)。どちらの API でも、すべての金額は補助単位（セント）の 10 進数文字列です。どちらの API も不透明なカーソルでページネーションします。組織全体をカバーするには、明示的な `limit` を設定し、`next_page` が `null` になるまでページをたどってください。

### 引き上げリクエストのレビューフローを自動化する

保留中のリクエストを取得し、組織の承認ポリシーを適用し、各リクエストを解決するスケジュールジョブを実行します。

1. 保留中のリクエストを一覧表示します。

   <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>

   各リクエストには、リクエスト者の `actor.user_id` と、現在の有効な `amount` および `period_to_date_spend` を含むライブの `spend_summary` が含まれており、別途検索することなく判断するのに十分です。

2. ポリシーを適用します。たとえば、メンバーの現在の `amount` がしきい値を下回っている場合は自動承認し、より大きな上限は手動レビューに回します。

3. 各リクエストを解決します。承認するには、新しい上限を指定します。

   <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>

   拒否するには、代わりに同じ ID で[拒否エンドポイント](https://platform.claude.com/docs/ja/manage-claude/spend-limits-api#deny-an-increase-request)を呼び出します。独自のシステムでリクエスト者に通知する場合は、`suppress_notification: true` を渡してください。

### 支出上限に近づいているメンバーを特定する

上限に近づいているメンバーを見つけ、ブロックされる前に上限を引き上げられるようにします。

1. Analytics API から各メンバーの月初来の支出を取得します（メンバーごとに 1 行、デフォルトでは支出の多い順）。

   <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>

   各行には `actor.user_id`、`actor.email_address`、および `amount`（メンバーの支出、セント単位）が含まれます。組織全体をカバーするには `next_page` をたどってください。

2. 支出上位のメンバー（またはドルのしきい値を超える全員）について、有効な上限をバッチで取得します。

   <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>

   各行は、`period_to_date_spend` とともに上限を `amount` として返します（`null` = 無制限、`"0"` = 含まれる使用量のみ）。

3. 正の上限を持つ各メンバーについて、`period_to_date_spend / amount` を計算し、しきい値（たとえば 80 パーセント）以上のメンバーにフラグを立てます。`"0"` の上限はすでに上限到達として扱ってください。この比率に対するサーバー側のフィルターはありません。

4. フラグを立てたメンバーに対処します。`POST /v1/organizations/spend_limits` で上限を引き上げるか、保留中の引き上げリクエストがあれば承認するか、メンバーに連絡します。

### 使用量が急激に変化しているメンバーを見つける

支出が前週比で急増したメンバーを浮かび上がらせます。

1. Analytics API から、直近 2 週間のメンバーごとの日次コストを取得します。

   <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>

   `bucket_width` を設定すると、各メンバーは使用量のあった日ごとに 1 行にまたがります。すべてのメンバーの完全な系列を収集するには `next_page` をたどってください。

2. 行を `actor.user_id` でグループ化します。各メンバーについて、直近 7 日間とその前の 7 日間を合計します。直近の週が前の週を選択した倍数（たとえば 3 倍）以上上回るメンバーにフラグを立てます。直近の日のコストは暫定的であり、上方修正される可能性があります。再現可能な比較を行うには、`ending_at` を以前に返された `data_refreshed_at` 以前に設定してください（[データの可用性と鮮度](https://platform.claude.com/docs/ja/manage-claude/analytics-api#data-availability-and-freshness)を参照）。

3. フラグを立てたメンバーに対処します。`POST /v1/organizations/spend_limits` で上限を調整するか、連絡します。

### インシデント中にメンバーの支出上限を一時的に引き上げる

インシデントがオープンしている間、インシデント対応者に作業の余地を与えます。インシデント開始時に支出上限を引き上げ、インシデント終了後に元に戻します。引き上げはインシデント管理システムで制御してください。たとえば、そのメンバーが割り当てられているライブのインシデント ID を必須にします。

1. メンバーの現在の上限を読み取り、ロールバック用に記録します。

   <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. 上限を引き上げます。

   <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. インシデント中に対応者がより広範なアクセスを必要とする場合は、それを付与する[カスタムロール](https://platform.claude.com/docs/ja/manage-claude/user-management#custom-roles)を持つインシデント対応者グループを事前にプロビジョニングし、その期間中メンバーを追加します。

   <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>

   グループエンドポイントについては、[ユーザー管理](https://platform.claude.com/docs/ja/manage-claude/user-management#groups)を参照してください。

4. インシデントシステムがインシデントを終了としてマークしたら、両方の変更を元に戻します。ステップ 1 で記録した支出上限を復元し（メンバーにオーバーライドがなかった場合は `DELETE /v1/organizations/spend_limits/{spend_limit_id}` でオーバーライドを削除し）、`DELETE /v1/organizations/rbac_groups/{rbac_group_id}/members/{user_id}` でメンバーをグループから削除します。

## よくある質問

### 支出上限を直接設定すると、メンバーの保留中の引き上げリクエストは解決されますか？

いいえ。`POST /v1/organizations/spend_limits` はオーバーライドを書き込みますが、保留中のリクエストには手を付けません。リクエストの解決とオーバーライドの書き込みを 1 回の呼び出しで行うには、`POST /v1/organizations/spend_limit_increase_requests/{id}/approve` を使用してください。

### ユーザーごとのオーバーライドを削除するとどうなりますか？

メンバーは、階層から継承するもの（グループ、シートティア、または組織のデフォルト）にフォールバックします。どのレベルにもデフォルトが存在しない場合、メンバーは無制限になります。

### この API を通じてシートティアまたは組織全体のデフォルトを設定できますか？

いいえ。この API を通じて書き込めるのはユーザーごとのオーバーライドのみです。シートティア、グループ、および組織レベルのデフォルトは、claude.ai の組織設定で構成します。

### アクティブなメンバーの `period_to_date_spend` が `"0"` と表示されることがあるのはなぜですか？

支出の読み取りが一時的に利用できない場合があり、その場合このフィールドはエラーになるのではなく `"0"` と表示されます。参考情報として扱ってください。

## 関連項目

<CardGroup cols={2}>
  <Card title="Spend Limits API リファレンス" href="https://platform.claude.com/docs/ja/api/beta/organization/spend_limits">
    すべての Spend Limits API エンドポイントの生成されたリクエストおよびレスポンススキーマ。
  </Card>

  <Card title="Spend Limit Increase Requests API リファレンス" href="https://platform.claude.com/docs/ja/api/beta/organization/spend_limits/increase_requests">
    引き上げリクエストエンドポイントの生成されたリクエストおよびレスポンススキーマ。
  </Card>

  <Card title="Analytics APIs" href="https://platform.claude.com/docs/ja/manage-claude/analytics-api">
    Claude Enterprise 向けのユーザーごとおよび時間バケットごとの使用量とコストのレポート。
  </Card>
</CardGroup>
