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

# 获取用量配置

> 按用户检索附加额度用量上限配置，可按团队、组或单个用户范围查询，用于企业账单管理。

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

获取你所在组织当前的每用户附加用量额度上限配置。额度上限一律按用户设置。当你按团队或群组范围发起查询时，响应会返回已应用于该团队或群组内用户的每用户额度上限。

<div id="request">
  ## 请求
</div>

<ParamField body="service_key" type="string" required>
  具有 "Billing Read" 权限的服务密钥
</ParamField>

<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-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">
  ### 示例响应 - 已设置上限
</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 或用户邮箱无效
* 超出速率限制
