> ## Documentation Index
> Fetch the complete documentation index at: https://docs.devin.ai/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>

常见错误场景：

* 服务密钥无效或权限不足
* 提供了多个作用域参数
* 未提供作用域参数
* 组 ID 或用户邮箱无效
* 超出速率限制
