> ## Documentation Index
> Fetch the complete documentation index at: https://docs.trae.cn/llms.txt
> Use this file to discover all available pages before exploring further.

查询指定成员当前的用量限额，包括 TRAE 内置模型和企业内置模型的成员个人限额配置。

## 所需权限 {#hc0zThr48}

`quota:read`

## 请求说明 {#hAhXNYHkE}

* 请求方式：POST
* 请求地址：{域名}/openapi/v1/quota/query_user_usage_quota

## 请求体 {#hNlTmDAlk}

### 参数说明 {#hSoFJ9SeH}

<!-- @cols-width: 116,112,121,567 -->
| | | | | \
|**参数** |**类型** |**是否必填** |**描述** |
|---|---|---|---|
|`emails` |string[] |条件必填 |待查询用量限额的成员的邮箱。与 `user_ids` 至少传入一个。邮箱不区分大小写。 |
|`user_ids` |string[] |条件必填 |待查询用量限额的成员的用户 ID。与 `emails` 至少传入一个。 |\
| | | | |\
| | | |你需要调用 “获取成员列表” 接口来获取成员的用户 ID，详情参考[获取成员列表](/enterprise_get-user-list)。 |

:::tip 提示
单次请求支持同时传入 `emails` 和 `user_ids`。系统会根据邮箱或用户 ID 解析成员，并对重复成员自动去重。去重后，单次请求最多支持传入 50 个成员。
:::

## 响应参数 {#hyEJsNtkL}

该 OpenAPI 特有的响应参数如下：

<!-- @cols-width: 225,110,580 -->
| | | | \
|**参数** |**类型** |**描述** |
|---|---|---|
|`trae_model_quota_type` |string |企业当前对 TRAE 内置模型采用的用量计算模式。取值： |\
| | | |\
| | |* `token` ：按 Token 计，仅旧企业版套餐使用。 |\
| | |* `price`：按金额计（单位：元），仅新企业版套餐使用。 |
|`pooling_enabled` |bool |企业当前是否已启用 “共享额度池（池化）” 功能。该功能仅对新旗舰版套餐和 TRAE 内置模型生效。详情参考[共享额度池](/enterprise_pooled-usage)。 |
|`quota_granularity` |string |企业当前的额度配置粒度。取值： |\
| | | |\
| | |* `all`：为全部模型设置一个总额度。 |\
| | |* `per_model`：为每个模型单独设置额度。 |
|`users` |array |已查询到的成员用量限额信息。具体字段说明参考[设置成员的用量限额](/enterprise_set-usage-limits-for-members)。 |
|`not_found_users` |string[] |未查询到或不属于当前企业的成员标识。 |

## 请求示例 {#ho0MLpU8l}

```JSON
{
  "emails": ["john@example.com"],
  "user_ids": ["12345"]
}
```

## 响应示例 {#hYeIfhQwC}

```JSON
{
  "code": 0,
  "message": "success",
  "request_id": "req_abc123xyz",
  "data": {
    "trae_model_quota_type": "price",
    "pooling_enabled": true,
    "quota_granularity": "all",
    "users": [
      {
        "email": "john@example.com",
        "user_id": "12345",
        "basic_quota": 20,
        "total_excess_quota": 5000,
        "trae_model_excess_quota": [],
        "custom_model_excess_quota": [
          {
            "name": "Enterprise-GPT",
            "token_quota": 10000000
          }
        ]
      }
    ],
    "not_found_users": ["unknown@example.com"]
  }
}
```

## 错误码 {#hp2HG0jSo}

关于该 OpenAPI 可能返回的错误码，参考[错误码](/enterprise_error-codes)。
