> ## 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 限额。

解析用户的层级（优先采用显式分配的层级，其次为 IdP 组映射，最后为账户默认层级）、覆盖设置、有效限额以及任何待处理的提升限额请求。支持人工用户 ID 和服务用户 ID；对应用户均须为账户成员。需要 ViewAccountConsumption 和 ViewAccountMembership 权限。

有关字段详情和示例，请参阅[预算](https://docs.devin.ai/zh/admin/billing/budgets.md#get-a-users-limits)。

## 权限

需要具有企业级 `ManageAcuLimits` 权限的[服务用户](https://docs.devin.ai/zh/api-reference/v3/service-users/members-service-users.md)或[个人访问令牌](https://docs.devin.ai/zh/api-reference/personal-access-tokens.md)，或者已获得该预算的[委派访问权限](https://docs.devin.ai/zh/admin/billing/budgets.md#who-can-manage-a-budget)。


## OpenAPI

````yaml zh/v3-openapi.yaml GET /v3/enterprise/usage-policies/budgets/{budget_id}/users/{user_id}
openapi: 3.1.0
info:
  description: 采用 Service User 身份验证和 RBAC 的 Devin v3 API
  title: Devin API v3
  version: 3.0.0
servers: []
security:
  - bearerAuth: []
paths:
  /v3/enterprise/usage-policies/budgets/{budget_id}/users/{user_id}:
    get:
      tags:
        - tiers
      summary: 获取用户的用量策略
      description: >-
        获取用户当前适用的层级及强制执行的每周期 ACU 限额。


        解析用户的层级（优先采用显式分配的层级，其次为 IdP
        组映射，最后为账户默认层级）、覆盖设置、有效限额以及任何待处理的提升限额请求。支持人工用户 ID 和服务用户 ID；对应用户均须为账户成员。需要
        ViewAccountConsumption 和 ViewAccountMembership 权限。
      operationId: >-
        handle_get_usage_policy_user_v3_enterprise_usage_policies_budgets__budget_id__users__user_id__get
      parameters:
        - description: 用户 ID
          in: path
          name: user_id
          required: true
          schema:
            title: User Id
            type: string
        - description: 需要管理用量策略的预算。
          in: path
          name: budget_id
          required: true
          schema:
            description: 需要管理用量策略的预算。
            title: Budget Id
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserUsagePolicyResponse'
          description: 成功响应
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 未授权
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 禁止访问
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 未找到
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 冲突
        '410':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 已永久删除
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 无法处理的内容
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProblemDetail'
          description: 请求过多
components:
  schemas:
    UserUsagePolicyResponse:
      description: 用户经解析确定的层级、每周期 ACU 限额及待处理请求。
      properties:
        cycle_acu_limit_override:
          anyOf:
            - type: integer
            - type: 'null'
          description: 用户对层级限额的永久覆盖设置（如有）。
          title: Cycle Acu Limit Override
        effective_cycle_acu_limit:
          anyOf:
            - type: integer
            - type: 'null'
          description: 当前对用户强制执行的限额：primary_cycle_acu_limit 加上回退层级配额（如有）。null 表示无上限。
          title: Effective Cycle Acu Limit
        email:
          anyOf:
            - type: string
            - type: 'null'
          description: 用户的电子邮件地址（如已知）。
          title: Email
        fallback_cycle_acu_limit:
          anyOf:
            - type: integer
            - type: 'null'
          description: 回退层级配额（如有）。
          title: Fallback Cycle Acu Limit
        fallback_tier_id:
          anyOf:
            - type: string
            - type: 'null'
          description: 提供额外配额的单跳回退层级（如有）。
          title: Fallback Tier Id
        fallback_tier_name:
          anyOf:
            - type: string
            - type: 'null'
          description: 回退层级名称（如有）。
          title: Fallback Tier Name
        limit_source:
          description: 当前强制执行的有效限额的来源：'override'（永久覆盖设置）、'temporary_override' 或 'tier'。
          enum:
            - override
            - temporary_override
            - tier
          title: Limit Source
          type: string
        membership:
          description: >-
            用户归属该层级的原因：'explicit'（直接分配）、'idp_group' 或
            'university_certification'（通过优先适用的 IDP 组或认证层级映射），或
            'default'（回退到账户的默认层级）。
          enum:
            - explicit
            - idp_group
            - university_certification
            - default
          title: Membership
          type: string
        name:
          anyOf:
            - type: string
            - type: 'null'
          description: 用户的显示名称（如已知）。
          title: Name
        pending_request_cycle_acu_limit:
          anyOf:
            - type: integer
            - type: 'null'
          description: 待处理请求所申请的每个周期的 ACU 限额。
          title: Pending Request Cycle Acu Limit
        pending_request_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            用户待处理的提升限额请求（如有）；可通过 GET /usage-policies/requests/{request_id}
            解析该请求。
          title: Pending Request Id
        primary_cycle_acu_limit:
          anyOf:
            - type: integer
            - type: 'null'
          description: 不含回退配额的主要配额。
          title: Primary Cycle Acu Limit
        temporary_cycle_acu_limit:
          anyOf:
            - type: integer
            - type: 'null'
          description: 用户的临时覆盖，仅在当前月度计费周期内有效时存在。
          title: Temporary Cycle Acu Limit
        tier_cycle_acu_limit:
          anyOf:
            - type: integer
            - type: 'null'
          description: 应用任何覆盖设置前，层级本身的每个周期的 ACU 限额；null 表示无上限。
          title: Tier Cycle Acu Limit
        tier_id:
          anyOf:
            - type: string
            - type: 'null'
          description: >-
            用于解析用户限额的层级：优先采用显式分配的层级，其次采用优先适用的 IDP
            组映射对应的层级，最后采用账户的默认层级。账户未配置任何层级时为 null，此时用户的限额为无上限。
          title: Tier Id
        tier_name:
          anyOf:
            - type: string
            - type: 'null'
          description: 该层级的显示名称（如有）。
          title: Tier Name
        user_id:
          description: 用户的 ID。
          title: User Id
          type: string
      required:
        - user_id
        - name
        - email
        - cycle_acu_limit_override
        - temporary_cycle_acu_limit
        - effective_cycle_acu_limit
        - primary_cycle_acu_limit
        - fallback_tier_id
        - fallback_tier_name
        - fallback_cycle_acu_limit
        - limit_source
        - membership
        - tier_id
        - tier_name
        - tier_cycle_acu_limit
        - pending_request_id
        - pending_request_cycle_acu_limit
      title: UserUsagePolicyResponse
      type: object
    ProblemDetail:
      description: >-
        v3 API 的 RFC 9457 application/problem+json 错误响应体。


        detail 沿用自旧版 {"detail": ...} 响应体，以保持向后兼容；其他成员字段为新增字段。errors
        包含字段级验证失败信息（仅 422）。
      properties:
        detail:
          anyOf:
            - type: string
            - type: 'null'
          description: 针对此次具体情况的、便于人理解的说明。
          title: Detail
        error_code:
          anyOf:
            - type: string
            - type: 'null'
          description: 因操作被阻止而拒绝请求时返回的机器可读代码（例如 "user_frozen"、"migrated_session"）。
          title: Error Code
        errors:
          anyOf:
            - items:
                additionalProperties: true
                type: object
              type: array
            - type: 'null'
          description: 字段级验证错误（仅适用于 422 响应）。
          title: Errors
        instance:
          anyOf:
            - type: string
            - type: 'null'
          description: 此次出现对应的 URI 引用（请求路径）。
          title: Instance
        status:
          description: HTTP 状态码。
          title: Status
          type: integer
        title:
          description: 对问题类型的简短、便于理解的概述。
          title: Title
          type: string
        type:
          default: about:blank
          description: 用于标识问题类型的 URI 引用。
          title: Type
          type: string
      required:
        - title
        - status
      title: ProblemDetail
      type: object
  securitySchemes:
    bearerAuth:
      description: 服务用户凭据（前缀：cog_）
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.