{
  "openapi": "3.1.0",
  "info": {
    "title": "人民币订阅模型网关",
    "description": "提供 OpenAI Responses、Chat Completions、模型查询与账户账单接口。金额以人民币十进制字符串返回。",
    "version": "0.1.0"
  },
  "paths": {
    "/v1/models": {
      "get": {
        "summary": "Models",
        "operationId": "models_v1_models_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Models"
                }
              }
            },
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            }
          },
          "400": {
            "description": "参数/能力不支持",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Key无效",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "余额不足或不足预留",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "账户/Key权限不足",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或不属于当前账户",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "幂等冲突/原请求/待核验",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "输入超过限制",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "并发或频率超限",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "模型响应异常",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "请求超时",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "GatewayKey": []
          }
        ]
      }
    },
    "/v1/responses": {
      "post": {
        "summary": "Responses",
        "operationId": "responses_v1_responses_post",
        "responses": {
          "200": {
            "description": "返回完整 JSON 或 SSE 流。流式请求须读取成功终态：Responses 为 response.completed；Chat 为 finish_reason，并以 [DONE] 结束。Responses 不发送 [DONE]。流中出现 error 事件或在成功终态前断开时，应按失败处理并查询账单。",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponsesResult"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "参数/能力不支持",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Key无效",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "余额不足或不足预留",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "账户/Key权限不足",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或不属于当前账户",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "幂等冲突/原请求/待核验",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "输入超过限制",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "并发或频率超限",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "模型响应异常",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "请求超时",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "GatewayKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResponsesRequest"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Allow-Fallback",
            "in": "header",
            "schema": {
              "enum": [
                "true",
                "false"
              ]
            },
            "description": "手动模型默认false；auto默认true，只沿候选链向后。工具续接禁止true。"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "ASCII；同账户至少24小时，不重放完整结果。重复请求409并返回原请求号。"
          }
        ]
      }
    },
    "/v1/chat/completions": {
      "post": {
        "summary": "Completions",
        "operationId": "completions_v1_chat_completions_post",
        "responses": {
          "200": {
            "description": "返回完整 JSON 或 SSE 流。流式请求须读取成功终态：Responses 为 response.completed；Chat 为 finish_reason，并以 [DONE] 结束。Responses 不发送 [DONE]。流中出现 error 事件或在成功终态前断开时，应按失败处理并查询账单。",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatResult"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "参数/能力不支持",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Key无效",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "余额不足或不足预留",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "账户/Key权限不足",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或不属于当前账户",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "幂等冲突/原请求/待核验",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "输入超过限制",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "并发或频率超限",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "模型响应异常",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "请求超时",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "GatewayKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatRequest"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "X-Allow-Fallback",
            "in": "header",
            "schema": {
              "enum": [
                "true",
                "false"
              ]
            },
            "description": "手动模型默认false；auto默认true，只沿候选链向后。工具续接禁止true。"
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            },
            "description": "ASCII；同账户至少24小时，不重放完整结果。重复请求409并返回原请求号。"
          }
        ]
      }
    },
    "/v1/messages/count_tokens": {
      "post": {
        "summary": "Anthropic",
        "operationId": "anthropic_v1_messages_count_tokens_post",
        "responses": {
          "400": {
            "description": "参数/能力不支持",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [],
        "description": "不支持 Anthropic 协议；返回 400 anthropic_not_supported。请使用 Responses 或 Chat Completions。"
      }
    },
    "/v1/messages": {
      "post": {
        "summary": "Anthropic",
        "operationId": "anthropic_v1_messages_post",
        "responses": {
          "400": {
            "description": "参数/能力不支持",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [],
        "description": "不支持 Anthropic 协议；返回 400 anthropic_not_supported。请使用 Responses 或 Chat Completions。"
      }
    },
    "/gateway/v1/account": {
      "get": {
        "summary": "Account",
        "operationId": "account_gateway_v1_account_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            },
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            }
          },
          "400": {
            "description": "参数/能力不支持",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Key无效",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "余额不足或不足预留",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "账户/Key权限不足",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或不属于当前账户",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "幂等冲突/原请求/待核验",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "输入超过限制",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "并发或频率超限",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "模型响应异常",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "请求超时",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "GatewayKey": []
          }
        ]
      }
    },
    "/gateway/v1/requests/{request_id}": {
      "get": {
        "summary": "Bill",
        "operationId": "bill_gateway_v1_requests__request_id__get",
        "parameters": [
          {
            "name": "request_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Request Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Bill"
                }
              }
            },
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            }
          },
          "400": {
            "description": "参数/能力不支持",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Key无效",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "余额不足或不足预留",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "账户/Key权限不足",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或不属于当前账户",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "幂等冲突/原请求/待核验",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "输入超过限制",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "并发或频率超限",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "模型响应异常",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "请求超时",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "GatewayKey": []
          }
        ]
      }
    },
    "/gateway/v1/transactions": {
      "get": {
        "summary": "Transactions",
        "operationId": "transactions_gateway_v1_transactions_get",
        "parameters": [
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Cursor"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "default": 50,
              "title": "Limit",
              "minimum": 1,
              "maximum": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Transactions"
                }
              }
            },
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            }
          },
          "400": {
            "description": "参数/能力不支持",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Key无效",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "余额不足或不足预留",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "账户/Key权限不足",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或不属于当前账户",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "幂等冲突/原请求/待核验",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "输入超过限制",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "并发或频率超限",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "模型响应异常",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "请求超时",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "GatewayKey": []
          }
        ]
      }
    },
    "/gateway/v1/usage": {
      "get": {
        "summary": "Usage",
        "operationId": "usage_gateway_v1_usage_get",
        "parameters": [
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "account",
                "key"
              ],
              "default": "account"
            }
          },
          {
            "name": "model",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Model"
            }
          },
          {
            "name": "group_by",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "model",
                "model,reasoning_effort"
              ],
              "default": "model"
            }
          },
          {
            "name": "from",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "from包含/to不含，须同时传入带时区时间，最大366天；省略默认上海本月。"
          },
          {
            "name": "to",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "from包含/to不含，须同时传入带时区时间，最大366天；省略默认上海本月。"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Usage"
                }
              }
            },
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            }
          },
          "400": {
            "description": "参数/能力不支持",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Key无效",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "余额不足或不足预留",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "账户/Key权限不足",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或不属于当前账户",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "幂等冲突/原请求/待核验",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "输入超过限制",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "并发或频率超限",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "模型响应异常",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "请求超时",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "GatewayKey": []
          }
        ]
      }
    },
    "/gateway/v1/prices": {
      "get": {
        "summary": "Prices",
        "operationId": "prices_gateway_v1_prices_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Pricing"
                }
              }
            },
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            }
          },
          "400": {
            "description": "参数/能力不支持",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Key无效",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "余额不足或不足预留",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "账户/Key权限不足",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或不属于当前账户",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "幂等冲突/原请求/待核验",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "输入超过限制",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "并发或频率超限",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "模型响应异常",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "请求超时",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "GatewayKey": []
          }
        ]
      }
    },
    "/gateway/v1/models/status": {
      "get": {
        "summary": "Status",
        "operationId": "status_gateway_v1_models_status_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthStatus"
                }
              }
            },
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            }
          },
          "400": {
            "description": "参数/能力不支持",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Key无效",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "余额不足或不足预留",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "账户/Key权限不足",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "不存在或不属于当前账户",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "幂等冲突/原请求/待核验",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "输入超过限制",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "并发或频率超限",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "模型响应异常",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务暂不可用",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              },
              "Retry-After": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "504": {
            "description": "请求超时",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "网关生成的请求号，用于查询账单。"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "GatewayKey": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "CNY": {
        "type": "string",
        "pattern": "^-?\\d+\\.\\d{12}$",
        "example": "0.002037000000"
      },
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "code": {
                "type": "string"
              },
              "param": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "additionalProperties": false,
            "required": [
              "message",
              "type",
              "code",
              "param"
            ]
          },
          "request_id": {
            "type": "string"
          },
          "details": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "additionalProperties": false,
        "required": [
          "error",
          "request_id"
        ]
      },
      "ResponsesInputImage": {
        "type": "object",
        "properties": {
          "type": {
            "const": "input_image"
          },
          "image_url": {
            "oneOf": [
              {
                "type": "string",
                "format": "uri",
                "maxLength": 8192,
                "pattern": "^[Hh][Tt][Tt][Pp][Ss]://",
                "description": "公开可访问的 HTTPS 图片地址，不允许用户名、密码、空白或控制字符。"
              },
              {
                "type": "string",
                "pattern": "^data:image/(png|jpeg|webp|gif);base64,[A-Za-z0-9+/]+={0,2}$",
                "description": "严格 Base64 data URL；MIME 类型须匹配文件。解码后单图最多 4 MiB，所有内嵌图片合计最多 8 MiB。"
              }
            ],
            "description": "HTTPS 地址或 Base64 data URL。支持 PNG、JPEG、WebP 和单帧 GIF。"
          },
          "detail": {
            "type": "string",
            "enum": [
              "auto",
              "low",
              "high"
            ],
            "default": "auto",
            "description": "图片细节等级。各模型在不同 detail 下的图片数量上限见价格接口的 images。"
          }
        },
        "additionalProperties": false,
        "required": [
          "type",
          "image_url"
        ],
        "description": "只能放在 user 消息的 content 数组中，可与 input_text 混合。"
      },
      "ChatInputImage": {
        "type": "object",
        "properties": {
          "type": {
            "const": "image_url"
          },
          "image_url": {
            "type": "object",
            "properties": {
              "url": {
                "oneOf": [
                  {
                    "type": "string",
                    "format": "uri",
                    "maxLength": 8192,
                    "pattern": "^[Hh][Tt][Tt][Pp][Ss]://",
                    "description": "公开可访问的 HTTPS 图片地址，不允许用户名、密码、空白或控制字符。"
                  },
                  {
                    "type": "string",
                    "pattern": "^data:image/(png|jpeg|webp|gif);base64,[A-Za-z0-9+/]+={0,2}$",
                    "description": "严格 Base64 data URL；MIME 类型须匹配文件。解码后单图最多 4 MiB，所有内嵌图片合计最多 8 MiB。"
                  }
                ],
                "description": "HTTPS 地址或 Base64 data URL。支持 PNG、JPEG、WebP 和单帧 GIF。"
              },
              "detail": {
                "type": "string",
                "enum": [
                  "auto",
                  "low",
                  "high"
                ],
                "default": "auto",
                "description": "图片细节等级。各模型在不同 detail 下的图片数量上限见价格接口的 images。"
              }
            },
            "additionalProperties": false,
            "required": [
              "url"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "type",
          "image_url"
        ],
        "description": "只能放在 user 消息的 content 数组中，可与 text 混合。"
      },
      "ResponsesInputMessage": {
        "type": "object",
        "properties": {
          "type": {
            "const": "message"
          },
          "id": {
            "type": "string"
          },
          "role": {
            "enum": [
              "system",
              "developer",
              "user",
              "assistant"
            ]
          },
          "status": {
            "enum": [
              "completed",
              null
            ]
          },
          "phase": {
            "type": "string"
          },
          "content": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "minItems": 1,
                "items": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "enum": [
                            "input_text",
                            "output_text"
                          ]
                        },
                        "text": {
                          "type": "string"
                        },
                        "annotations": {
                          "type": "array"
                        },
                        "logprobs": {
                          "type": "array"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "text"
                      ],
                      "description": "user/system/developer 使用 input_text；助手历史还可使用 output_text。"
                    },
                    {
                      "$ref": "#/components/schemas/ResponsesInputImage"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "const": "refusal"
                        },
                        "refusal": {
                          "type": "string"
                        }
                      },
                      "additionalProperties": false,
                      "required": [
                        "type",
                        "refusal"
                      ],
                      "description": "仅用于助手拒绝回答的历史内容。"
                    }
                  ]
                }
              }
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "role",
          "content"
        ],
        "description": "图片仅用于 user 消息。message 的 type 可省略；续接时保留历史内容。"
      },
      "ResponsesRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "default": "auto",
            "minLength": 1
          },
          "stream": {
            "type": "boolean",
            "default": false
          },
          "store": {
            "const": false
          },
          "parallel_tool_calls": {
            "type": "boolean"
          },
          "input": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "minItems": 1,
                "maxItems": 128,
                "items": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ResponsesInputMessage"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "enum": [
                            "function_call",
                            "function_call_output",
                            "reasoning"
                          ]
                        }
                      },
                      "additionalProperties": true,
                      "required": [
                        "type"
                      ],
                      "description": "完整函数调用、函数结果或 reasoning 历史项；各类型的字段见接口历史项说明。"
                    }
                  ]
                }
              }
            ]
          },
          "instructions": {
            "type": "string"
          },
          "reasoning": {
            "type": "object",
            "properties": {
              "effort": {
                "type": "string",
                "enum": [
                  "none",
                  "minimal",
                  "low",
                  "medium",
                  "high",
                  "xhigh",
                  "max"
                ],
                "description": "默认 medium；各模型可用值见 /gateway/v1/prices 的 supported_reasoning_efforts。"
              }
            },
            "additionalProperties": false
          },
          "include": {
            "type": "array",
            "items": {
              "const": "reasoning.encrypted_content"
            }
          },
          "tools": {
            "type": "array",
            "maxItems": 128,
            "items": {
              "type": "object",
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,64}$"
                },
                "description": {
                  "type": "string"
                },
                "parameters": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "根 type 必须是 object 的 JSON Schema。"
                },
                "strict": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "type": {
                  "const": "function"
                }
              },
              "additionalProperties": false,
              "required": [
                "name",
                "type"
              ]
            }
          },
          "tool_choice": {
            "type": "string",
            "enum": [
              "auto",
              "none",
              "required"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "input"
        ],
        "description": "支持文本、user 图片和客户端函数工具。正文最多 12 MiB；完整输入规范化后的紧凑 JSON，gpt-6-astra 纯文本最多 8 MiB，其他模型最多 32768 字节（32 KiB），包含历史、指令、工具定义与结果。Astra 文本上下文窗口为 872000 Token，输入、输出和推理合计占用；字节限制与 Token 窗口分别计算。图片请求除图片地址/编码外，其余输入最多 32768 个 UTF-8 字节。图片按完整请求历史合计，最多 4 张，实际数量还取决于模型和 detail；detail 默认为 auto，此等级最多 1 张。工具续接须指定上一响应的 model，并关闭降级。"
      },
      "ChatRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "default": "auto",
            "minLength": 1
          },
          "stream": {
            "type": "boolean",
            "default": false
          },
          "store": {
            "const": false
          },
          "parallel_tool_calls": {
            "type": "boolean"
          },
          "messages": {
            "type": "array",
            "minItems": 1,
            "maxItems": 128,
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "enum": [
                    "system",
                    "developer",
                    "user",
                    "assistant",
                    "tool"
                  ]
                },
                "content": {
                  "oneOf": [
                    {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    {
                      "type": "array",
                      "minItems": 1,
                      "items": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "type": {
                                "const": "text"
                              },
                              "text": {
                                "type": "string"
                              },
                              "annotations": {
                                "type": "array",
                                "maxItems": 0,
                                "description": "助手历史文本块可附带空数组。"
                              }
                            },
                            "additionalProperties": false,
                            "required": [
                              "type",
                              "text"
                            ]
                          },
                          {
                            "$ref": "#/components/schemas/ChatInputImage"
                          }
                        ]
                      }
                    }
                  ],
                  "description": "文本或内容块数组；图片块仅能出现在 user 消息中。只含工具调用的助手回复可为 null。"
                },
                "refusal": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "agent": {
                  "type": "string",
                  "maxLength": 256,
                  "description": "可选客户端代理标签，UTF-8 编码最多 256 字节；不作为模型输入。"
                },
                "conversationRequestId": {
                  "type": "string",
                  "maxLength": 256,
                  "description": "可选客户端请求标识，UTF-8 编码最多 256 字节；不作为模型输入。"
                },
                "startsNewUserRequest": {
                  "type": "boolean",
                  "description": "可选客户端标记，表示新的用户请求；不作为模型输入。"
                },
                "tool_call_id": {
                  "type": "string"
                },
                "tool_calls": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "type": {
                        "const": "function"
                      },
                      "function": {
                        "type": "object",
                        "properties": {
                          "name": {
                            "type": "string"
                          },
                          "arguments": {
                            "type": "string"
                          }
                        },
                        "additionalProperties": false,
                        "required": [
                          "name",
                          "arguments"
                        ]
                      }
                    },
                    "additionalProperties": false,
                    "required": [
                      "id",
                      "type",
                      "function"
                    ]
                  }
                },
                "messageId": {
                  "type": "string",
                  "maxLength": 256,
                  "description": "客户端消息标识；仅用于 assistant/tool 消息，UTF-8 最多 256 字节。"
                },
                "model": {
                  "type": "string",
                  "maxLength": 256,
                  "description": "客户端记录的模型名；仅用于 assistant/tool 消息，UTF-8 最多 256 字节。"
                },
                "requestModelId": {
                  "type": "string",
                  "maxLength": 256,
                  "description": "客户端模型标识；仅用于 assistant/tool 消息，UTF-8 最多 256 字节。"
                },
                "requestModelName": {
                  "type": "string",
                  "maxLength": 256,
                  "description": "客户端模型显示名；仅用于 assistant/tool 消息，UTF-8 最多 256 字节。"
                },
                "traceId": {
                  "type": "string",
                  "maxLength": 256,
                  "description": "客户端跟踪标识；仅用于 assistant/tool 消息，UTF-8 最多 256 字节。"
                },
                "stepSeq": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 2147483647,
                  "description": "assistant/tool 消息的客户端步骤编号。"
                },
                "usage": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "assistant/tool 消息的客户端用量记录，最多 4096 UTF-8 字节；账单以模型响应的实际用量为准。"
                },
                "rawUsage": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "assistant/tool 消息的客户端用量记录，最多 4096 UTF-8 字节；账单以模型响应的实际用量为准。"
                },
                "argumentsDisplayText": {
                  "type": [
                    "string",
                    "number",
                    "boolean",
                    "null"
                  ],
                  "description": "助手消息的参数显示值；字符串最多 4096 UTF-8 字节。"
                },
                "toolResult": {
                  "type": "object",
                  "additionalProperties": true,
                  "description": "工具消息的客户端显示数据，最多 32768 UTF-8 字节；发送给模型的结果仍填写 content。"
                }
              },
              "additionalProperties": false,
              "required": [
                "role"
              ]
            }
          },
          "reasoning_effort": {
            "type": "string",
            "enum": [
              "none",
              "minimal",
              "low",
              "medium",
              "high",
              "xhigh",
              "max"
            ],
            "description": "默认 medium；各模型可用值见 /gateway/v1/prices 的 supported_reasoning_efforts。"
          },
          "n": {
            "type": "integer",
            "const": 1
          },
          "stream_options": {
            "type": "object",
            "properties": {
              "include_usage": {
                "type": "boolean",
                "default": false
              }
            },
            "additionalProperties": false,
            "description": "仅与 stream:true 同时使用。"
          },
          "tools": {
            "type": "array",
            "maxItems": 128,
            "items": {
              "type": "object",
              "properties": {
                "type": {
                  "const": "function"
                },
                "function": {
                  "type": "object",
                  "properties": {
                    "name": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,64}$"
                    },
                    "description": {
                      "type": "string"
                    },
                    "parameters": {
                      "type": "object",
                      "additionalProperties": true,
                      "description": "根 type 必须是 object 的 JSON Schema。"
                    },
                    "strict": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    }
                  },
                  "additionalProperties": false,
                  "required": [
                    "name"
                  ]
                }
              },
              "additionalProperties": false,
              "required": [
                "type",
                "function"
              ]
            }
          },
          "tool_choice": {
            "type": "string",
            "enum": [
              "auto",
              "none",
              "required"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "messages"
        ],
        "description": "支持文本、user 图片和客户端函数工具。图片内容块为 image_url，对象内填写 url 和可选 detail。工具续接须在同一账户 15 分钟内完成；上下文失效时返回 tool_context_missing。图片格式、正文大小、图数及非图片内容限制同 Responses；不支持 max_tokens 等输出上限参数。"
      },
      "UsageTotals": {
        "type": "object",
        "properties": {
          "input_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "cached_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "cache_write_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "ordinary_input_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "output_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "total_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "reasoning_tokens": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "requests": {
            "type": "integer",
            "minimum": 0
          },
          "model": {
            "type": [
              "string",
              "null"
            ]
          },
          "reasoning_effort": {
            "type": [
              "string",
              "null"
            ]
          },
          "charged_cny": {
            "$ref": "#/components/schemas/CNY"
          },
          "refunded_cny": {
            "$ref": "#/components/schemas/CNY"
          },
          "operator_credit_cny": {
            "$ref": "#/components/schemas/CNY"
          }
        },
        "additionalProperties": false
      },
      "Usage": {
        "type": "object",
        "properties": {
          "currency": {
            "const": "CNY"
          },
          "scope": {
            "enum": [
              "account",
              "key"
            ]
          },
          "from": {
            "type": [
              "string",
              "null"
            ]
          },
          "to": {
            "type": [
              "string",
              "null"
            ]
          },
          "total": {
            "$ref": "#/components/schemas/UsageTotals"
          },
          "models": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UsageTotals"
            }
          },
          "pending_requests": {
            "type": "integer",
            "minimum": 0
          },
          "unbilled_known_usage": {
            "$ref": "#/components/schemas/UsageTotals"
          },
          "unknown_usage_requests": {
            "type": "integer",
            "minimum": 0
          }
        },
        "additionalProperties": false
      },
      "Account": {
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string"
          },
          "name": {
            "type": "string",
            "description": "账户展示名称。"
          },
          "currency": {
            "const": "CNY"
          },
          "status": {
            "enum": [
              "active",
              "disabled"
            ]
          },
          "balance_total": {
            "$ref": "#/components/schemas/CNY"
          },
          "reserved_total": {
            "$ref": "#/components/schemas/CNY"
          },
          "balance_available": {
            "$ref": "#/components/schemas/CNY"
          },
          "total_recharged": {
            "$ref": "#/components/schemas/CNY"
          },
          "total_charged": {
            "$ref": "#/components/schemas/CNY"
          },
          "total_refunded": {
            "$ref": "#/components/schemas/CNY"
          },
          "usage": {
            "$ref": "#/components/schemas/UsageTotals"
          },
          "pending_requests": {
            "type": "integer",
            "minimum": 0
          },
          "unbilled_known_usage": {
            "$ref": "#/components/schemas/UsageTotals"
          },
          "unknown_usage_requests": {
            "type": "integer",
            "minimum": 0
          },
          "as_of": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "Bill": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string"
          },
          "state": {
            "enum": [
              "reserved",
              "dispatching",
              "streaming",
              "upstream_completed",
              "settled",
              "billing_pending",
              "failed",
              "cancelled",
              "waived"
            ]
          },
          "requested_model": {
            "type": "string"
          },
          "routed_model": {
            "type": [
              "string",
              "null"
            ]
          },
          "served_model": {
            "type": [
              "string",
              "null"
            ]
          },
          "reasoning_effort": {
            "type": [
              "string",
              "null"
            ]
          },
          "usage": {
            "type": [
              "object",
              "null"
            ],
            "additionalProperties": true
          },
          "reserved_cny": {
            "$ref": "#/components/schemas/CNY"
          },
          "charged_cny": {
            "$ref": "#/components/schemas/CNY"
          },
          "refunded_cny": {
            "$ref": "#/components/schemas/CNY"
          },
          "pricing_version": {
            "type": "string"
          },
          "attempts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "model": {
                  "type": "string"
                },
                "dispatch_index": {
                  "type": "integer",
                  "minimum": 0,
                  "description": "本次请求内从1开始的派发序号。"
                },
                "served_model": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "response_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "error_class": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "status": {
                  "type": "integer"
                },
                "error_type": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "error_code": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "upstream_request_id": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "usage": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "additionalProperties": true
                }
              },
              "additionalProperties": true,
              "description": "本次请求各次模型调用的状态与用量。"
            }
          },
          "fallback_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "本次降级原因；未降级为 null。"
          },
          "client_protocol": {
            "enum": [
              "responses",
              "chat"
            ],
            "description": "请求使用的协议。"
          },
          "usage_source": {
            "type": [
              "string",
              "null"
            ],
            "description": "用量来自模型完整响应时为 upstream_terminal，否则 null。"
          },
          "context_tier": {
            "enum": [
              "short",
              "long"
            ],
            "description": "本次请求的价格档位；支持长上下文分档计费的模型返回。"
          },
          "discount_multiplier": {
            "type": "string",
            "description": "准入锁定的折扣乘数，0.01 表示 0.1 折。"
          },
          "usd_to_cny": {
            "type": "string",
            "description": "准入锁定的 USD:CNY 换算倍率。"
          },
          "fx_source": {
            "const": "operator_fixed"
          },
          "upstream_response_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "上游响应标识；不等于网关查账 request_id。"
          },
          "upstream_request_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "用于上游故障排查的请求标识。"
          },
          "refunds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Transaction"
            },
            "description": "此请求的退款流水。"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "失败或待核验原因；结算成功通常为 null。"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "completed_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "pending_since": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "pricing_effective_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "已结算时可能返回的价目生效时间。"
          },
          "reference_usd": {
            "type": "string",
            "description": "四类 Token 按参考 USD 单价计算的折扣前金额。"
          },
          "calculated_cny": {
            "$ref": "#/components/schemas/CNY",
            "description": "完整用量按锁定价目计算的人民币金额。"
          },
          "calculated_units": {
            "type": "integer",
            "minimum": 0,
            "description": "calculated_cny 对应的整数账本单位，1 单位 = 10^-12 元。"
          },
          "operator_credit_cny": {
            "$ref": "#/components/schemas/CNY",
            "description": "计算金额超过预留时由服务承担的差额，不从账户余额扣除。"
          },
          "official_usd_per_million": {
            "type": "object",
            "properties": {
              "ordinary_input": {
                "type": "string",
                "description": "精确十进制数值；不要转浮点数计算。"
              },
              "cache_read": {
                "type": "string",
                "description": "精确十进制数值；不要转浮点数计算。"
              },
              "cache_write": {
                "type": "string",
                "description": "精确十进制数值；不要转浮点数计算。"
              },
              "output": {
                "type": "string",
                "description": "精确十进制数值；不要转浮点数计算。"
              }
            },
            "additionalProperties": false
          },
          "components": {
            "type": "object",
            "properties": {
              "ordinary_input": {
                "type": "object",
                "properties": {
                  "tokens": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "reference_usd": {
                    "type": "string",
                    "description": "精确十进制数值；不要转浮点数计算。"
                  },
                  "calculated_cny_unrounded": {
                    "type": "string",
                    "description": "分类费用，未单独舍入；总额统一保留12位。"
                  }
                },
                "additionalProperties": false
              },
              "cache_read": {
                "type": "object",
                "properties": {
                  "tokens": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "reference_usd": {
                    "type": "string",
                    "description": "精确十进制数值；不要转浮点数计算。"
                  },
                  "calculated_cny_unrounded": {
                    "type": "string",
                    "description": "分类费用，未单独舍入；总额统一保留12位。"
                  }
                },
                "additionalProperties": false
              },
              "cache_write": {
                "type": "object",
                "properties": {
                  "tokens": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "reference_usd": {
                    "type": "string",
                    "description": "精确十进制数值；不要转浮点数计算。"
                  },
                  "calculated_cny_unrounded": {
                    "type": "string",
                    "description": "分类费用，未单独舍入；总额统一保留12位。"
                  }
                },
                "additionalProperties": false
              },
              "output": {
                "type": "object",
                "properties": {
                  "tokens": {
                    "type": "integer",
                    "minimum": 0
                  },
                  "reference_usd": {
                    "type": "string",
                    "description": "精确十进制数值；不要转浮点数计算。"
                  },
                  "calculated_cny_unrounded": {
                    "type": "string",
                    "description": "分类费用，未单独舍入；总额统一保留12位。"
                  }
                },
                "additionalProperties": false
              }
            },
            "additionalProperties": false,
            "description": "仅结算完成后返回；各分类分别计算，缓存读/写不与普通输入重复收费。"
          }
        },
        "additionalProperties": true,
        "required": [
          "request_id",
          "state",
          "charged_cny"
        ],
        "description": "请求账单，包含实际模型、用量、锁定价格、扣款、退款与请求状态。"
      },
      "ResponsesResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "const": "response"
          },
          "model": {
            "type": "string"
          },
          "created_at": {
            "type": "number"
          },
          "status": {
            "const": "completed"
          },
          "output": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true,
              "description": "完整输出项：message、function_call 或 reasoning。续接时原样保留全部 output，包括 reasoning 的 summary、content 和 encrypted_content。"
            }
          },
          "usage": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ResponseUsage"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": true,
        "required": [
          "id",
          "model",
          "status",
          "output"
        ]
      },
      "ChatResult": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "const": "chat.completion"
          },
          "created": {
            "type": "integer",
            "minimum": 0
          },
          "model": {
            "type": "string"
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "const": 0
                },
                "message": {
                  "type": "object",
                  "additionalProperties": true
                },
                "finish_reason": {
                  "enum": [
                    "stop",
                    "tool_calls"
                  ]
                },
                "logprobs": {
                  "type": "null"
                }
              },
              "additionalProperties": false
            }
          },
          "usage": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/ChatUsage"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "id",
          "object",
          "created",
          "model",
          "choices"
        ]
      },
      "ResponseUsage": {
        "type": "object",
        "properties": {
          "input_tokens": {
            "type": "integer",
            "minimum": 0
          },
          "output_tokens": {
            "type": "integer",
            "minimum": 0
          },
          "total_tokens": {
            "type": "integer",
            "minimum": 0
          },
          "input_tokens_details": {
            "type": "object",
            "properties": {
              "cached_tokens": {
                "type": "integer",
                "minimum": 0
              },
              "cache_write_tokens": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": true,
            "description": "缓存读取与写入 Token；字段缺失表示未知，不等于零。"
          },
          "output_tokens_details": {
            "type": "object",
            "properties": {
              "reasoning_tokens": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": true,
            "description": "推理 Token 已包含在输出 Token 内，不重复相加。"
          }
        },
        "additionalProperties": true
      },
      "ChatUsage": {
        "type": "object",
        "properties": {
          "prompt_tokens": {
            "type": "integer",
            "minimum": 0
          },
          "completion_tokens": {
            "type": "integer",
            "minimum": 0
          },
          "total_tokens": {
            "type": "integer",
            "minimum": 0
          },
          "prompt_tokens_details": {
            "type": "object",
            "properties": {
              "cached_tokens": {
                "type": "integer",
                "minimum": 0
              },
              "cache_write_tokens": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": true,
            "description": "缓存读取与写入 Token；字段缺失表示未知，不等于零。"
          },
          "completion_tokens_details": {
            "type": "object",
            "properties": {
              "reasoning_tokens": {
                "type": "integer",
                "minimum": 0
              }
            },
            "additionalProperties": true,
            "description": "推理 Token 已包含在输出 Token 内，不重复相加。"
          }
        },
        "additionalProperties": true
      },
      "Models": {
        "type": "object",
        "properties": {
          "object": {
            "const": "list"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "object": {
                  "const": "model"
                },
                "created": {
                  "type": "integer",
                  "minimum": 0
                },
                "owned_by": {
                  "const": "gateway"
                }
              },
              "additionalProperties": false,
              "required": [
                "id",
                "object",
                "created",
                "owned_by"
              ]
            }
          }
        },
        "additionalProperties": false,
        "required": [
          "object",
          "data"
        ]
      },
      "Transaction": {
        "type": "object",
        "properties": {
          "transaction_id": {
            "type": "integer",
            "minimum": 0
          },
          "account_id": {
            "type": "string"
          },
          "request_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "kind": {
            "enum": [
              "credit",
              "charge",
              "refund"
            ]
          },
          "reference": {
            "type": "string"
          },
          "amount_cny": {
            "$ref": "#/components/schemas/CNY"
          },
          "balance_before": {
            "$ref": "#/components/schemas/CNY"
          },
          "balance_after": {
            "$ref": "#/components/schemas/CNY"
          },
          "actor": {
            "type": "string"
          },
          "reason": {
            "type": "string",
            "description": "该条资金变动的记账原因。"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "pricing_version": {
            "type": [
              "string",
              "null"
            ]
          },
          "entry_hash": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "Transactions": {
        "type": "object",
        "properties": {
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Transaction"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "additionalProperties": false,
        "required": [
          "data",
          "has_more",
          "next_cursor"
        ]
      },
      "Pricing": {
        "type": "object",
        "properties": {
          "version": {
            "type": "string"
          },
          "activation_status": {
            "enum": [
              "draft",
              "active"
            ]
          },
          "account_currency": {
            "const": "CNY"
          },
          "source_currency": {
            "const": "USD"
          },
          "unit_tokens": {
            "type": "integer",
            "minimum": 0
          },
          "discount_label": {
            "type": "string"
          },
          "discount_multiplier": {
            "type": "string"
          },
          "usd_to_cny": {
            "type": "string"
          },
          "fx_source": {
            "const": "operator_fixed"
          },
          "default_model": {
            "type": "string"
          },
          "default_reasoning_effort": {
            "type": "string"
          },
          "route_order": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "manual_model_default_allow_fallback": {
            "type": "boolean"
          },
          "automatic_route_allow_fallback": {
            "type": "boolean"
          },
          "models": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "enabled": {
                  "type": "boolean"
                },
                "context_window_tokens": {
                  "type": "integer",
                  "minimum": 1,
                  "description": "文本上下文窗口，包含输入、输出和推理 Token。"
                },
                "long_context": {
                  "type": "object",
                  "properties": {
                    "threshold_input_tokens": {
                      "type": "integer",
                      "minimum": 0,
                      "description": "实际输入 Token 超过此值时，整次请求使用下列价格。"
                    },
                    "official_usd_per_million": {
                      "type": "object",
                      "properties": {
                        "ordinary_input": {
                          "type": "string",
                          "description": "精确十进制数值；不要转浮点数计算。"
                        },
                        "cache_read": {
                          "type": "string",
                          "description": "精确十进制数值；不要转浮点数计算。"
                        },
                        "cache_write": {
                          "type": "string",
                          "description": "精确十进制数值；不要转浮点数计算。"
                        },
                        "output": {
                          "type": "string",
                          "description": "精确十进制数值；不要转浮点数计算。"
                        }
                      },
                      "additionalProperties": false
                    },
                    "customer_cny_per_million": {
                      "type": "object",
                      "properties": {
                        "ordinary_input": {
                          "type": "string",
                          "description": "精确十进制数值；不要转浮点数计算。"
                        },
                        "cache_read": {
                          "type": "string",
                          "description": "精确十进制数值；不要转浮点数计算。"
                        },
                        "cache_write": {
                          "type": "string",
                          "description": "精确十进制数值；不要转浮点数计算。"
                        },
                        "output": {
                          "type": "string",
                          "description": "精确十进制数值；不要转浮点数计算。"
                        }
                      },
                      "additionalProperties": false
                    }
                  },
                  "additionalProperties": false,
                  "description": "长上下文价格；单位为每百万 Token。未超过阈值时使用模型的常规价格。"
                },
                "source_url": {
                  "type": "string",
                  "format": "uri"
                },
                "official_usd_per_million": {
                  "type": "object",
                  "properties": {
                    "ordinary_input": {
                      "type": "string"
                    },
                    "cache_read": {
                      "type": "string"
                    },
                    "cache_write": {
                      "type": "string"
                    },
                    "output": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                },
                "customer_cny_per_million": {
                  "type": "object",
                  "properties": {
                    "ordinary_input": {
                      "type": "string"
                    },
                    "cache_read": {
                      "type": "string"
                    },
                    "cache_write": {
                      "type": "string"
                    },
                    "output": {
                      "type": "string"
                    }
                  },
                  "additionalProperties": false
                },
                "default_reasoning_effort": {
                  "type": "string"
                },
                "supported_reasoning_efforts": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  }
                },
                "verified_capabilities": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "description": "responses_text/chat_text 为文本；responses_tools/chat_tools 为函数调用；responses_images/chat_images 为图片；responses_images_tools/chat_images_tools 为图片配合函数调用。"
                },
                "images": {
                  "type": "object",
                  "properties": {
                    "max_images": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 4,
                      "description": "此模型支持的最大图片数，实际数量还取决于 detail。"
                    },
                    "max_images_auto": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 4,
                      "description": "所有图片使用 auto 时的最多张数。"
                    },
                    "max_images_low": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 4,
                      "description": "所有图片使用 low 时的最多张数。"
                    },
                    "max_images_high": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 4,
                      "description": "所有图片使用 high 时的最多张数。"
                    }
                  },
                  "additionalProperties": false,
                  "description": "支持图片的模型返回此字段；整个请求及完整历史中的图片合并计数。"
                }
              },
              "additionalProperties": false
            }
          }
        },
        "additionalProperties": false
      },
      "HealthStatus": {
        "type": "object",
        "properties": {
          "account": {
            "type": "object",
            "properties": {
              "state": {
                "enum": [
                  "unknown",
                  "ready",
                  "auth_required",
                  "usage_limited",
                  "unavailable",
                  "rate_limited"
                ]
              },
              "until": {
                "type": "number"
              },
              "code": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "additionalProperties": false
          },
          "models": {
            "type": "object",
            "additionalProperties": {
              "type": "object",
              "properties": {
                "state": {
                  "type": "string"
                },
                "until": {
                  "type": "number"
                }
              },
              "additionalProperties": false
            }
          },
          "catalog_at": {
            "type": "number"
          },
          "catalog_stale": {
            "type": "boolean"
          },
          "catalog_error": {
            "type": [
              "string",
              "null"
            ]
          },
          "subscription_remaining_tokens": {
            "type": "null",
            "description": "当前固定为 null。"
          },
          "route_order": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "billing_blocks": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "model": {
                  "type": "string"
                },
                "code": {
                  "const": "model_billing_suspended"
                }
              },
              "additionalProperties": false
            }
          }
        },
        "additionalProperties": false
      }
    },
    "securitySchemes": {
      "GatewayKey": {
        "type": "http",
        "scheme": "bearer",
        "description": "使用网关 API Key，通过 Authorization: Bearer <key> 发送；不要把 Key 放入 URL。"
      }
    }
  }
}
