Skip to main content

查询成员额度

调用条件、权限、请求字段、响应字段与错误处理。

请求与权限

GET https://openapi.qwenwork.ai/v1/biz/members/{user_id}/quota 鉴权:Authorization: Bearer <access_token>;使用用户 OAuth 授权获得的访问令牌。 所需业务 Scope:biz.quota.read 契约声明的授权方式:组织授权(organization) Scope 需由平台为应用开通;用户须有相应业务权限,目标资源须在其可访问范围内。个人/组织方式是否为该应用开放,以控制台实际配置为准。

功能与限制

查询一名企业成员的个人额度和已入账使用量。应用需要 biz.quota.read 授权,操作者需要成员读取权限,目标成员须在其可查看范围内。 仅支持 active、frozen 状态成员,成员不存在或状态不符合时返回 404 quota_member_not_found。 成功返回 code、msg 和 data。额度单位为整数 CreditMinor,1 Credit 等于 10000 CreditMinor。data=null 表示尚无额度记录,data.allowance=null 表示历史无限额度,allowance=0 表示实际额度为零。next_used_reset_at 当前返回 null。

路径参数

参数类型必填说明及约束
user_idstring是目标成员 UUID
格式:"uuid"

请求体

公开契约未声明请求体。不要自行添加身份字段或未经声明的业务字段。

成功响应

保持各业务接口原始响应结构,不统一添加 code/msg/data 包装。

HTTP 200

查询成员额度成功 响应类型:application/json
{
  "code": 200,
  "data": null,
  "msg": ""
}
字段类型必含说明及约束
codeinteger是可选值:[200]
dataobject | null是—
dataobject是至少满足一种:分支 1
额外字段:false
data.allowanceinteger | null是至少满足一种:分支 1
个人额度,单位 CreditMinor。 历史无限额为 null,实际零值为 0。
格式:"int64"
data.next_used_reset_atnull是至少满足一种:分支 1
首期固定为 null。
data.usedinteger是至少满足一种:分支 1
个人已入账使用量,单位 CreditMinor。
格式:"int64"
data.user_idstring是至少满足一种:分支 1
格式:"uuid"
datanull是至少满足一种:分支 2
—
msgstring是—

错误响应

HTTP说明及处理
400请求不符合参数契约。
401令牌缺失或无效。检查企业授权访问令牌。
403企业授权、权限或应用来源 IP 校验失败,或目标超出企业、团队范围。业务错误码为 permission_denied、org_forbidden 或 team_forbidden。
404目标成员不存在、待接受邀请或已移除。核对成员 UUID 和状态。
422参数值未通过 Biz 校验。检查请求路径及参数。
429调用频率超限。降低调用频率后重试。
500额度处理失败。保留请求 ID 联系维护方。
502额度服务响应无效。保留请求 ID 联系维护方。
503额度服务或平台暂不可用。
504调用超时。
default其他平台或服务错误。按 error_code 判断处理方式,并保留请求 ID。
保留响应中的请求 ID 和错误字段用于排查。写操作超时或断线后可能已经生效,不能仅凭没有收到成功响应就自动重试。

完整字段契约

下方 JSON 包含本接口完整请求、响应、错误 Schema、嵌套约束和公开扩展定义,可复制用于核对。未声明的成功示例不作推测。
{
  "components": {
    "securitySchemes": {
      "OpenPlatformBearer": {
        "description": "企业授权应用访问令牌;Scope 不代替操作者权限与资源隔离",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "openapi": "3.1.0",
  "paths": {
    "/v1/biz/members/{user_id}/quota": {
      "get": {
        "description": "查询一名企业成员的个人额度和已入账使用量。应用需要 biz.quota.read 授权,操作者需要成员读取权限,目标成员须在其可查看范围内。\n\n仅支持 active、frozen 状态成员,成员不存在或状态不符合时返回 404 quota_member_not_found。\n\n成功返回 code、msg 和 data。额度单位为整数 CreditMinor,1 Credit 等于 10000 CreditMinor。data=null 表示尚无额度记录,data.allowance=null 表示历史无限额度,allowance=0 表示实际额度为零。next_used_reset_at 当前返回 null。",
        "operationId": "biz-get-member-quota",
        "parameters": [
          {
            "description": "目标成员 UUID",
            "in": "path",
            "name": "user_id",
            "required": true,
            "schema": {
              "format": "uuid",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "example": {
                  "code": 200,
                  "data": null,
                  "msg": ""
                },
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "code": {
                      "enum": [
                        200
                      ],
                      "type": "integer"
                    },
                    "data": {
                      "anyOf": [
                        {
                          "additionalProperties": false,
                          "properties": {
                            "allowance": {
                              "description": "个人额度,单位 CreditMinor。 历史无限额为 null,实际零值为 0。",
                              "format": "int64",
                              "type": [
                                "integer",
                                "null"
                              ]
                            },
                            "next_used_reset_at": {
                              "description": "首期固定为 null。",
                              "type": "null"
                            },
                            "used": {
                              "description": "个人已入账使用量,单位 CreditMinor。",
                              "format": "int64",
                              "type": "integer"
                            },
                            "user_id": {
                              "format": "uuid",
                              "type": "string"
                            }
                          },
                          "required": [
                            "user_id",
                            "allowance",
                            "used",
                            "next_used_reset_at"
                          ],
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "msg": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "msg",
                    "data"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "查询成员额度成功",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "example": {
                  "code": 400,
                  "data": null,
                  "error_code": "OPENAPI_INVALID_REQUEST",
                  "msg": "请求参数不符合接口要求"
                },
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "null"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "msg": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "trace_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "msg",
                    "data",
                    "error_code"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "请求不符合参数契约。",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "example": {
                  "code": 401,
                  "data": null,
                  "error_code": "OPENAPI_UNAUTHENTICATED",
                  "msg": "访问凭证缺失、无效或已失效"
                },
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "null"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "msg": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "trace_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "msg",
                    "data",
                    "error_code"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "令牌缺失或无效。检查企业授权访问令牌。",
            "headers": {
              "WWW-Authenticate": {
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "content": {
              "application/json": {
                "example": {
                  "code": 403,
                  "data": null,
                  "error_code": "permission_denied",
                  "msg": "没有操作权限"
                },
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "null"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "msg": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "trace_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "msg",
                    "data",
                    "error_code"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "企业授权、权限或应用来源 IP 校验失败,或目标超出企业、团队范围。业务错误码为 permission_denied、org_forbidden 或 team_forbidden。",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "example": {
                  "code": 404,
                  "data": null,
                  "error_code": "quota_member_not_found",
                  "msg": "成员不存在"
                },
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "null"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "msg": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "trace_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "msg",
                    "data",
                    "error_code"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "目标成员不存在、待接受邀请或已移除。核对成员 UUID 和状态。",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "422": {
            "content": {
              "application/json": {
                "example": {
                  "code": 422,
                  "data": null,
                  "error_code": "OPENAPI_INVALID_REQUEST",
                  "msg": "请求参数无效"
                },
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "null"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "msg": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "trace_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "msg",
                    "data",
                    "error_code"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "参数值未通过 Biz 校验。检查请求路径及参数。",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "example": {
                  "code": 429,
                  "data": null,
                  "error_code": "OPENAPI_RATE_LIMITED",
                  "msg": "调用频率超限"
                },
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "null"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "msg": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "trace_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "msg",
                    "data",
                    "error_code"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "调用频率超限。降低调用频率后重试。",
            "headers": {
              "Retry-After": {
                "description": "Delay in seconds or HTTP date before retrying.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "500": {
            "content": {
              "application/json": {
                "example": {
                  "code": 500,
                  "data": null,
                  "error_code": "internal_error",
                  "msg": "额度处理失败"
                },
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "null"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "msg": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "trace_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "msg",
                    "data",
                    "error_code"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "额度处理失败。保留请求 ID 联系维护方。",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "content": {
              "application/json": {
                "example": {
                  "code": 502,
                  "data": null,
                  "error_code": "biz_openapi_unavailable",
                  "msg": "额度服务暂不可用"
                },
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "null"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "msg": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "trace_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "msg",
                    "data",
                    "error_code"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "额度服务响应无效。保留请求 ID 联系维护方。",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "example": {
                  "code": 503,
                  "data": null,
                  "error_code": "biz_openapi_unavailable",
                  "msg": "额度服务暂不可用"
                },
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "null"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "msg": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "trace_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "msg",
                    "data",
                    "error_code"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "额度服务或平台暂不可用。",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "504": {
            "content": {
              "application/json": {
                "example": {
                  "code": 504,
                  "data": null,
                  "error_code": "OPENAPI_TIMEOUT",
                  "msg": "请求处理超时"
                },
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "null"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "msg": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "trace_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "msg",
                    "data",
                    "error_code"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "调用超时。",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          },
          "default": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "code": {
                      "type": "integer"
                    },
                    "data": {
                      "type": "null"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "msg": {
                      "type": "string"
                    },
                    "request_id": {
                      "type": "string"
                    },
                    "trace_id": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "code",
                    "msg",
                    "data",
                    "error_code"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "其他平台或服务错误。按 error_code 判断处理方式,并保留请求 ID。",
            "headers": {
              "X-Request-ID": {
                "description": "开放平台为每次 HTTP 请求生成的请求 ID,用于日志关联与故障排查;重试生成新的 ID,不是幂等键或分布式 Trace ID。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              },
              "X-Trace-ID": {
                "description": "开放平台当前请求的 OpenTelemetry TraceID,通过请求日志与 X-Request-ID 关联;采样未保留时可能没有完整链路记录。",
                "schema": {
                  "pattern": "^[0-9a-f]{32}$",
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "OpenPlatformBearer": []
          }
        ],
        "summary": "查询成员额度",
        "tags": [
          "额度"
        ]
      }
    }
  },
  "info": {
    "title": "查询成员额度",
    "version": "2026-11-24"
  },
  "servers": [
    {
      "url": "https://openapi.qwenwork.ai"
    }
  ]
}
返回 OpenAPI 总览。