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

# 组织级 ACU 限额

> 限制组织每月 Local Agent 和 Devin 的 ACU 用量

组织级限额按产品类别限制归属于单个组织的 ACU 总用量：

| 限额                              | 覆盖的产品                                      |
| ------------------------------- | ------------------------------------------ |
| **Local Agent** (`local_agent`) | Devin Desktop、Windsurf JetBrains、Devin CLI |
| **Devin** (`cloud_agent`)       | Devin 云端会话 (web app、Slack 及其他界面)           |

Enterprise 中的每个组织都可以设置自己的限额，管理员可据此在团队或项目之间分配预算。你还可以通过 web app 管理组织级 Devin 限额；请参阅 [Enterprise 账单](/zh/admin/billing/enterprise#setting-organization-acu-limits)。

组织级限额与[用户级限额](/zh/admin/billing/user-acu-limits)相互独立——任一限额达到后，请求都会被阻止。有关本页所有端点共用的身份验证、权限和 `PATCH` 语义，请参阅 [ACU 限额](/zh/admin/billing/acu-limits)。

<div id="billing-organization-attribution">
  ## 计费组织归属
</div>

每位用户的 Local Agent 用量都会计入某个**计费组织**，该组织决定适用哪个组织的 Local Agent 限额。计费组织将按以下顺序解析：

1. \*\*显式分配：\*\*管理员通过 API 在用户的 ACU 设置中设置 `billing_org_id`。
2. \*\*自动解析：\*\*如果没有显式分配，则使用用户通过直接成员身份或 Identity Provider 组分配可访问的第一个组织。

用户的主要计费组织还决定哪些[本地 Agent 控制](/zh/enterprise/local/controls)适用于该用户。

显式计费组织分配通过[旧版用户端点](/zh/admin/billing/legacy-user-acu-limits#user-endpoints)管理——其中的 `billing_org_id` 字段并未弃用，只有 limit 字段已弃用：

```bash theme={null}
curl -X PATCH "https://api.devin.ai/v3beta1/enterprise/users/user_abc123/consumption/acu-limits" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"local_agent": {"billing_org_id": "org-xyz789"}}'
```

<div id="organization-endpoints">
  ## 组织端点
</div>

<div id="get-an-organizations-limits">
  ### 获取组织的限额
</div>

```http theme={null}
GET /v3beta1/enterprise/organizations/{org_id}/consumption/acu-limits
```

**响应正文**

```json theme={null}
{
  "local_agent": {
    "cycle_acu_limit": 2000
  },
  "cloud_agent": {
    "cycle_acu_limit": 1000
  }
}
```

如果未为该产品类别设置限额，则会省略 Agent 块。

<div id="update-an-organizations-limits">
  ### 更新组织限额
</div>

```http theme={null}
PATCH /v3beta1/enterprise/organizations/{org_id}/consumption/acu-limits
```

**请求正文 — 设置 Local Agent 和 Devin 的限额**

```json theme={null}
{
  "local_agent": {
    "cycle_acu_limit": 2000
  },
  "cloud_agent": {
    "cycle_acu_limit": 1000
  }
}
```

**请求正文 — 仅清除 Local Agent 限额**

将 `local_agent` 设为 `null`，不更改 Devin 限额：

```json theme={null}
{
  "local_agent": null
}
```

操作成功时，该端点将返回 HTTP `204`。

<div id="delete-an-organizations-limits">
  ### 删除组织的限额
</div>

这会清除该组织的 Local Agent 和 Devin 限额。

```http theme={null}
DELETE /v3beta1/enterprise/organizations/{org_id}/consumption/acu-limits
```

操作成功时，端点返回 HTTP `204`。

<div id="example-workflows">
  ## 工作流程示例
</div>

<div id="set-up-organization-level-local-agent-limits">
  ### 设置组织级 Local Agent 限额
</div>

为 Devin Desktop、Windsurf JetBrains 和 Devin CLI 的合计用量设置组织级预算：

```bash theme={null}
curl -X PATCH "https://api.devin.ai/v3beta1/enterprise/organizations/org-xyz789/consumption/acu-limits" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"local_agent": {"cycle_acu_limit": 5000}}'
```

<div id="set-up-organization-level-devin-limits">
  ### 设置组织级 Devin 限额
</div>

为组织设置 Devin 云端会话预算：

```bash theme={null}
curl -X PATCH "https://api.devin.ai/v3beta1/enterprise/organizations/org-xyz789/consumption/acu-limits" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{"cloud_agent": {"cycle_acu_limit": 1000}}'
```

<div id="frequently-asked-questions">
  ## 常见问题
</div>

<AccordionGroup>
  <Accordion title="什么是计费组织归属？">
    计费组织归属决定用户的 Devin Desktop、Windsurf JetBrains 和 Devin CLI 用量计入哪个组织的 Local Agent 限额。如果未明确指定，系统会自动解析为该用户有权访问的第一个组织。
  </Accordion>

  <Accordion title="组织达到限额后会发生什么？">
    在调整限额或下一个月度周期用量重置前，该组织的用户将被阻止在相应类别的产品中开展新工作：`local_agent` 限额适用于 Local Agent 产品，`cloud_agent` 限额适用于 Devin 云端会话。
  </Accordion>
</AccordionGroup>
