Requirements, permissions, request and response fields, and error handling.
Request and permissions
POSThttps://openapi.qwenwork.ai/v1/biz/members/{user_id}/quota
Authentication: Authorization: Bearer <access_token>; use an access token obtained through user OAuth authorization.
Required business Scope: biz.quota.manage
Authorization method declared in the contract: Organization authorization (organization)
The platform must enable the Scope for the application. The user must have the required business permissions, and the target resource must be within their accessible scope. Availability of personal or organization authorization depends on the application's actual console configuration.
Behavior and limitations
Set an organization member's total individual quota to adjust their available allowance. The application requires biz.quota.manage authorization, and the operator requires member management permission. The target member must be within their management scope. allowance in the request body uses integer CreditMinor units; 1 Credit equals 10000 CreditMinor. The minimum quota is 5000000 CreditMinor (500 Credits). The value must be a multiple of 10000 and comply with applicable team or organization quota limits. Only members in active or frozen status are supported. Other states or a missing member return 404 quota_member_not_found. Posted usage used is retained after the update. Success returns code, msg, and updated data. If the outcome is uncertain, first call “Get a member's quota” to verify it.Path parameters
| Parameter | Type | Required | Description and constraints |
|---|---|---|---|
user_id | string | Yes | Target member UUID Format: "uuid" |
Request body
A request body is required.application/json
A child field is required only when its parent object is present. Union branches are listed separately; fields from all branches are not required simultaneously.| Field | Type | Required | Description and constraints |
|---|---|---|---|
allowance | integer | Yes | Set in whole Credits; 1 Credit equals 10000 CreditMinor. The business minimum is 500 Credits. Format: "int64" Minimum (inclusive): 0 Maximum (inclusive): 9223372036854775807 Multiple of: 10000 |
Copy
{
"allowance": 5000000
}
Success response
Preserve each business API's original response structure. Do not add a commoncode/msg/data wrapper.
HTTP 200
Member quota set successfully. Response type:application/json
Copy
{
"code": 200,
"data": {
"allowance": 5000000,
"next_used_reset_at": null,
"used": 0,
"user_id": "00000000-0000-4000-8000-000000000001"
},
"msg": ""
}
| Field | Type | Required | Description and constraints |
|---|---|---|---|
code | integer | Yes | Allowed values: [200] |
data | object | Yes | Additional properties: false |
data.allowance | integer | Yes | Individual quota in CreditMinor. Format: "int64" |
data.next_used_reset_at | null | Yes | Always null in the initial release. |
data.used | integer | Yes | Individual posted usage in CreditMinor. Format: "int64" |
data.user_id | string | Yes | Format: "uuid" |
msg | string | Yes | — |
Error responses
| HTTP | Description and handling |
|---|---|
400 | A nonconforming request body returns OPENAPI_INVALID_BODY. A quota below the minimum returns quota_user_below_minimum. Exceeding the team or organization quota returns quota_user_exceeds_team_quota or quota_user_exceeds_org_quota, respectively. |
401 | Missing or invalid token. Check the organization-authorized access token. |
403 | Organization authorization, permission, or application source IP validation failed, or the target is outside the organization/team scope. Business error codes are permission_denied, org_forbidden, or team_forbidden. |
404 | The target member does not exist or is pending or removed. Quotas can be set only for active or frozen members. |
415 | The request body must use application/json. |
422 | Parameter values failed Biz validation. Check the request path and parameters. |
429 | Rate limit exceeded. Reduce the call rate before retrying. |
500 | Quota processing failed. Retain the request ID and contact support. |
502 | Invalid quota service response. Retain the request ID and contact support. |
503 | The quota service or platform is temporarily unavailable. If the write outcome is uncertain, read the quota first to verify it. |
504 | The call timed out. Read the quota first to verify the outcome. |
default | Other platform or service error. Handle according to error_code and retain the request ID. |
Complete field contract
The JSON below contains this API's complete request, response, and error schemas, nested constraints, and public extension definitions. Copy it for reference. No success examples are inferred where none are declared.Expand the complete API OpenAPI JSON
Expand the complete API OpenAPI JSON
Copy
{
"components": {
"securitySchemes": {
"OpenPlatformBearer": {
"description": "Organization-authorized application access token; Scope does not replace operator permissions or resource isolation",
"scheme": "bearer",
"type": "http"
}
}
},
"openapi": "3.1.0",
"paths": {
"/v1/biz/members/{user_id}/quota": {
"post": {
"description": "Set an organization member's total individual quota to adjust their available allowance. The application requires biz.quota.manage authorization, and the operator requires member management permission. The target member must be within their management scope.\n\nallowance in the request body uses integer CreditMinor units; 1 Credit equals 10000 CreditMinor. The minimum quota is 5000000 CreditMinor (500 Credits). The value must be a multiple of 10000 and comply with applicable team or organization quota limits.\n\nOnly members in active or frozen status are supported. Other states or a missing member return 404 quota_member_not_found. Posted usage used is retained after the update. Success returns code, msg, and updated data. If the outcome is uncertain, first call “Get a member's quota” to verify it.",
"operationId": "biz-set-member-quota",
"parameters": [
{
"description": "Target member UUID",
"in": "path",
"name": "user_id",
"required": true,
"schema": {
"format": "uuid",
"type": "string"
}
}
],
"requestBody": {
"content": {
"application/json": {
"example": {
"allowance": 5000000
},
"schema": {
"additionalProperties": false,
"properties": {
"allowance": {
"description": "Set in whole Credits; 1 Credit equals 10000 CreditMinor. The business minimum is 500 Credits.",
"format": "int64",
"maximum": 9223372036854775807,
"minimum": 0,
"multipleOf": 10000,
"type": "integer"
}
},
"required": [
"allowance"
],
"type": "object"
}
}
},
"required": true
},
"responses": {
"200": {
"content": {
"application/json": {
"example": {
"code": 200,
"data": {
"allowance": 5000000,
"next_used_reset_at": null,
"used": 0,
"user_id": "00000000-0000-4000-8000-000000000001"
},
"msg": ""
},
"schema": {
"additionalProperties": false,
"properties": {
"code": {
"enum": [
200
],
"type": "integer"
},
"data": {
"additionalProperties": false,
"properties": {
"allowance": {
"description": "Individual quota in CreditMinor.",
"format": "int64",
"type": "integer"
},
"next_used_reset_at": {
"description": "Always null in the initial release.",
"type": "null"
},
"used": {
"description": "Individual posted usage in CreditMinor.",
"format": "int64",
"type": "integer"
},
"user_id": {
"format": "uuid",
"type": "string"
}
},
"required": [
"user_id",
"allowance",
"used",
"next_used_reset_at"
],
"type": "object"
},
"msg": {
"type": "string"
}
},
"required": [
"code",
"msg",
"data"
],
"type": "object"
}
}
},
"description": "Member quota set successfully.",
"headers": {
"X-Request-ID": {
"description": "Request ID generated by the open platform for each HTTP request for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed Trace ID.",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "OpenTelemetry TraceID of the current open platform request, correlated with X-Request-ID through request logs. A complete trace may not be available if sampling did not retain it.",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
}
}
},
"400": {
"content": {
"application/json": {
"example": {
"code": 400,
"data": null,
"error_code": "quota_user_below_minimum",
"msg": "成员额度至少为 500 Credits"
},
"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": "A nonconforming request body returns OPENAPI_INVALID_BODY. A quota below the minimum returns quota_user_below_minimum. Exceeding the team or organization quota returns quota_user_exceeds_team_quota or quota_user_exceeds_org_quota, respectively.",
"headers": {
"X-Request-ID": {
"description": "Request ID generated by the open platform for each HTTP request for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed Trace ID.",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "OpenTelemetry TraceID of the current open platform request, correlated with X-Request-ID through request logs. A complete trace may not be available if sampling did not retain it.",
"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": "Missing or invalid token. Check the organization-authorized access token.",
"headers": {
"WWW-Authenticate": {
"schema": {
"type": "string"
}
},
"X-Request-ID": {
"description": "Request ID generated by the open platform for each HTTP request for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed Trace ID.",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "OpenTelemetry TraceID of the current open platform request, correlated with X-Request-ID through request logs. A complete trace may not be available if sampling did not retain it.",
"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": "Organization authorization, permission, or application source IP validation failed, or the target is outside the organization/team scope. Business error codes are permission_denied, org_forbidden, or team_forbidden.",
"headers": {
"X-Request-ID": {
"description": "Request ID generated by the open platform for each HTTP request for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed Trace ID.",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "OpenTelemetry TraceID of the current open platform request, correlated with X-Request-ID through request logs. A complete trace may not be available if sampling did not retain it.",
"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": "The target member does not exist or is pending or removed. Quotas can be set only for active or frozen members.",
"headers": {
"X-Request-ID": {
"description": "Request ID generated by the open platform for each HTTP request for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed Trace ID.",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "OpenTelemetry TraceID of the current open platform request, correlated with X-Request-ID through request logs. A complete trace may not be available if sampling did not retain it.",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
}
}
},
"415": {
"content": {
"application/json": {
"example": {
"code": 415,
"data": null,
"error_code": "OPENAPI_UNSUPPORTED_MEDIA_TYPE",
"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": "The request body must use application/json.",
"headers": {
"X-Request-ID": {
"description": "Request ID generated by the open platform for each HTTP request for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed Trace ID.",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "OpenTelemetry TraceID of the current open platform request, correlated with X-Request-ID through request logs. A complete trace may not be available if sampling did not retain it.",
"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": "Parameter values failed Biz validation. Check the request path and parameters.",
"headers": {
"X-Request-ID": {
"description": "Request ID generated by the open platform for each HTTP request for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed Trace ID.",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "OpenTelemetry TraceID of the current open platform request, correlated with X-Request-ID through request logs. A complete trace may not be available if sampling did not retain it.",
"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": "Rate limit exceeded. Reduce the call rate before retrying.",
"headers": {
"Retry-After": {
"description": "Delay in seconds or HTTP date before retrying.",
"schema": {
"type": "string"
}
},
"X-Request-ID": {
"description": "Request ID generated by the open platform for each HTTP request for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed Trace ID.",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "OpenTelemetry TraceID of the current open platform request, correlated with X-Request-ID through request logs. A complete trace may not be available if sampling did not retain it.",
"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": "Quota processing failed. Retain the request ID and contact support.",
"headers": {
"X-Request-ID": {
"description": "Request ID generated by the open platform for each HTTP request for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed Trace ID.",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "OpenTelemetry TraceID of the current open platform request, correlated with X-Request-ID through request logs. A complete trace may not be available if sampling did not retain it.",
"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": "Invalid quota service response. Retain the request ID and contact support.",
"headers": {
"X-Request-ID": {
"description": "Request ID generated by the open platform for each HTTP request for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed Trace ID.",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "OpenTelemetry TraceID of the current open platform request, correlated with X-Request-ID through request logs. A complete trace may not be available if sampling did not retain it.",
"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": "The quota service or platform is temporarily unavailable. If the write outcome is uncertain, read the quota first to verify it.",
"headers": {
"X-Request-ID": {
"description": "Request ID generated by the open platform for each HTTP request for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed Trace ID.",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "OpenTelemetry TraceID of the current open platform request, correlated with X-Request-ID through request logs. A complete trace may not be available if sampling did not retain it.",
"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": "The call timed out. Read the quota first to verify the outcome.",
"headers": {
"X-Request-ID": {
"description": "Request ID generated by the open platform for each HTTP request for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed Trace ID.",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "OpenTelemetry TraceID of the current open platform request, correlated with X-Request-ID through request logs. A complete trace may not be available if sampling did not retain it.",
"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": "Other platform or service error. Handle according to error_code and retain the request ID.",
"headers": {
"X-Request-ID": {
"description": "Request ID generated by the open platform for each HTTP request for log correlation and troubleshooting. Retries generate a new ID. This is not an idempotency key or a distributed Trace ID.",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
},
"X-Trace-ID": {
"description": "OpenTelemetry TraceID of the current open platform request, correlated with X-Request-ID through request logs. A complete trace may not be available if sampling did not retain it.",
"schema": {
"pattern": "^[0-9a-f]{32}$",
"type": "string"
}
}
}
}
},
"security": [
{
"OpenPlatformBearer": []
}
],
"summary": "Set a member's quota",
"tags": [
"额度"
]
}
}
},
"info": {
"title": "Set a member's quota",
"version": "2026-11-24"
},
"servers": [
{
"url": "https://openapi.qwenwork.ai"
}
]
}