> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devin.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 使用量設定を指定

> ユーザーごとの追加クレジット上限を設定または解除し、Enterprise の請求管理のためにチーム、グループ、または個別のユーザーに適用できます。

<div id="overview">
  ## 概要
</div>

組織向けのアドオン クレジットについて、ユーザーごとの使用量上限を設定または解除します。上限は常にユーザー単位で適用されます。チームまたはグループをスコープとして指定した場合、上限はそのチームまたはグループ内の各ユーザーに個別に適用され、チームまたはグループ全体で共有される上限は設定されません。

<div id="request">
  ## リクエスト
</div>

<ParamField body="service_key" type="string" required>
  「Billing Write」権限を持つサービスキー
</ParamField>

<div id="credit-cap-configuration-choose-one">
  ### クレジット上限の設定 (いずれか 1 つを選択)
</div>

<ParamField body="clear_add_on_credit_cap" type="boolean">
  既存の追加クレジット上限をクリアするには、`true` を設定します
</ParamField>

<ParamField body="set_add_on_credit_cap" type="integer">
  新しい追加クレジット上限を設定します (整数値)
</ParamField>

<Info>
  `clear_add_on_credit_cap` または `set_add_on_credit_cap` のいずれか一方を指定する必要があります。両方を指定することはできません。
</Info>

<div id="scope-configuration-choose-one">
  ### スコープの設定 (いずれか 1 つを選択)
</div>

<ParamField body="team_level" type="boolean">
  チーム内のすべてのユーザーにユーザーごとの上限を適用するには、`true` に設定します
</ParamField>

<ParamField body="group_id" type="string">
  グループ ID を指定すると、特定のグループ内のすべてのユーザーにユーザーごとの上限が適用されます
</ParamField>

<ParamField body="user_email" type="string">
  メールアドレスを指定すると、特定のユーザーにこの設定が適用されます
</ParamField>

<Info>
  スコープを定義するには、`team_level`、`group_id`、`user_email` のいずれか 1 つを指定する必要があります。
</Info>

<div id="example-request-set-per-user-credit-cap-for-all-users-on-team">
  ### リクエスト例 - チーム 内のすべてのユーザーにユーザーごとのクレジット上限を設定する
</div>

```bash theme={null}
curl -X POST --header "Content-Type: application/json" \
--data '{
  "service_key": "your_service_key_here",
  "set_add_on_credit_cap": 10000,
  "team_level": true
}' \
https://server.codeium.com/api/v1/UsageConfig
```

<div id="example-request-set-per-user-credit-cap-for-all-users-in-a-group">
  ### リクエスト例 - グループ内の全ユーザーに対してユーザーごとのクレジット上限を設定する
</div>

```bash theme={null}
curl -X POST --header "Content-Type: application/json" \
--data '{
  "service_key": "your_service_key_here",
  "set_add_on_credit_cap": 5000,
  "group_id": "engineering_team"
}' \
https://server.codeium.com/api/v1/UsageConfig
```

<div id="example-request-set-credit-cap-for-user">
  ### リクエスト例 - ユーザーのクレジット上限を設定
</div>

```bash theme={null}
curl -X POST --header "Content-Type: application/json" \
--data '{
  "service_key": "your_service_key_here",
  "set_add_on_credit_cap": 1000,
  "user_email": "user@example.com"
}' \
https://server.codeium.com/api/v1/UsageConfig
```

<div id="example-request-clear-credit-cap">
  ### リクエスト例 - クレジット上限を解除
</div>

```bash theme={null}
curl -X POST --header "Content-Type: application/json" \
--data '{
  "service_key": "your_service_key_here",
  "clear_add_on_credit_cap": true,
  "team_level": true
}' \
https://server.codeium.com/api/v1/UsageConfig
```

<div id="response">
  ## レスポンス
</div>

レスポンスボディは空です。`200` ステータスコードは、操作が正常に完了したことを示します。

<div id="error-responses">
  ## エラーレスポンス
</div>

一般的なエラーの例:

* サービスキーが無効、または権限が不足している
* `clear_add_on_credit_cap` と `set_add_on_credit_cap` の両方が指定されている
* `clear_add_on_credit_cap` と `set_add_on_credit_cap` のどちらも指定されていない
* 複数の `スコープ` パラメータが指定されている
* `スコープ` パラメータが指定されていない
* グループ ID またはユーザーのメールアドレスが無効
* レート制限を超過している
