docs(api): 同步计费结算接口契约

重新生成 OpenAPI,补充估价字段、任务计费状态、管理员结算查询与审计重试接口。
This commit is contained in:
2026-07-21 00:26:11 +08:00
parent 62d25fcb11
commit c879de18e2
2 changed files with 732 additions and 0 deletions
+440
View File
@@ -1963,6 +1963,160 @@
}
}
},
"/api/admin/runtime/billing-settlements": {
"get": {
"security": [
{
"BearerAuth": []
}
],
"description": "管理端分页查询待结算、重试失败和人工复核记录。",
"produces": [
"application/json"
],
"tags": [
"billing"
],
"summary": "查询计费结算队列",
"parameters": [
{
"type": "string",
"description": "结算状态",
"name": "status",
"in": "query"
},
{
"type": "string",
"description": "动作:settle 或 release",
"name": "action",
"in": "query"
},
{
"type": "integer",
"default": 1,
"description": "页码",
"name": "page",
"in": "query"
},
{
"type": "integer",
"default": 50,
"description": "每页数量",
"name": "pageSize",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/httpapi.BillingSettlementListResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
}
}
}
},
"/api/admin/runtime/billing-settlements/{settlementId}/retry": {
"post": {
"security": [
{
"BearerAuth": []
}
],
"description": "Manager 使用单值 Idempotency-Key 将重试失败或人工复核记录重新放入队列,并记录审计日志。",
"produces": [
"application/json"
],
"tags": [
"billing"
],
"summary": "重试计费结算",
"parameters": [
{
"type": "string",
"description": "结算记录 ID",
"name": "settlementId",
"in": "path",
"required": true
},
{
"type": "string",
"description": "幂等键",
"name": "Idempotency-Key",
"in": "header",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/httpapi.BillingSettlementRetryResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
},
"401": {
"description": "Unauthorized",
"schema": {
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
},
"403": {
"description": "Forbidden",
"schema": {
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
},
"404": {
"description": "Not Found",
"schema": {
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
},
"409": {
"description": "Conflict",
"schema": {
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
},
"500": {
"description": "Internal Server Error",
"schema": {
"$ref": "#/definitions/httpapi.ErrorEnvelope"
}
}
}
}
},
"/api/admin/runtime/model-rate-limits": {
"get": {
"security": [
@@ -5340,6 +5494,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -5501,6 +5661,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -5594,6 +5760,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -5804,6 +5976,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -6202,6 +6380,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -6445,6 +6629,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -6538,6 +6728,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -6940,6 +7136,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -7033,6 +7235,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -7853,6 +8061,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -7966,6 +8180,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -8059,6 +8279,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -8152,6 +8378,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -8271,6 +8503,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -8440,6 +8678,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -8533,6 +8777,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -9118,6 +9368,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -9279,6 +9535,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -9372,6 +9634,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -9465,6 +9733,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -9558,6 +9832,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -9727,6 +10007,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -9820,6 +10106,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -9971,6 +10263,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -10167,6 +10465,12 @@
"name": "X-Async",
"in": "header"
},
{
"type": "string",
"description": "可选请求幂等键;同一用户范围内唯一",
"name": "Idempotency-Key",
"in": "header"
},
{
"description": "AI 任务请求,字段随任务类型变化",
"name": "input",
@@ -10469,6 +10773,40 @@
}
}
},
"httpapi.BillingSettlementListResponse": {
"type": "object",
"properties": {
"items": {
"type": "array",
"items": {
"$ref": "#/definitions/store.BillingSettlement"
}
},
"page": {
"type": "integer",
"example": 1
},
"pageSize": {
"type": "integer",
"example": 50
},
"total": {
"type": "integer",
"example": 42
}
}
},
"httpapi.BillingSettlementRetryResponse": {
"type": "object",
"properties": {
"auditLog": {
"$ref": "#/definitions/store.AuditLog"
},
"settlement": {
"$ref": "#/definitions/store.BillingSettlement"
}
}
},
"httpapi.CatalogProviderListResponse": {
"type": "object",
"properties": {
@@ -12658,6 +12996,67 @@
}
}
},
"store.BillingSettlement": {
"type": "object",
"properties": {
"action": {
"type": "string"
},
"amount": {
"type": "number"
},
"attempts": {
"type": "integer"
},
"completedAt": {
"type": "string"
},
"createdAt": {
"type": "string"
},
"currency": {
"type": "string"
},
"id": {
"type": "string"
},
"lastErrorCode": {
"type": "string"
},
"lastErrorMessage": {
"type": "string"
},
"lockedAt": {
"type": "string"
},
"lockedBy": {
"type": "string"
},
"manualReviewReason": {
"type": "string"
},
"nextAttemptAt": {
"type": "string"
},
"payload": {
"type": "object",
"additionalProperties": {}
},
"pricingSnapshot": {
"type": "object",
"additionalProperties": {}
},
"status": {
"type": "string"
},
"taskId": {
"type": "string"
},
"updatedAt": {
"type": "string"
}
}
},
"store.CatalogProvider": {
"type": "object",
"properties": {
@@ -13089,10 +13488,25 @@
"$ref": "#/definitions/store.TaskAttempt"
}
},
"billingCurrency": {
"type": "string"
},
"billingSettledAt": {
"type": "string"
},
"billingStatus": {
"type": "string"
},
"billingSummary": {
"type": "object",
"additionalProperties": {}
},
"billingUpdatedAt": {
"type": "string"
},
"billingVersion": {
"type": "string"
},
"billings": {
"type": "array",
"items": {}
@@ -13115,6 +13529,9 @@
"errorMessage": {
"type": "string"
},
"executionLeaseExpiresAt": {
"type": "string"
},
"finalChargeAmount": {
"type": "number"
},
@@ -13149,6 +13566,10 @@
"newMessageCount": {
"type": "integer"
},
"pricingSnapshot": {
"type": "object",
"additionalProperties": {}
},
"remoteTaskId": {
"type": "string"
},
@@ -13160,12 +13581,18 @@
"type": "object",
"additionalProperties": {}
},
"requestFingerprint": {
"type": "string"
},
"requestId": {
"type": "string"
},
"requestedModel": {
"type": "string"
},
"reservationAmount": {
"type": "number"
},
"resolvedModel": {
"type": "string"
},
@@ -14506,6 +14933,10 @@
"platformName": {
"type": "string"
},
"pricingSnapshot": {
"type": "object",
"additionalProperties": {}
},
"provider": {
"type": "string"
},
@@ -14515,6 +14946,9 @@
"queueKey": {
"type": "string"
},
"requestFingerprint": {
"type": "string"
},
"requestId": {
"type": "string"
},
@@ -14553,6 +14987,12 @@
"taskId": {
"type": "string"
},
"upstreamSubmissionStatus": {
"type": "string"
},
"upstreamSubmissionUpdatedAt": {
"type": "string"
},
"usage": {
"type": "object",
"additionalProperties": {}