> ## 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="既存のアドオンのクレジット上限を消去するには `true` を設定します" type="boolean">
  既存のアドオンのクレジット上限を消去するには `true` を設定します
</ParamField>

<ParamField body="新しいアドオンのクレジット上限を設定します（整数値）" 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 またはユーザーのメールアドレス
* レート制限を超過
