> ## 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 Read" 権限を持つサービスキー
</ParamField>

<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-get-per-user-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",
  "team_level": true
}' \
https://server.codeium.com/api/v1/GetUsageConfig
```

<div id="example-request-get-per-user-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",
  "group_id": "engineering_team"
}' \
https://server.codeium.com/api/v1/GetUsageConfig
```

<div id="example-request-get-user-configuration">
  ### リクエスト例 - ユーザー設定の取得
</div>

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

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

<ResponseField name="addOnCreditCap" type="integer">
  設定されているアドオンのクレジットの上限値。このフィールドがレスポンスに含まれていない場合、指定されたスコープレベルには上限が設定されていません。
</ResponseField>

<div id="example-response-with-cap-configured">
  ### レスポンス例 - Cap を設定した場合
</div>

```json theme={null}
{
  "addOnCreditCap": 10000
}
```

<div id="example-response-no-cap-configured">
  ### レスポンス例 - 上限が設定されていない場合
</div>

```json theme={null}
{}
```

<div id="error-responses">
  ## エラー応答
</div>

一般的なエラー発生パターン:

* 無効なサービスキー、または権限不足
* scope パラメータが複数指定されている
* scope パラメータが指定されていない
* 無効なグループ ID またはユーザーのメールアドレス
* レート制限を超過している
