> ## Documentation Index
> Fetch the complete documentation index at: https://docs.windsurf.com/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">
  ### クレジット上限の設定（いずれか一つを選択）
</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">
  ### スコープの設定（いずれかを選択）
</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` のいずれかを必ず指定してください。
</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` も指定されていない
* scope パラメータが複数指定されている
* scope パラメータが指定されていない
* 無効なグループ ID またはユーザーのメールアドレス
* レート制限を超過
