{
  "openapi": "3.1.0",
  "info": {
    "title": "IP 中台服务平台开发者 API",
    "version": "1.1.0-dual-credential-v1.17",
    "description": "Phase 1 已批准的 OAuth/API Key 双凭据契约。资金和 ID 字段以十进制字符串传输；OAuth2/OIDC 错误遵循 RFC，其余错误使用 error/message。API Key 创建时绑定唯一 Client，确认一次性交付后才可调用模型；功能开关未开放时返回 503。"
  },
  "servers": [{ "url": "/", "description": "当前部署" }],
  "tags": [
    { "name": "OAuth" },
    { "name": "Identity" },
    { "name": "AI Marketplace" },
    { "name": "Developer Documentation" },
    { "name": "Client Management" },
    { "name": "Billing" },
    { "name": "Webhooks" },
    { "name": "Models" },
    { "name": "Developer API Key" },
    { "name": "Sandbox" },
    { "name": "Admin API Key" },
    { "name": "Points" },
    { "name": "Payments" }
  ],
  "paths": {
    "/v1/oauth/authorize": {
      "get": {
        "tags": ["OAuth"],
        "summary": "Authorization Code + PKCE 协议执行（由 IdP Web 授权页在隐私同意后调用）",
        "description": "第三方浏览器入口是 GET /oauth/authorize。该 IdP Web 页面在首方 Session 下展示当前隐私政策、记录 OAuth 同意后调用本端点；第三方应用不得直接调用隐私同意接口。",
        "parameters": [
          { "name": "response_type", "in": "query", "required": true, "schema": { "const": "code" } },
          { "name": "client_id", "in": "query", "required": true, "schema": { "type": "string" } },
          { "name": "redirect_uri", "in": "query", "required": true, "schema": { "type": "string", "format": "uri" } },
          { "name": "scope", "in": "query", "required": true, "schema": { "type": "string" } },
          { "name": "code_challenge", "in": "query", "required": true, "schema": { "type": "string", "minLength": 43, "maxLength": 128 } },
          { "name": "code_challenge_method", "in": "query", "required": true, "schema": { "const": "S256" } },
          { "name": "state", "in": "query", "schema": { "type": "string" } },
          { "name": "nonce", "in": "query", "description": "scope 包含 openid 时必填", "schema": { "type": "string" } }
        ],
        "responses": {
          "302": { "description": "重定向到已登记 redirect_uri，并携带 code/state 或 OAuth 错误" },
          "400": { "$ref": "#/components/responses/OAuthError" },
          "403": { "$ref": "#/components/responses/OAuthError" }
        }
      }
    },
    "/v1/oauth/token": {
      "post": {
        "tags": ["OAuth"],
        "summary": "兑换或刷新 Token",
        "security": [{ "clientBasic": [] }],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  { "$ref": "#/components/schemas/AuthorizationCodeGrant" },
                  { "$ref": "#/components/schemas/RefreshTokenGrant" }
                ]
              }
            }
          }
        },
        "responses": {
          "200": { "description": "Token 签发成功", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OAuthToken" } } } },
          "400": { "$ref": "#/components/responses/OAuthError" },
          "401": { "$ref": "#/components/responses/OAuthError" }
        }
      }
    },
    "/v1/oauth/userinfo": {
      "get": {
        "tags": ["Identity"],
        "summary": "读取标准化用户资料",
        "security": [{ "oauthAccessToken": [] }],
        "responses": {
          "200": { "description": "用户资料", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/UserInfo" } } } },
          "401": { "$ref": "#/components/responses/AppError" },
          "403": { "$ref": "#/components/responses/AppError" }
        }
      }
    },
    "/v1/oauth/revoke": {
      "post": {
        "tags": ["OAuth"],
        "summary": "撤销当前用户对 Client 的授权",
        "security": [{ "oauthAccessToken": [] }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false } } } },
        "responses": {
          "200": { "description": "撤销成功", "content": { "application/json": { "schema": { "type": "object", "properties": { "revoked": { "const": true } }, "required": ["revoked"] } } } },
          "401": { "$ref": "#/components/responses/AppError" }
        }
      }
    },
    "/v1/user/membership": {
      "get": {
        "tags": ["Identity"],
        "summary": "读取实时会员等级",
        "security": [{ "oauthAccessToken": [] }],
        "responses": {
          "200": { "description": "会员等级", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "no-store" } }, "Pragma": { "schema": { "type": "string", "const": "no-cache" } } }, "content": { "application/json": { "schema": { "type": "object", "properties": { "member_level": { "type": "integer", "minimum": 0, "maximum": 4 } }, "required": ["member_level"] } } } },
          "401": { "$ref": "#/components/responses/MembershipAppError" },
          "403": { "$ref": "#/components/responses/MembershipAppError" },
          "429": { "$ref": "#/components/responses/MembershipRateLimitError" },
          "503": { "$ref": "#/components/responses/MembershipAppError" }
        }
      }
    },
    "/v1/user/membership/details": {
      "get": {
        "tags": ["Identity"],
        "summary": "读取当前会员详情",
        "description": "读取实时会员等级、套餐权益、当前购买周期和预约降级周期。需要 membership.read scope；开放会员 API 总开关关闭时返回 503。",
        "security": [{ "oauthAccessToken": [] }],
        "responses": {
          "200": {
            "description": "会员详情",
            "headers": {
              "Cache-Control": { "schema": { "type": "string", "const": "no-store" } },
              "Pragma": { "schema": { "type": "string", "const": "no-cache" } }
            },
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MembershipDetails" } } }
          },
          "401": { "$ref": "#/components/responses/MembershipAppError" },
          "403": { "$ref": "#/components/responses/MembershipAppError" },
          "429": { "$ref": "#/components/responses/MembershipRateLimitError" },
          "503": { "$ref": "#/components/responses/MembershipAppError" }
        }
      }
    },
    "/v1/user/wallet": {
      "get": {
        "tags": ["Identity"],
        "summary": "读取当前授权用户的钱包摘要",
        "description": "需要 points.read。只返回当前 Access Token 对应主体；不提供会员或钱包列表、搜索、导出及跨用户查询。",
        "security": [{ "oauthAccessToken": [] }],
        "responses": {
          "200": { "description": "当前主体钱包摘要", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WalletSummary" } } } },
          "401": { "$ref": "#/components/responses/AppError" },
          "403": { "$ref": "#/components/responses/AppError" },
          "503": { "$ref": "#/components/responses/AppError" }
        }
      }
    },
    "/v1/user/billing-entries": {
      "post": {
        "tags": ["Billing"],
        "summary": "为当前授权用户创建一次性支付入口",
        "description": "需要 billing.initiate。return_uri 必须精确匹配 Client 的 billing_return_uris；请求不接受 user_id、手机号、Client 归属或返佣字段。",
        "security": [{ "oauthAccessToken": [] }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BillingEntryRequest" } } } },
        "responses": {
          "201": { "description": "短时单次支付入口", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BillingEntryCreateResult" } } } },
          "400": { "$ref": "#/components/responses/AppError" },
          "401": { "$ref": "#/components/responses/AppError" },
          "403": { "$ref": "#/components/responses/AppError" },
          "404": { "$ref": "#/components/responses/AppError" }
        }
      }
    },
    "/v1/user/billing-entries/{entryId}": {
      "get": {
        "tags": ["Billing"],
        "summary": "读取当前应用、当前用户的单个支付入口状态",
        "description": "需要 billing.initiate。不提供列表接口，且不能查询其他应用或其他用户的入口。",
        "security": [{ "oauthAccessToken": [] }],
        "parameters": [{ "name": "entryId", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/BigIntString" } }],
        "responses": {
          "200": { "description": "入口及其绑定订单状态", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/BillingEntryStatus" } } } },
          "400": { "$ref": "#/components/responses/AppError" },
          "401": { "$ref": "#/components/responses/AppError" },
          "403": { "$ref": "#/components/responses/AppError" },
          "404": { "$ref": "#/components/responses/AppError" }
        }
      }
    },
    "/v1/platform/apps": {
      "get": {
        "tags": ["AI Marketplace"],
        "summary": "分页读取 AI 超市已上架应用",
        "description": "公开只读目录，只返回当前 active 应用的展示与跳转字段。不会返回开发者身份、回调白名单、支付回跳白名单、授权范围、Secret 或会员数据。",
        "parameters": [
          { "name": "page", "in": "query", "schema": { "type": "integer", "minimum": 1, "default": 1 } },
          { "name": "page_size", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } }
        ],
        "responses": {
          "200": { "description": "已上架应用分页", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicApplicationPage" } } } },
          "400": { "$ref": "#/components/responses/AppError" }
        }
      }
    },
    "/v1/platform/models": {
      "get": {
        "tags": ["Developer Documentation"],
        "summary": "读取公开模型文档索引",
        "description": "公开只读目录，只返回模型与供应商均启用且供应商未删除的文档展示字段。不会返回供应商、成本、应用定价、会员门槛或凭证。",
        "responses": {
          "200": { "description": "可公开访问的模型文档索引", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicModelCatalog" } } } }
        }
      }
    },
    "/v1/platform/models/pricing": {
      "get": {
        "tags": ["Developer Documentation"],
        "summary": "读取公开模型默认价格",
        "description": "公开只读价格目录，只返回当前可用模型的默认积分价格、计费单位与平台积分汇率。不会返回供应商、平台成本、Client 覆盖价格、会员门槛或凭证。",
        "responses": {
          "200": { "description": "当前可用模型的默认价格", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "no-store" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PublicModelPricingCatalog" } } } }
        }
      }
    },
    "/v1/platform/models/documentation": {
      "get": {
        "tags": ["Developer Documentation"],
        "summary": "读取实时模型 Markdown 索引",
        "description": "为 LLM、代码代理和开发者实时生成当前可用模型的 Markdown 索引。内容包含逐模型 Markdown 链接，不包含供应商、成本、应用定价、会员门槛或凭证。",
        "responses": {
          "200": {
            "description": "实时模型 Markdown 索引",
            "headers": { "Cache-Control": { "schema": { "type": "string", "const": "no-store" } } },
            "content": { "text/markdown": { "schema": { "type": "string" } } }
          }
        }
      }
    },
    "/v1/platform/models/{modelKey}/documentation": {
      "get": {
        "tags": ["Developer Documentation"],
        "summary": "读取单个模型的实时 Markdown 调用文档",
        "description": "仅为当前模型与供应商均启用且供应商未删除的模型生成文档。包含 API Key 与 OAuth 两种调用模式，以及 cURL、Node.js、Python 示例。",
        "parameters": [
          { "name": "modelKey", "in": "path", "required": true, "schema": { "type": "string", "maxLength": 64 } }
        ],
        "responses": {
          "200": {
            "description": "单模型实时 Markdown 调用文档",
            "headers": { "Cache-Control": { "schema": { "type": "string", "const": "no-store" } } },
            "content": { "text/markdown": { "schema": { "type": "string" } } }
          },
          "404": { "$ref": "#/components/responses/AppError" }
        }
      }
    },
    "/v1/developer/clients": {
      "get": {
        "tags": ["Client Management"],
        "summary": "分页读取本人应用",
        "description": "只返回当前开发者名下的应用配置。client_secret_masked 仅表示 Secret 是否已配置，不包含明文、后缀或哈希。",
        "security": [{ "sessionCookie": [] }],
        "parameters": [
          { "name": "page", "in": "query", "schema": { "type": "integer", "minimum": 1, "default": 1 } },
          { "name": "page_size", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } }
        ],
        "responses": {
          "200": { "description": "本人应用分页", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClientApplicationPage" } } } },
          "401": { "$ref": "#/components/responses/AppError" }
        }
      },
      "post": {
        "tags": ["Client Management"],
        "summary": "已停用的直接正式应用创建入口",
        "description": "新应用必须先通过 POST /v1/developer/sandboxes 创建测试库并完成基础联调，再从 Sandbox 提交正式上线申请。该旧路径保留用于向旧调用方稳定返回 409 sandbox_required，不创建任何数据。",
        "security": [{ "sessionCookie": [] }],
        "responses": {
          "401": { "$ref": "#/components/responses/AppError" },
          "409": { "description": "sandbox_required", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AppError" } } } }
        }
      }
    },
    "/v1/developer/clients/{clientId}": {
      "patch": {
        "tags": ["Client Management"],
        "summary": "修改本人应用配置",
        "description": "名称和最低会员等级直接生效。修改首页、授权范围、OAuth 回调或支付回跳白名单时，应用转为 pending 并从 AI 超市下架，旧 Refresh Token 与 Client Secret 失效。Sandbox 正式申请被拒后不得通过本端点原地回审，须从原 Sandbox 重新申请，返回 409 sandbox_required。",
        "security": [{ "sessionCookie": [] }],
        "parameters": [{ "name": "clientId", "in": "path", "required": true, "schema": { "type": "string" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClientConfigUpdateRequest" } } } },
        "responses": {
          "200": { "description": "保存后的应用配置及重新审核标记", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClientConfigUpdate" } } } },
          "400": { "$ref": "#/components/responses/AppError" },
          "401": { "$ref": "#/components/responses/AppError" },
          "403": { "$ref": "#/components/responses/AppError" },
          "404": { "$ref": "#/components/responses/AppError" },
          "409": { "$ref": "#/components/responses/AppError" }
        }
      }
    },
    "/v1/developer/clients/{clientId}/secret": {
      "get": {
        "tags": ["Client Management"],
        "summary": "领取审核签发的 Client Secret",
        "description": "仅 Active 应用、仅可信首方浏览器可调用；明文使用 GETDEL 语义只返回一次，响应禁止缓存。",
        "security": [{ "sessionCookie": [] }],
        "parameters": [{ "name": "clientId", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": {
          "200": { "description": "一次性明文", "headers": { "Cache-Control": { "schema": { "const": "no-store" } }, "Pragma": { "schema": { "const": "no-cache" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClientSecretResponse" } } } },
          "401": { "$ref": "#/components/responses/AppError" },
          "403": { "$ref": "#/components/responses/AppError" },
          "404": { "$ref": "#/components/responses/AppError" }
        }
      }
    },
    "/v1/developer/clients/{clientId}/rotate-secret": {
      "post": {
        "tags": ["Client Management"],
        "summary": "轮换 Client Secret",
        "description": "仅 Active 或 Disabled 应用可轮换。旧 Secret 在事务提交后立即失效，新明文只在本次响应返回。",
        "security": [{ "sessionCookie": [] }],
        "parameters": [{ "name": "clientId", "in": "path", "required": true, "schema": { "type": "string" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false } } } },
        "responses": {
          "200": { "description": "轮换后的一次性明文", "headers": { "Cache-Control": { "schema": { "const": "no-store" } }, "Pragma": { "schema": { "const": "no-cache" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClientSecretResponse" } } } },
          "401": { "$ref": "#/components/responses/AppError" },
          "403": { "$ref": "#/components/responses/AppError" },
          "404": { "$ref": "#/components/responses/AppError" }
        }
      }
    },
    "/v1/developer/clients/{clientId}/webhook": {
      "get": {
        "tags": ["Webhooks"],
        "summary": "读取本人 Client 的 Webhook 脱敏配置",
        "security": [{ "sessionCookie": [] }],
        "parameters": [{ "name": "clientId", "in": "path", "required": true, "schema": { "type": "string" } }],
        "responses": {
          "200": { "description": "配置元数据，不返回密钥；尚未配置时为 null", "content": { "application/json": { "schema": { "oneOf": [{ "$ref": "#/components/schemas/WebhookConfig" }, { "type": "null" }] } } } },
          "401": { "$ref": "#/components/responses/AppError" },
          "403": { "$ref": "#/components/responses/AppError" },
          "404": { "$ref": "#/components/responses/AppError" }
        }
      },
      "put": {
        "tags": ["Webhooks"],
        "summary": "配置或轮换本人 Client 的 Webhook",
        "description": "新建或 rotate_secret=true 时，webhook_secret 只在本次响应中返回；之后不能读取明文。",
        "security": [{ "sessionCookie": [] }],
        "parameters": [{ "name": "clientId", "in": "path", "required": true, "schema": { "type": "string" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookConfigRequest" } } } },
        "responses": {
          "200": { "description": "保存后的配置；密钥仅在新建或轮换时出现", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookConfig" } } } },
          "400": { "$ref": "#/components/responses/AppError" },
          "401": { "$ref": "#/components/responses/AppError" },
          "403": { "$ref": "#/components/responses/AppError" },
          "404": { "$ref": "#/components/responses/AppError" }
        }
      }
    },
    "/v1/developer/sandboxes": {
      "get": {
        "tags": ["Sandbox"],
        "summary": "分页读取本人 Sandbox 控制面状态",
        "security": [{ "sessionCookie": [] }],
        "parameters": [{ "name": "page", "in": "query", "schema": { "type": "integer", "minimum": 1, "default": 1 } }, { "name": "page_size", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } }],
        "responses": { "200": { "description": "Sandbox 状态分页", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SandboxPage" } } } }, "400": { "$ref": "#/components/responses/AppError" }, "401": { "$ref": "#/components/responses/AppError" } }
      },
      "post": {
        "tags": ["Sandbox"],
        "summary": "创建或从本人正式 Client 复制 Sandbox",
        "description": "不创建 Admin 审核任务，不进入 AI 超市。request_id 重放只返回同一 Sandbox，不会创建第二个。",
        "security": [{ "sessionCookie": [] }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SandboxCreateRequest" } } } },
        "responses": { "200": { "description": "创建意图重放", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SandboxStatus" } } } }, "202": { "description": "已排队初始化", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SandboxStatus" } } } }, "400": { "$ref": "#/components/responses/AppError" }, "401": { "$ref": "#/components/responses/AppError" }, "403": { "$ref": "#/components/responses/AppError" }, "409": { "$ref": "#/components/responses/AppError" }, "503": { "$ref": "#/components/responses/AppError" } }
      }
    },
    "/v1/developer/sandboxes/{sandboxClientId}": {
      "get": {
        "tags": ["Sandbox"], "summary": "读取单个 Sandbox 状态", "security": [{ "sessionCookie": [] }],
        "parameters": [{ "name": "sandboxClientId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^sbx_" } }],
        "responses": { "200": { "description": "Sandbox 状态", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SandboxStatus" } } } }, "401": { "$ref": "#/components/responses/AppError" }, "404": { "$ref": "#/components/responses/AppError" } }
      }
    },
    "/v1/developer/sandboxes/{sandboxClientId}/configuration": {
      "put": {
        "tags": ["Sandbox"], "summary": "以版本锁修改 Sandbox 配置", "description": "响应不确定时复用原 request_id、config_version 和 configuration；服务端优先返回同请求重放，再判断版本冲突。", "security": [{ "sessionCookie": [] }],
        "parameters": [{ "name": "sandboxClientId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^sbx_" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SandboxConfigurationUpdateRequest" } } } },
        "responses": { "200": { "description": "更新后的状态", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SandboxStatus" } } } }, "400": { "$ref": "#/components/responses/AppError" }, "401": { "$ref": "#/components/responses/AppError" }, "404": { "$ref": "#/components/responses/AppError" }, "409": { "$ref": "#/components/responses/AppError" } }
      }
    },
    "/v1/developer/sandboxes/{sandboxClientId}/resume": {
      "post": {
        "tags": ["Sandbox"], "summary": "恢复并重新校验既有 Sandbox", "description": "同一恢复意图的网络重试必须复用原 request_id。", "security": [{ "sessionCookie": [] }],
        "parameters": [{ "name": "sandboxClientId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^sbx_" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SandboxRequestId" } } } },
        "responses": { "200": { "description": "幂等重放或已经可用", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SandboxStatus" } } } }, "202": { "description": "恢复校验已排队", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SandboxStatus" } } } }, "401": { "$ref": "#/components/responses/AppError" }, "404": { "$ref": "#/components/responses/AppError" }, "409": { "$ref": "#/components/responses/AppError" }, "503": { "$ref": "#/components/responses/AppError" } }
      }
    },
    "/v1/developer/sandboxes/{sandboxClientId}/pause": {
      "post": {
        "tags": ["Sandbox"], "summary": "二次确认暂停 Sandbox", "description": "同一暂停意图的网络重试必须复用原 request_id。", "security": [{ "sessionCookie": [] }],
        "parameters": [{ "name": "sandboxClientId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^sbx_" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SandboxPauseRequest" } } } },
        "responses": { "200": { "description": "已暂停；不删除测试数据", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SandboxStatus" } } } }, "400": { "$ref": "#/components/responses/AppError" }, "401": { "$ref": "#/components/responses/AppError" }, "404": { "$ref": "#/components/responses/AppError" }, "409": { "$ref": "#/components/responses/AppError" }, "503": { "$ref": "#/components/responses/AppError" } }
      }
    },
    "/v1/developer/sandboxes/{sandboxClientId}/credentials": {
      "get": {
        "tags": ["Sandbox"], "summary": "读取当前有效的 Sandbox 测试凭据", "description": "仅 Active Sandbox 的所有者可在 Trusted Browser 中读取；当前有效凭据可重复读取，暂停时隐藏并拒绝读取。", "security": [{ "sessionCookie": [] }],
        "parameters": [{ "name": "sandboxClientId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^sbx_" } }],
        "responses": { "200": { "description": "当前有效凭据包，可在失效前重复读取", "headers": { "Cache-Control": { "schema": { "const": "no-store" } }, "Pragma": { "schema": { "const": "no-cache" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SandboxCredentialPack" } } } }, "401": { "$ref": "#/components/responses/SandboxCredentialError" }, "404": { "$ref": "#/components/responses/SandboxCredentialError" }, "409": { "$ref": "#/components/responses/SandboxCredentialError" }, "503": { "$ref": "#/components/responses/SandboxCredentialError" } }
      }
    },
    "/v1/developer/sandboxes/{sandboxClientId}/credentials/regenerate": {
      "post": {
        "tags": ["Sandbox"], "summary": "废止旧测试凭据并持久保存新凭据", "description": "同一轮换意图的网络重试必须复用原 request_id；重放返回交付状态，随后可通过 GET 读取当前有效凭据。", "security": [{ "sessionCookie": [] }],
        "parameters": [{ "name": "sandboxClientId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^sbx_" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SandboxRequestId" } } } },
        "responses": { "200": { "description": "相同请求重放；客户端再读取当前有效包", "headers": { "Cache-Control": { "schema": { "const": "no-store" } }, "Pragma": { "schema": { "const": "no-cache" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SandboxCredentialDeliveryReplay" } } } }, "201": { "description": "已加密持久保存的新凭据包", "headers": { "Cache-Control": { "schema": { "const": "no-store" } }, "Pragma": { "schema": { "const": "no-cache" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SandboxCredentialPack" } } } }, "401": { "$ref": "#/components/responses/SandboxCredentialError" }, "404": { "$ref": "#/components/responses/SandboxCredentialError" }, "409": { "$ref": "#/components/responses/SandboxCredentialError" }, "503": { "$ref": "#/components/responses/SandboxCredentialError" } }
      }
    },
    "/v1/developer/sandboxes/{sandboxClientId}/webhook": {
      "get": {
        "tags": ["Sandbox", "Webhooks"], "summary": "读取 Sandbox Webhook 配置", "security": [{ "sessionCookie": [] }],
        "parameters": [{ "name": "sandboxClientId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^sbx_" } }],
        "responses": { "200": { "description": "配置元数据，不返回 Secret；未配置时为 null", "content": { "application/json": { "schema": { "oneOf": [{ "$ref": "#/components/schemas/WebhookConfig" }, { "type": "null" }] } } } }, "401": { "$ref": "#/components/responses/AppError" }, "404": { "$ref": "#/components/responses/AppError" }, "409": { "$ref": "#/components/responses/AppError" }, "503": { "$ref": "#/components/responses/AppError" } }
      },
      "put": {
        "tags": ["Sandbox", "Webhooks"], "summary": "配置或轮换 Sandbox Webhook", "security": [{ "sessionCookie": [] }],
        "parameters": [{ "name": "sandboxClientId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^sbx_" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookConfigRequest" } } } },
        "responses": { "200": { "description": "配置元数据；Secret 仅在新建或轮换时返回", "headers": { "Cache-Control": { "schema": { "const": "no-store" } }, "Pragma": { "schema": { "const": "no-cache" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/WebhookConfig" } } } }, "400": { "$ref": "#/components/responses/AppError" }, "401": { "$ref": "#/components/responses/AppError" }, "404": { "$ref": "#/components/responses/AppError" }, "409": { "$ref": "#/components/responses/AppError" }, "503": { "$ref": "#/components/responses/AppError" } }
      }
    },
    "/v1/developer/sandboxes/{sandboxClientId}/production-applications": {
      "post": {
        "tags": ["Sandbox", "Client Management"], "summary": "由已完成联调的 Sandbox 快照创建正式 pending Client", "description": "仅 Sandbox active 且 basic_integration_completed=true 时可提交。同一申请意图的网络重试必须复用原 request_id。只复制不可变的公开应用配置；测试用户、凭据、Webhook、模型、支付和日志绝不迁移。未完成联调返回 409 sandbox_integration_incomplete。", "security": [{ "sessionCookie": [] }],
        "parameters": [{ "name": "sandboxClientId", "in": "path", "required": true, "schema": { "type": "string", "pattern": "^sbx_" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SandboxRequestId" } } } },
        "responses": { "200": { "description": "相同申请重放", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SandboxProductionApplication" } } } }, "201": { "description": "已创建既有 pending Client", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/SandboxProductionApplication" } } } }, "401": { "$ref": "#/components/responses/AppError" }, "403": { "$ref": "#/components/responses/AppError" }, "404": { "$ref": "#/components/responses/AppError" }, "409": { "$ref": "#/components/responses/AppError" } }
      }
    },
    "/v1/models/{modelId}/invoke": {
      "post": {
        "tags": ["Models"],
        "summary": "幂等调用模型网关",
        "description": "平台内部完成内容安全、积分预扣、开发者信用预占以及确认或释放。相同幂等键必须对应相同请求体。",
        "security": [{ "oauthAccessToken": [] }],
        "parameters": [{ "name": "modelId", "in": "path", "required": true, "description": "模型目录返回的稳定 model_key", "schema": { "type": "string" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InvokeRequest" } } } },
        "responses": {
          "200": { "description": "已收敛的网关结果；provider_unknown 表示已进入人工核对", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InvokeResult" } } } },
          "400": { "$ref": "#/components/responses/AppError" },
          "402": { "$ref": "#/components/responses/AppError" },
          "403": { "$ref": "#/components/responses/AppError" },
          "409": { "$ref": "#/components/responses/AppError" },
          "413": { "$ref": "#/components/responses/AppError" },
          "422": { "$ref": "#/components/responses/AppError" },
          "429": { "$ref": "#/components/responses/AppError" },
          "503": { "$ref": "#/components/responses/AppError" }
        }
      }
    },
    "/v1/developer/api-keys": {
      "get": {
        "tags": ["Developer API Key"],
        "summary": "分页读取本人 API Key",
        "description": "只返回脱敏元数据、绑定 Client、Scope、交付和到期状态，不返回完整明文或哈希。",
        "security": [{ "sessionCookie": [] }],
        "parameters": [
          { "name": "client_id", "in": "query", "schema": { "type": "string", "maxLength": 64 } },
          { "name": "page", "in": "query", "schema": { "type": "integer", "minimum": 1, "default": 1 } },
          { "name": "page_size", "in": "query", "schema": { "type": "integer", "minimum": 1, "maximum": 100, "default": 20 } }
        ],
        "responses": {
          "200": { "description": "API Key 分页", "headers": { "Cache-Control": { "schema": { "const": "no-store" } }, "Pragma": { "schema": { "const": "no-cache" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeveloperApiKeyPage" } } } },
          "400": { "$ref": "#/components/responses/AppError" },
          "401": { "$ref": "#/components/responses/AppError" },
          "403": { "$ref": "#/components/responses/AppError" },
          "503": { "$ref": "#/components/responses/AppError" }
        }
      },
      "post": {
        "tags": ["Developer API Key"],
        "summary": "创建绑定 Client 的 API Key",
        "description": "首次 201 只返回一次完整明文，初始状态为 delivery_pending；保存后必须调用 confirm-delivery 激活。相同创建意图重放不再返回明文。",
        "security": [{ "sessionCookie": [] }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/CreateDeveloperApiKeyRequest" } } } },
        "responses": {
          "200": { "description": "相同创建意图重放，无 api_key", "headers": { "Cache-Control": { "schema": { "const": "no-store" } }, "Pragma": { "schema": { "const": "no-cache" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeveloperApiKeyCreateResponse" } } } },
          "201": { "description": "首次创建，api_key 仅本次返回", "headers": { "Cache-Control": { "schema": { "const": "no-store" } }, "Pragma": { "schema": { "const": "no-cache" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeveloperApiKeyCreateResponse" } } } },
          "400": { "$ref": "#/components/responses/AppError" },
          "401": { "$ref": "#/components/responses/AppError" },
          "403": { "$ref": "#/components/responses/AppError" },
          "404": { "$ref": "#/components/responses/AppError" },
          "409": { "$ref": "#/components/responses/AppError" },
          "503": { "$ref": "#/components/responses/AppError" }
        }
      }
    },
    "/v1/developer/api-keys/{id}/confirm-delivery": {
      "post": {
        "tags": ["Developer API Key"],
        "summary": "确认一次性明文已安全保存",
        "description": "未过期 delivery_pending Key 幂等激活；响应永不返回完整明文。",
        "security": [{ "sessionCookie": [] }],
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/BigIntString" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false } } } },
        "responses": {
          "200": { "description": "确认结果", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeveloperApiKeyDeliveryResult" } } } },
          "400": { "$ref": "#/components/responses/AppError" },
          "401": { "$ref": "#/components/responses/AppError" },
          "403": { "$ref": "#/components/responses/AppError" },
          "404": { "$ref": "#/components/responses/AppError" },
          "409": { "$ref": "#/components/responses/AppError" },
          "503": { "$ref": "#/components/responses/AppError" }
        }
      }
    },
    "/v1/developer/api-keys/{id}/revoke": {
      "post": {
        "tags": ["Developer API Key"],
        "summary": "幂等吊销本人 API Key",
        "security": [{ "sessionCookie": [] }],
        "parameters": [{ "name": "id", "in": "path", "required": true, "schema": { "$ref": "#/components/schemas/BigIntString" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false } } } },
        "responses": {
          "200": { "description": "吊销结果", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeveloperApiKeyRevokeResult" } } } },
          "400": { "$ref": "#/components/responses/AppError" },
          "401": { "$ref": "#/components/responses/AppError" },
          "403": { "$ref": "#/components/responses/AppError" },
          "404": { "$ref": "#/components/responses/AppError" }
        }
      }
    },
    "/v1/developer/models/{modelKey}/invoke": {
      "post": {
        "tags": ["Developer API Key", "Models"],
        "summary": "使用开发者 API Key 幂等调用模型",
        "description": "从唯一 X-API-Key 识别开发者与绑定 Client，以开发者本人作为积分账户。client_id 省略时仍使用 Key 绑定值；若携带则只作一致性断言，不能切换 Client。平台内部完成内容安全、积分预扣、开发者信用预占以及确认或释放。",
        "security": [{ "developerApiKey": [] }],
        "parameters": [{ "name": "modelKey", "in": "path", "required": true, "schema": { "type": "string" } }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/DeveloperInvokeRequest" } } } },
        "responses": {
          "200": { "description": "已收敛的网关结果；provider_unknown 表示已进入人工核对", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/InvokeResult" } } } },
          "400": { "$ref": "#/components/responses/AppError" },
          "401": { "$ref": "#/components/responses/AppError" },
          "402": { "$ref": "#/components/responses/AppError" },
          "403": { "$ref": "#/components/responses/AppError" },
          "404": { "$ref": "#/components/responses/AppError" },
          "409": { "$ref": "#/components/responses/AppError" },
          "413": { "$ref": "#/components/responses/AppError" },
          "422": { "$ref": "#/components/responses/AppError" },
          "429": { "$ref": "#/components/responses/AppError" },
          "503": { "$ref": "#/components/responses/AppError" }
        }
      }
    },
    "/v1/admin/clients/{clientId}/environments": {
      "get": {
        "tags": ["Admin Clients"],
        "summary": "读取应用的正式与测试环境脱敏元数据",
        "description": "需要 client.view。只返回环境、配置和凭据交付状态；不返回 Secret 明文、哈希、可逆密文、API Key 或测试账号密码。纯 Sandbox 应用仍不进入正式 Client 列表。",
        "security": [{ "sessionCookie": [] }],
        "parameters": [
          { "name": "clientId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }
        ],
        "responses": {
          "200": {
            "description": "双环境脱敏元数据",
            "headers": {
              "Cache-Control": { "schema": { "type": "string", "const": "no-store" } },
              "Pragma": { "schema": { "type": "string", "const": "no-cache" } }
            },
            "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AdminClientEnvironments" } } }
          },
          "401": { "$ref": "#/components/responses/AppError" },
          "403": { "$ref": "#/components/responses/AppError" },
          "404": { "$ref": "#/components/responses/AppError" }
        }
      }
    },
    "/v1/admin/clients/{clientId}/api-key-policy": {
      "patch": {
        "tags": ["Admin API Key"],
        "summary": "设置单个 Client 的 API Key 模型调用策略",
        "description": "需要同时具备 developer_api_key.policy 与 developer_api_key.view。仅 active Client 可设置；重复设置仍记录 changed=false 审计。Client 停用时策略自动关闭，重新启用不会自动恢复。",
        "security": [{ "sessionCookie": [] }],
        "parameters": [
          { "name": "clientId", "in": "path", "required": true, "schema": { "type": "string", "minLength": 1, "maxLength": 64 } }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": { "$ref": "#/components/schemas/ClientApiKeyPolicyRequest" }
            }
          }
        },
        "responses": {
          "200": { "description": "当前策略结果", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ClientApiKeyPolicyResult" } } } },
          "400": { "$ref": "#/components/responses/AppError" },
          "401": { "$ref": "#/components/responses/AppError" },
          "403": { "$ref": "#/components/responses/AppError" },
          "404": { "$ref": "#/components/responses/AppError" },
          "409": { "$ref": "#/components/responses/AppError" },
          "503": { "$ref": "#/components/responses/AppError" }
        }
      }
    },
    "/v1/points/reserve": {
      "post": {
        "tags": ["Points"],
        "summary": "通用积分预扣原语",
        "description": "普通模型调用应优先使用 /v1/models/{modelId}/invoke，不应自行编排三段式端点。",
        "security": [{ "oauthAccessToken": [] }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/ReserveRequest" } } } },
        "responses": {
          "200": { "$ref": "#/components/responses/Reservation" },
          "201": { "$ref": "#/components/responses/Reservation" },
          "400": { "$ref": "#/components/responses/AppError" },
          "402": { "$ref": "#/components/responses/AppError" },
          "409": { "$ref": "#/components/responses/AppError" }
        }
      }
    },
    "/v1/points/confirm": {
      "post": {
        "tags": ["Points"],
        "summary": "确认积分预扣",
        "security": [{ "oauthAccessToken": [] }],
        "requestBody": { "$ref": "#/components/requestBodies/IdempotencyKey" },
        "responses": { "200": { "$ref": "#/components/responses/Reservation" }, "409": { "$ref": "#/components/responses/AppError" } }
      }
    },
    "/v1/points/release": {
      "post": {
        "tags": ["Points"],
        "summary": "释放积分预扣",
        "security": [{ "oauthAccessToken": [] }],
        "requestBody": { "$ref": "#/components/requestBodies/IdempotencyKey" },
        "responses": { "200": { "$ref": "#/components/responses/Reservation" }, "409": { "$ref": "#/components/responses/AppError" } }
      }
    },
    "/v1/payments/recharge": {
      "post": {
        "tags": ["Payments"],
        "summary": "创建积分充值订单",
        "description": "生产支付必须由平台显式启用；订单归因取当前 Access Token 的 client_id，应用不得传入归属字段、自行伪造或调用支付回调。新接入推荐使用一次性 billing-entry 页面完成支付。",
        "security": [{ "oauthAccessToken": [] }],
        "requestBody": { "required": true, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/RechargeRequest" } } } },
        "responses": {
          "201": { "description": "充值订单", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/PaymentOrder" } } } },
          "400": { "$ref": "#/components/responses/AppError" },
          "401": { "$ref": "#/components/responses/AppError" },
          "503": { "$ref": "#/components/responses/AppError" }
        }
      }
    },
    "/v1/.well-known/jwks.json": {
      "get": {
        "tags": ["OAuth"],
        "summary": "读取 JWT 公钥集合",
        "responses": { "200": { "description": "JSON Web Key Set" } }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "oauthAccessToken": { "type": "http", "scheme": "bearer", "bearerFormat": "JWT", "description": "只接受 access_token，不接受 id_token" },
      "clientBasic": { "type": "http", "scheme": "basic", "description": "用户名为 client_id，密码为当前 Client Secret；轮换后旧 Secret 立即失效" },
      "developerApiKey": { "type": "apiKey", "in": "header", "name": "X-API-Key", "description": "在开发者中心创建并确认交付的 API Key，只用于 /v1/developer/models/*；明文只显示一次" },
      "sessionCookie": { "type": "apiKey", "in": "cookie", "name": "__Host-idp_session", "description": "平台首方登录 Session；写操作同时受可信浏览器来源校验" }
    },
    "schemas": {
      "BigIntString": { "type": "string", "pattern": "^[0-9]+$", "examples": ["100"] },
      "AuthorizationCodeGrant": {
        "type": "object",
        "additionalProperties": false,
        "required": ["grant_type", "code", "code_verifier", "redirect_uri", "client_id"],
        "properties": {
          "grant_type": { "const": "authorization_code" }, "code": { "type": "string" },
          "code_verifier": { "type": "string", "minLength": 43, "maxLength": 128 },
          "redirect_uri": { "type": "string", "format": "uri" }, "client_id": { "type": "string" }
        }
      },
      "RefreshTokenGrant": {
        "type": "object", "additionalProperties": false,
        "required": ["grant_type", "refresh_token", "client_id"],
        "properties": { "grant_type": { "const": "refresh_token" }, "refresh_token": { "type": "string" }, "client_id": { "type": "string" } }
      },
      "OAuthToken": {
        "type": "object", "required": ["access_token", "token_type", "expires_in", "refresh_token", "scope"],
        "properties": {
          "access_token": { "type": "string" }, "token_type": { "const": "Bearer" }, "expires_in": { "type": "integer" },
          "refresh_token": { "type": "string" }, "scope": { "type": "string" }, "id_token": { "type": "string" }
        }
      },
      "UserInfo": {
        "type": "object", "required": ["sub", "member_level"],
        "properties": { "sub": { "$ref": "#/components/schemas/PairwiseSubject" }, "phone_number": { "type": ["string", "null"], "description": "如有值则为脱敏手机号" }, "member_level": { "type": "integer", "minimum": 0, "maximum": 4 } }
      },
      "PairwiseSubject": { "type": "string", "pattern": "^usr_[A-Za-z0-9_-]+$", "description": "按 client_id 隔离的随机主体标识，不是平台用户 ID" },
      "MembershipSubscriptionView": {
        "type": "object",
        "required": ["id", "member_level", "status", "effective_at", "period_start_at", "period_end_at"],
        "properties": {
          "id": { "$ref": "#/components/schemas/BigIntString" },
          "member_level": { "type": "integer", "minimum": 0, "maximum": 4 },
          "status": { "enum": ["active", "scheduled"] },
          "effective_at": { "type": "string", "format": "date-time" },
          "period_start_at": { "type": "string", "format": "date-time" },
          "period_end_at": { "type": "string", "format": "date-time" }
        }
      },
      "MembershipPlanView": {
        "type": "object",
        "required": ["member_level", "name", "description", "monthly_points_included", "max_authorized_apps", "benefits"],
        "properties": {
          "member_level": { "type": "integer", "minimum": 0, "maximum": 4 },
          "name": { "type": "string" },
          "description": { "type": ["string", "null"] },
          "monthly_points_included": { "$ref": "#/components/schemas/BigIntString" },
          "max_authorized_apps": { "type": ["integer", "null"], "minimum": 0 },
          "benefits": { "type": "array", "items": { "type": "string" } }
        }
      },
      "MembershipDetails": {
        "type": "object",
        "required": ["member_level", "plan", "current_subscription", "scheduled_subscription"],
        "properties": {
          "member_level": { "type": "integer", "minimum": 0, "maximum": 4 },
          "plan": { "oneOf": [{ "$ref": "#/components/schemas/MembershipPlanView" }, { "type": "null" }] },
          "current_subscription": { "oneOf": [{ "$ref": "#/components/schemas/MembershipSubscriptionView" }, { "type": "null" }] },
          "scheduled_subscription": { "oneOf": [{ "$ref": "#/components/schemas/MembershipSubscriptionView" }, { "type": "null" }] }
        }
      },
      "WalletSummary": {
        "type": "object", "additionalProperties": false, "required": ["sub", "member_level", "wallet"],
        "properties": {
          "sub": { "$ref": "#/components/schemas/PairwiseSubject" },
          "member_level": { "type": "integer", "minimum": 0, "maximum": 4 },
          "wallet": {
            "type": "object", "additionalProperties": false, "required": ["balance", "frozen", "available", "updated_at"],
            "properties": {
              "balance": { "$ref": "#/components/schemas/BigIntString" },
              "frozen": { "$ref": "#/components/schemas/BigIntString" },
              "available": { "$ref": "#/components/schemas/BigIntString" },
              "updated_at": { "type": ["string", "null"], "format": "date-time" }
            }
          }
        }
      },
      "BillingEntryRequest": {
        "type": "object", "additionalProperties": false, "required": ["intent", "return_uri"],
        "properties": { "intent": { "enum": ["membership", "recharge"] }, "return_uri": { "type": "string", "format": "uri", "maxLength": 2048 } }
      },
      "BillingEntryCreateResult": {
        "type": "object", "additionalProperties": false, "required": ["entry_id", "billing_url", "expires_at"],
        "properties": {
          "entry_id": { "$ref": "#/components/schemas/BigIntString" },
          "billing_url": { "type": "string", "format": "uri", "description": "15 分钟有效的一次性不透明入口" },
          "expires_at": { "type": "string", "format": "date-time" }
        }
      },
      "BillingEntryStatus": {
        "type": "object", "additionalProperties": false, "required": ["id", "intent", "status", "expires_at", "payment_order"],
        "properties": {
          "id": { "$ref": "#/components/schemas/BigIntString" },
          "intent": { "enum": ["membership", "recharge"] },
          "status": { "enum": ["pending", "consumed", "expired"] },
          "expires_at": { "type": "string", "format": "date-time" },
          "payment_order": {
            "oneOf": [
              { "type": "null" },
              { "type": "object", "additionalProperties": false, "required": ["status", "paid_at", "refunded_at"], "properties": { "status": { "type": "string" }, "paid_at": { "type": ["string", "null"], "format": "date-time" }, "refunded_at": { "type": ["string", "null"], "format": "date-time" } } }
            ]
          }
        }
      },
      "ClientScope": {
        "type": "string",
        "enum": ["openid", "identity", "membership.read", "points.read", "points.spend", "billing.initiate"],
        "description": "openid=OIDC 登录身份；identity=基础身份；membership.read=会员等级；points.read=积分余额；points.spend=积分消费；billing.initiate=会员与充值入口"
      },
      "ClientApplicationRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["name", "redirect_uris", "billing_return_uris", "allowed_scopes", "min_member_level"],
        "properties": {
          "name": { "type": "string", "minLength": 1, "maxLength": 100 },
          "homepage_url": { "type": ["string", "null"], "format": "uri", "maxLength": 2048, "description": "AI 超市打开应用时使用的 HTTP(S) 首页或介绍页；不得包含 URL 账号密码信息" },
          "redirect_uris": { "type": "array", "minItems": 1, "maxItems": 20, "uniqueItems": true, "items": { "type": "string", "format": "uri", "maxLength": 2048 } },
          "billing_return_uris": { "type": "array", "maxItems": 20, "uniqueItems": true, "items": { "type": "string", "format": "uri", "maxLength": 2048 } },
          "allowed_scopes": { "type": "array", "minItems": 1, "maxItems": 20, "uniqueItems": true, "items": { "$ref": "#/components/schemas/ClientScope" } },
          "min_member_level": { "type": "integer", "minimum": 0, "maximum": 4 }
        }
      },
      "ClientApplication": {
        "type": "object",
        "additionalProperties": false,
        "required": ["client_id", "name", "homepage_url", "redirect_uris", "billing_return_uris", "allowed_scopes", "min_member_level", "status", "client_secret_masked", "created_at"],
        "properties": {
          "client_id": { "type": "string", "description": "稳定公开应用标识，可进入浏览器和 OAuth 请求" },
          "name": { "type": "string" },
          "homepage_url": { "type": ["string", "null"], "format": "uri" },
          "redirect_uris": { "type": "array", "items": { "type": "string", "format": "uri" } },
          "billing_return_uris": { "type": "array", "items": { "type": "string", "format": "uri" } },
          "allowed_scopes": { "type": "array", "items": { "$ref": "#/components/schemas/ClientScope" } },
          "min_member_level": { "type": "integer", "minimum": 0, "maximum": 4 },
          "status": { "enum": ["pending", "active", "disabled", "rejected"] },
          "reject_reason": { "type": ["string", "null"] },
          "client_secret_masked": { "type": ["string", "null"], "pattern": "^\\*{16}$", "description": "固定掩码仅表示 Secret 已配置；不包含明文、后缀或哈希" },
          "created_at": { "type": "string", "format": "date-time" }
        }
      },
      "ClientApplicationPage": {
        "type": "object",
        "additionalProperties": false,
        "required": ["items", "pagination"],
        "properties": {
          "items": { "type": "array", "items": { "$ref": "#/components/schemas/ClientApplication" } },
          "pagination": { "type": "object", "additionalProperties": false, "required": ["page", "page_size", "total", "total_pages"], "properties": { "page": { "type": "integer" }, "page_size": { "type": "integer" }, "total": { "type": "integer" }, "total_pages": { "type": "integer" } } }
        }
      },
      "SandboxConfiguration": {
        "type": "object", "additionalProperties": false,
        "required": ["name", "homepage_url", "redirect_uris", "billing_return_uris", "allowed_scopes", "min_member_level"],
        "properties": {
          "name": { "type": "string", "minLength": 1, "maxLength": 100 },
          "homepage_url": { "type": ["string", "null"], "format": "uri", "maxLength": 2048 },
          "redirect_uris": { "type": "array", "minItems": 1, "maxItems": 20, "items": { "type": "string", "format": "uri", "maxLength": 2048 } },
          "billing_return_uris": { "type": "array", "maxItems": 20, "items": { "type": "string", "format": "uri", "maxLength": 2048 } },
          "allowed_scopes": { "type": "array", "minItems": 1, "maxItems": 20, "uniqueItems": true, "items": { "$ref": "#/components/schemas/ClientScope" } },
          "min_member_level": { "type": "integer", "minimum": 0, "maximum": 4 }
        }
      },
      "SandboxRequestId": {
        "type": "object", "additionalProperties": false, "required": ["request_id"],
        "properties": { "request_id": { "type": "string", "format": "uuid" } }
      },
      "SandboxPauseRequest": {
        "type": "object", "additionalProperties": false, "required": ["request_id", "confirmed"],
        "properties": { "request_id": { "type": "string", "format": "uuid" }, "confirmed": { "const": true } }
      },
      "SandboxCreateRequest": {
        "oneOf": [
          { "type": "object", "additionalProperties": false, "required": ["request_id", "configuration"], "properties": { "request_id": { "type": "string", "format": "uuid" }, "configuration": { "$ref": "#/components/schemas/SandboxConfiguration" } } },
          { "type": "object", "additionalProperties": false, "required": ["request_id", "source_production_client_id"], "properties": { "request_id": { "type": "string", "format": "uuid" }, "source_production_client_id": { "type": "string", "minLength": 1, "maxLength": 64 } } }
        ]
      },
      "SandboxConfigurationUpdateRequest": {
        "type": "object", "additionalProperties": false, "required": ["request_id", "config_version", "configuration"],
        "properties": { "request_id": { "type": "string", "format": "uuid" }, "config_version": { "type": "integer", "minimum": 1 }, "configuration": { "$ref": "#/components/schemas/SandboxConfiguration" } }
      },
      "SandboxStatus": {
        "type": "object",
        "required": ["sandbox_client_id", "sandbox_status", "configuration", "config_version", "credentials_available", "first_successful_at", "last_successful_at", "basic_integration_completed", "provisioning", "production", "limits"],
        "properties": {
          "sandbox_client_id": { "type": "string", "pattern": "^sbx_" },
          "sandbox_status": { "enum": ["provisioning", "active", "paused", "provisioning_failed"] },
          "configuration": { "$ref": "#/components/schemas/SandboxConfiguration" },
          "config_version": { "type": "integer", "minimum": 1 },
          "credentials_available": { "type": "boolean" },
          "first_successful_at": { "type": ["string", "null"], "format": "date-time" },
          "last_successful_at": { "type": ["string", "null"], "format": "date-time" },
          "basic_integration_completed": { "type": "boolean" },
          "provisioning": { "type": ["object", "null"] },
          "production": { "oneOf": [{ "type": "null" }, { "type": "object", "required": ["client_id", "status"], "properties": { "client_id": { "type": "string" }, "status": { "enum": ["pending", "active", "disabled", "rejected"] } } }] },
          "limits": { "type": "object", "required": ["test_users", "daily_mock_calls", "webhook_events_per_minute", "pending_webhook_events"], "properties": { "test_users": { "const": 10 }, "daily_mock_calls": { "const": 200 }, "webhook_events_per_minute": { "const": 20 }, "pending_webhook_events": { "const": 100 } } }
        }
      },
      "SandboxPage": {
        "type": "object", "additionalProperties": false, "required": ["items", "pagination"],
        "properties": { "items": { "type": "array", "items": { "$ref": "#/components/schemas/SandboxStatus" } }, "pagination": { "type": "object" } }
      },
      "SandboxCredentialPack": {
        "type": "object", "additionalProperties": false, "required": ["sandbox_client_id", "client_secret", "test_accounts"],
        "properties": { "sandbox_client_id": { "type": "string", "pattern": "^sbx_" }, "client_secret": { "type": "string" }, "test_accounts": { "type": "array", "minItems": 10, "maxItems": 10, "items": { "type": "object", "additionalProperties": false, "required": ["username", "password", "member_level"], "properties": { "username": { "type": "string" }, "password": { "type": "string" }, "member_level": { "type": "integer", "minimum": 0, "maximum": 3 } } } } }
      },
      "SandboxCredentialDeliveryReplay": { "type": "object", "additionalProperties": false, "required": ["delivery_replay"], "properties": { "delivery_replay": { "const": true } } },
      "SandboxProductionApplication": {
        "type": "object", "additionalProperties": false, "required": ["production_client_id", "status", "snapshot_version", "created_at"],
        "properties": { "production_client_id": { "type": "string" }, "status": { "const": "pending" }, "snapshot_version": { "type": "integer", "minimum": 1 }, "created_at": { "type": "string", "format": "date-time" } }
      },
      "PublicApplication": {
        "type": "object",
        "additionalProperties": false,
        "required": ["client_id", "name", "homepage_url", "min_member_level", "created_at"],
        "properties": {
          "client_id": { "type": "string" },
          "name": { "type": "string" },
          "homepage_url": { "type": ["string", "null"], "format": "uri" },
          "min_member_level": { "type": "integer", "minimum": 0, "maximum": 4 },
          "created_at": { "type": "string", "format": "date-time" }
        }
      },
      "PublicApplicationPage": {
        "type": "object",
        "additionalProperties": false,
        "required": ["items", "pagination"],
        "properties": {
          "items": { "type": "array", "items": { "$ref": "#/components/schemas/PublicApplication" } },
          "pagination": { "type": "object", "additionalProperties": false, "required": ["page", "page_size", "total", "total_pages"], "properties": { "page": { "type": "integer" }, "page_size": { "type": "integer" }, "total": { "type": "integer" }, "total_pages": { "type": "integer" } } }
        }
      },
      "PublicModel": {
        "type": "object",
        "additionalProperties": false,
        "required": ["model_key", "model_name", "display_name", "model_description", "model_categories", "model_category"],
        "properties": {
          "model_key": { "type": "string", "maxLength": 64 },
          "model_name": { "type": "string", "maxLength": 100 },
          "display_name": { "type": "string", "maxLength": 100 },
          "model_description": { "type": ["string", "null"] },
          "model_categories": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "enum": ["chat", "image", "video", "speech", "embedding", "rerank", "other"] } },
          "model_category": { "enum": ["chat", "image", "video", "speech", "embedding", "rerank", "other"] }
        }
      },
      "PublicModelCatalog": {
        "type": "object",
        "additionalProperties": false,
        "required": ["items"],
        "properties": {
          "items": { "type": "array", "items": { "$ref": "#/components/schemas/PublicModel" } }
        }
      },
      "PublicModelPrice": {
        "type": "object",
        "additionalProperties": false,
        "required": ["model_key", "model_name", "display_name", "model_description", "model_categories", "model_category", "billing_unit", "default_points_per_call"],
        "properties": {
          "model_key": { "type": "string", "maxLength": 64 },
          "model_name": { "type": "string", "maxLength": 100 },
          "display_name": { "type": "string", "maxLength": 100 },
          "model_description": { "type": ["string", "null"] },
          "model_categories": { "type": "array", "minItems": 1, "uniqueItems": true, "items": { "enum": ["chat", "image", "video", "speech", "embedding", "rerank", "other"] } },
          "model_category": { "enum": ["chat", "image", "video", "speech", "embedding", "rerank", "other"] },
          "billing_unit": { "type": "string", "const": "per_call" },
          "default_points_per_call": { "type": "string", "pattern": "^[1-9][0-9]*$" }
        }
      },
      "PublicModelPricingCatalog": {
        "type": "object",
        "additionalProperties": false,
        "required": ["billing_currency", "points_to_cny_rate", "items"],
        "properties": {
          "billing_currency": { "type": "string", "const": "CNY" },
          "points_to_cny_rate": { "type": "string", "pattern": "^[0-9]+(?:\\.[0-9]+)?$" },
          "items": { "type": "array", "items": { "$ref": "#/components/schemas/PublicModelPrice" } }
        }
      },
      "ClientConfigUpdateRequest": {
        "type": "object",
        "additionalProperties": false,
        "minProperties": 1,
        "properties": {
          "name": { "type": "string", "minLength": 1, "maxLength": 100 },
          "homepage_url": { "type": ["string", "null"], "format": "uri", "maxLength": 2048, "description": "显式 null 清空；active 应用变更后重新审核" },
          "redirect_uris": { "type": "array", "minItems": 1, "maxItems": 20, "uniqueItems": true, "items": { "type": "string", "format": "uri", "maxLength": 2048 } },
          "billing_return_uris": { "type": "array", "maxItems": 20, "uniqueItems": true, "items": { "type": "string", "format": "uri", "maxLength": 2048 } },
          "allowed_scopes": { "type": "array", "minItems": 1, "maxItems": 20, "uniqueItems": true, "items": { "$ref": "#/components/schemas/ClientScope" } },
          "min_member_level": { "type": "integer", "minimum": 0, "maximum": 4 }
        }
      },
      "ClientConfigUpdate": {
        "type": "object",
        "additionalProperties": false,
        "required": ["client_id", "name", "homepage_url", "redirect_uris", "billing_return_uris", "allowed_scopes", "min_member_level", "status", "client_secret_masked", "reapproval_required"],
        "properties": {
          "client_id": { "type": "string" },
          "name": { "type": "string" },
          "homepage_url": { "type": ["string", "null"], "format": "uri" },
          "redirect_uris": { "type": "array", "items": { "type": "string", "format": "uri" } },
          "billing_return_uris": { "type": "array", "items": { "type": "string", "format": "uri" } },
          "allowed_scopes": { "type": "array", "items": { "$ref": "#/components/schemas/ClientScope" } },
          "min_member_level": { "type": "integer", "minimum": 0, "maximum": 4 },
          "status": { "enum": ["pending", "active", "disabled", "rejected"] },
          "client_secret_masked": { "type": ["string", "null"], "pattern": "^\\*{16}$" },
          "reapproval_required": { "type": "boolean" }
        }
      },
      "ClientSecretResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": ["client_secret"],
        "properties": { "client_secret": { "type": "string", "description": "仅本次响应出现的完整明文" } }
      },
      "WebhookConfigRequest": {
        "type": "object", "additionalProperties": false, "required": ["url"],
        "properties": { "url": { "type": "string", "format": "uri", "maxLength": 2048 }, "enabled": { "type": "boolean", "default": true }, "rotate_secret": { "type": "boolean", "default": false } }
      },
      "WebhookConfig": {
        "type": "object", "additionalProperties": false, "required": ["client_id", "url", "enabled", "version", "updated_at"],
        "properties": {
          "client_id": { "type": "string" }, "url": { "type": "string", "format": "uri" }, "enabled": { "type": "boolean" }, "version": { "type": "integer", "minimum": 1 },
          "updated_at": { "type": "string", "format": "date-time" }, "webhook_secret": { "type": ["string", "null"], "description": "仅在新建或主动轮换的 PUT 响应中返回一次" }
        }
      },
      "InvokeRequest": {
        "type": "object", "additionalProperties": false, "required": ["idempotency_key", "input"],
        "properties": { "idempotency_key": { "type": "string", "minLength": 1, "maxLength": 128 }, "input": {} }
      },
      "DeveloperInvokeRequest": {
        "type": "object", "additionalProperties": false, "required": ["idempotency_key", "input"],
        "properties": {
          "client_id": { "type": "string", "minLength": 1, "maxLength": 64, "description": "可选兼容断言；若提供必须等于 API Key 唯一绑定的 Client" },
          "idempotency_key": { "type": "string", "minLength": 1, "maxLength": 128 },
          "input": {}
        }
      },
      "ClientApiKeyPolicyRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["enabled", "reason"],
        "properties": {
          "enabled": { "type": "boolean" },
          "reason": { "type": "string", "minLength": 1, "maxLength": 500 }
        }
      },
      "ClientApiKeyPolicyResult": {
        "type": "object",
        "additionalProperties": false,
        "required": ["client_id", "api_key_invoke_enabled"],
        "properties": {
          "client_id": { "type": "string" },
          "api_key_invoke_enabled": { "type": "boolean" }
        }
      },
      "AdminClientEnvironments": {
        "type": "object",
        "additionalProperties": false,
        "required": ["production", "sandbox"],
        "properties": {
          "production": {
            "type": "object",
            "additionalProperties": false,
            "required": ["client_id", "status", "client_secret_state"],
            "properties": {
              "client_id": { "type": "string" },
              "status": { "enum": ["pending", "active", "disabled", "rejected"] },
              "client_secret_state": { "enum": ["not_issued", "issued_hidden"] }
            }
          },
          "sandbox": {
            "oneOf": [
              { "type": "null" },
              {
                "type": "object",
                "additionalProperties": false,
                "required": ["sandbox_client_id", "sandbox_status", "configuration", "config_version", "credentials_state", "basic_integration_completed", "first_successful_at", "last_successful_at"],
                "properties": {
                  "sandbox_client_id": { "type": "string", "pattern": "^sbx_" },
                  "sandbox_status": { "enum": ["provisioning", "active", "paused", "provisioning_failed"] },
                  "configuration": { "$ref": "#/components/schemas/SandboxConfiguration" },
                  "config_version": { "type": "integer", "minimum": 1 },
                  "credentials_state": { "enum": ["not_issued", "pending_delivery", "issued_hidden", "runtime_unavailable"] },
                  "basic_integration_completed": { "type": "boolean" },
                  "first_successful_at": { "type": ["string", "null"], "format": "date-time" },
                  "last_successful_at": { "type": ["string", "null"], "format": "date-time" }
                }
              }
            ]
          }
        }
      },
      "CreateDeveloperApiKeyRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": ["name", "client_id", "create_request_id", "expires_in_days"],
        "properties": {
          "name": { "type": "string", "minLength": 1, "maxLength": 64 },
          "client_id": { "type": "string", "minLength": 1, "maxLength": 64 },
          "create_request_id": { "type": "string", "format": "uuid", "description": "UUIDv4；同一创建意图重试必须复用" },
          "expires_in_days": { "type": "integer", "enum": [30, 90, 180, 365] }
        }
      },
      "DeveloperApiKeyListItem": {
        "type": "object",
        "required": ["id", "name", "key_prefix", "client_id", "client_name", "scopes", "status", "effective_status", "last_used_at", "expires_at", "delivery_confirmed_at", "created_at", "revoked_at"],
        "properties": {
          "id": { "$ref": "#/components/schemas/BigIntString" },
          "name": { "type": "string" },
          "key_prefix": { "type": "string" },
          "client_id": { "type": ["string", "null"] },
          "client_name": { "type": ["string", "null"] },
          "scopes": { "type": "array", "items": { "const": "models.invoke" } },
          "status": { "enum": ["delivery_pending", "active", "revoked"] },
          "effective_status": { "enum": ["active", "expiring_soon", "expired", "revoked", "delivery_pending", "binding_required", "scope_invalid", "client_inactive", "invoke_disabled", "developer_inactive", "credit_misconfigured"] },
          "last_used_at": { "type": ["string", "null"], "format": "date-time" },
          "expires_at": { "type": ["string", "null"], "format": "date-time" },
          "delivery_confirmed_at": { "type": ["string", "null"], "format": "date-time" },
          "created_at": { "type": "string", "format": "date-time" },
          "revoked_at": { "type": ["string", "null"], "format": "date-time" }
        }
      },
      "DeveloperApiKeyPage": {
        "type": "object",
        "required": ["items", "pagination"],
        "properties": {
          "items": { "type": "array", "items": { "$ref": "#/components/schemas/DeveloperApiKeyListItem" } },
          "pagination": { "type": "object", "additionalProperties": false, "required": ["page", "page_size", "total", "total_pages"], "properties": { "page": { "type": "integer" }, "page_size": { "type": "integer" }, "total": { "type": "integer" }, "total_pages": { "type": "integer" } } }
        }
      },
      "DeveloperApiKeyCreateResponse": {
        "type": "object",
        "required": ["id", "name", "key_prefix", "client_id", "scopes", "status", "effective_status", "delivery_replay", "delivery_confirmed_at", "expires_at", "created_at"],
        "properties": {
          "id": { "$ref": "#/components/schemas/BigIntString" },
          "name": { "type": "string" },
          "key_prefix": { "type": "string" },
          "client_id": { "type": "string" },
          "scopes": { "type": "array", "items": { "const": "models.invoke" } },
          "status": { "enum": ["delivery_pending", "active"] },
          "effective_status": { "enum": ["delivery_pending", "active", "expiring_soon", "expired"] },
          "delivery_replay": { "type": "boolean" },
          "delivery_confirmed_at": { "type": ["string", "null"], "format": "date-time" },
          "expires_at": { "type": "string", "format": "date-time" },
          "created_at": { "type": "string", "format": "date-time" },
          "api_key": { "type": "string", "description": "仅首次 201 存在" }
        }
      },
      "DeveloperApiKeyDeliveryResult": {
        "type": "object", "additionalProperties": false,
        "required": ["id", "status", "effective_status", "delivery_confirmed_at", "changed"],
        "properties": { "id": { "$ref": "#/components/schemas/BigIntString" }, "status": { "const": "active" }, "effective_status": { "enum": ["active", "expiring_soon", "expired", "client_inactive", "invoke_disabled", "developer_inactive", "credit_misconfigured"] }, "delivery_confirmed_at": { "type": "string", "format": "date-time" }, "changed": { "type": "boolean" } }
      },
      "DeveloperApiKeyRevokeResult": {
        "type": "object", "additionalProperties": false,
        "required": ["id", "status", "revoked_at"],
        "properties": { "id": { "$ref": "#/components/schemas/BigIntString" }, "status": { "const": "revoked" }, "revoked_at": { "type": "string", "format": "date-time" } }
      },
      "InvokeResult": {
        "type": "object", "required": ["status", "request_id"],
        "properties": {
          "status": { "enum": ["success", "failed", "provider_unknown"] }, "request_id": { "type": "string" },
          "error_message": { "type": "string" }, "output": {}
        }
      },
      "ReserveRequest": {
        "type": "object", "additionalProperties": false, "required": ["idempotency_key", "points", "platform_cost_cents"],
        "properties": { "idempotency_key": { "type": "string", "maxLength": 128 }, "points": { "$ref": "#/components/schemas/BigIntString" }, "platform_cost_cents": { "$ref": "#/components/schemas/BigIntString" } }
      },
      "Reservation": {
        "type": "object", "required": ["id", "client_id", "sub", "idempotency_key", "points", "platform_cost_cents", "exchange_rate_snapshot", "status", "expires_at", "created_at", "updated_at"],
        "properties": {
          "id": { "$ref": "#/components/schemas/BigIntString" }, "client_id": { "type": "string" }, "sub": { "$ref": "#/components/schemas/PairwiseSubject" },
          "idempotency_key": { "type": "string" }, "points": { "$ref": "#/components/schemas/BigIntString" }, "platform_cost_cents": { "$ref": "#/components/schemas/BigIntString" },
          "exchange_rate_snapshot": { "type": "string" }, "status": { "type": "string" }, "expires_at": { "type": "string", "format": "date-time" },
          "created_at": { "type": "string", "format": "date-time" }, "updated_at": { "type": "string", "format": "date-time" }
        }
      },
      "RechargeRequest": {
        "type": "object", "additionalProperties": false, "required": ["channel", "cny_cents"],
        "properties": { "channel": { "enum": ["wechat", "alipay"] }, "cny_cents": { "$ref": "#/components/schemas/BigIntString" } }
      },
      "PaymentOrder": {
        "type": "object", "required": ["out_trade_no", "channel", "cny_cents", "points_to_credit", "exchange_rate_snapshot", "status", "created_at", "payment_url"],
        "properties": {
          "out_trade_no": { "type": "string" }, "channel": { "enum": ["wechat", "alipay"] }, "cny_cents": { "$ref": "#/components/schemas/BigIntString" },
          "points_to_credit": { "$ref": "#/components/schemas/BigIntString" }, "exchange_rate_snapshot": { "type": "string" }, "status": { "type": "string" },
          "created_at": { "type": "string", "format": "date-time" }, "paid_at": { "type": ["string", "null"], "format": "date-time" }, "payment_url": { "type": "string" }
        }
      },
      "AppError": {
        "type": "object", "required": ["error", "message"],
        "properties": { "error": { "type": "string" }, "message": { "type": "string" }, "details": {} }
      },
      "OAuthError": {
        "type": "object", "required": ["error"],
        "properties": { "error": { "type": "string" }, "error_description": { "type": "string" } }
      }
    },
    "requestBodies": {
      "IdempotencyKey": { "required": true, "content": { "application/json": { "schema": { "type": "object", "additionalProperties": false, "required": ["idempotency_key"], "properties": { "idempotency_key": { "type": "string", "maxLength": 128 } } } } } }
    },
    "responses": {
      "AppError": { "description": "应用错误", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AppError" } } } },
      "SandboxCredentialError": { "description": "Sandbox 凭据接口错误", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "no-store" } }, "Pragma": { "schema": { "type": "string", "const": "no-cache" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AppError" } } } },
      "MembershipAppError": { "description": "会员接口错误", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "no-store" } }, "Pragma": { "schema": { "type": "string", "const": "no-cache" } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AppError" } } } },
      "MembershipRateLimitError": { "description": "会员接口限流", "headers": { "Cache-Control": { "schema": { "type": "string", "const": "no-store" } }, "Pragma": { "schema": { "type": "string", "const": "no-cache" } }, "Retry-After": { "schema": { "type": "integer", "minimum": 1 } } }, "content": { "application/json": { "schema": { "$ref": "#/components/schemas/AppError" } } } },
      "OAuthError": { "description": "OAuth2/OIDC 协议错误", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/OAuthError" } } } },
      "Reservation": { "description": "积分预扣记录", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/Reservation" } } } }
    }
  }
}
