> ## 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">
  ### 作用域配置（任选其一）
</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 或用户邮箱地址无效
* 超过速率限制
