{
  "openapi": "3.1.0",
  "info": {
    "title": "302API 公开接口参考",
    "version": "2026-10-13",
    "description": "本站实现范围及常用字段子集，不代表全部厂商能力。价格和能力以控制台及接入文档为准。 图片模型按文本、图片、缓存分项计费；思考输出不重复相加。计费依据实际 usage，缺失或矛盾明细待核对。 Both https://api.302api.com and https://api.302api.com/v1 are permanently supported. Native /v1/messages remains available."
  },
  "servers": [
    {
      "url": "https://api.302api.com",
      "description": "Unified address; permanently supported"
    },
    {
      "url": "https://api.302api.com/v1",
      "description": "Standard OpenAI-compatible address; permanently supported"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/models": {
      "get": {
        "operationId": "listModels",
        "summary": "查询可见模型；仍执行鉴权额度限流检查",
        "responses": {
          "200": {
            "description": "成功；请检查内容与usage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ModelsResponse"
                }
              }
            }
          },
          "400": {
            "description": "参数或接口不匹配",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "余额或Key额度不足",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "模型或定价不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "接口未开放",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "方法错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "图片标识已使用；不重放结果",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "限流或当日额度耗尽；按error.code区分",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "仅频率限制可能提供，单位秒；不保证所有429都有。",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "502": {
            "description": "结果异常或图片待核对；不自动重试",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务未就绪",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "其他错误；代理或网络错误不保证JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/chat/completions": {
      "post": {
        "operationId": "chat_completions",
        "summary": "chat/completions",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChatRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；请检查内容与usage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ChatResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "原始SSE事件流；两种端点事件不同。图片不可流式。"
                }
              }
            }
          },
          "400": {
            "description": "参数或接口不匹配",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "余额或Key额度不足",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "模型或定价不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "接口未开放",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "方法错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "图片标识已使用；不重放结果",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "限流或当日额度耗尽；按error.code区分",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "仅频率限制可能提供，单位秒；不保证所有429都有。",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "502": {
            "description": "结果异常或图片待核对；不自动重试",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务未就绪",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "其他错误；代理或网络错误不保证JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 128
            },
            "description": "图片任务去重，作用域为API Key；重复409，不重放结果，不承诺固定有效期。普通文本不保证支持。"
          }
        ]
      }
    },
    "/responses": {
      "post": {
        "operationId": "responses",
        "summary": "responses",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResponsesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；请检查内容与usage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponsesResponse"
                }
              },
              "text/event-stream": {
                "schema": {
                  "type": "string",
                  "description": "原始SSE事件流；两种端点事件不同。图片不可流式。"
                }
              }
            }
          },
          "400": {
            "description": "参数或接口不匹配",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "余额或Key额度不足",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "模型或定价不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "接口未开放",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "方法错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "图片标识已使用；不重放结果",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "限流或当日额度耗尽；按error.code区分",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "仅频率限制可能提供，单位秒；不保证所有429都有。",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "502": {
            "description": "结果异常或图片待核对；不自动重试",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务未就绪",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "其他错误；代理或网络错误不保证JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "description": "当前在售 gpt-6-astra、gpt-6-sol、gpt-6-luna 的原生 Responses 文本推理入口。管理端点不在开放范围。"
      }
    },
    "/images/generations": {
      "post": {
        "operationId": "images_generations",
        "summary": "images/generations",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImageRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；请检查内容与usage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageResponse"
                }
              }
            },
            "headers": {
              "X-302API-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "本站图片请求编号"
              }
            }
          },
          "400": {
            "description": "参数或接口不匹配",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "余额或Key额度不足",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "模型或定价不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "接口未开放",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "方法错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "图片标识已使用；不重放结果",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "限流或当日额度耗尽；按error.code区分",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "仅频率限制可能提供，单位秒；不保证所有429都有。",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "502": {
            "description": "结果异常或图片待核对；不自动重试",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务未就绪",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "其他错误；代理或网络错误不保证JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 128
            },
            "description": "图片任务去重，作用域为API Key；重复409，不重放结果，不承诺固定有效期。普通文本不保证支持。"
          }
        ]
      }
    },
    "/images/edits": {
      "post": {
        "operationId": "images_edits",
        "summary": "images/edits",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/ImageEditRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；请检查内容与usage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageResponse"
                }
              }
            },
            "headers": {
              "X-302API-Request-ID": {
                "schema": {
                  "type": "string"
                },
                "description": "本站图片请求编号"
              }
            }
          },
          "400": {
            "description": "参数或接口不匹配",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "余额或Key额度不足",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "模型或定价不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "接口未开放",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "方法错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "图片标识已使用；不重放结果",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "限流或当日额度耗尽；按error.code区分",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "仅频率限制可能提供，单位秒；不保证所有429都有。",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "502": {
            "description": "结果异常或图片待核对；不自动重试",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务未就绪",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "其他错误；代理或网络错误不保证JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 128
            },
            "description": "图片任务去重，作用域为API Key；重复409，不重放结果，不承诺固定有效期。普通文本不保证支持。"
          }
        ]
      }
    },
    "/embeddings": {
      "post": {
        "operationId": "embeddings",
        "summary": "embeddings",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmbeddingRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "成功；请检查内容与usage",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmbeddingResponse"
                }
              }
            }
          },
          "400": {
            "description": "参数或接口不匹配",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "密钥无效",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "余额或Key额度不足",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "模型或定价不可用",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "接口未开放",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "405": {
            "description": "方法错误",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "图片标识已使用；不重放结果",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "限流或当日额度耗尽；按error.code区分",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "headers": {
              "Retry-After": {
                "description": "仅频率限制可能提供，单位秒；不保证所有429都有。",
                "schema": {
                  "type": "integer",
                  "minimum": 0
                }
              }
            }
          },
          "502": {
            "description": "结果异常或图片待核对；不自动重试",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "服务未就绪",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "default": {
            "description": "其他错误；代理或网络错误不保证JSON",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              },
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "/messages": {
      "post": {
        "summary": "Claude native Messages",
        "description": "四个Claude模型的Anthropic原生接口，共用本站Key和余额；max_tokens必填。beta按白名单转发，其余移除；count_tokens未开放。必要采样/思考参数会兼容处理，详见接入文档。",
        "security": [
          {
            "AnthropicKey": []
          }
        ],
        "parameters": [
          {
            "name": "anthropic-version",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "2023-06-01"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "max_tokens",
                  "messages"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": [
                      "claude-fable-5-1",
                      "claude-haiku-5-5",
                      "claude-sonnet-5-5",
                      "claude-opus-5-5"
                    ]
                  },
                  "max_tokens": {
                    "type": "integer",
                    "minimum": 1
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object"
                    }
                  },
                  "stream": {
                    "type": "boolean"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Anthropic message JSON or SSE stream"
          },
          "400": {
            "description": "Invalid request"
          },
          "401": {
            "description": "Authentication failed"
          },
          "429": {
            "description": "Rate limited"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      },
      "AnthropicKey": {
        "type": "apiKey",
        "in": "header",
        "name": "x-api-key"
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "message": {
                "type": "string"
              },
              "type": {
                "type": "string"
              },
              "code": {
                "type": "string"
              }
            },
            "required": [
              "message",
              "type"
            ]
          }
        },
        "required": [
          "error"
        ]
      },
      "Usage": {
        "type": "object",
        "properties": {
          "prompt_tokens": {
            "type": "integer",
            "minimum": 0
          },
          "completion_tokens": {
            "type": "integer",
            "minimum": 0
          },
          "input_tokens": {
            "type": "integer",
            "minimum": 0
          },
          "output_tokens": {
            "type": "integer",
            "minimum": 0
          },
          "total_tokens": {
            "type": "integer",
            "minimum": 0
          },
          "prompt_tokens_details": {
            "type": "object"
          },
          "input_tokens_details": {
            "type": "object"
          },
          "output_tokens_details": {
            "type": "object"
          },
          "completion_tokens_details": {
            "type": "object"
          }
        },
        "required": [],
        "description": "不同端点字段不同；子项不重复加总。缺失不代表零费用。"
      },
      "ChatRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string"
          },
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "role": {
                  "type": "string"
                },
                "content": {
                  "oneOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  ]
                }
              },
              "required": [
                "role",
                "content"
              ]
            },
            "minItems": 1
          },
          "stream": {
            "type": "boolean",
            "default": false
          },
          "max_completion_tokens": {
            "type": "integer",
            "minimum": 1,
            "description": "可选输出上限。缺省时不注入上限；65536仅用于预占估算，模型自身限制仍适用。新旧Chat字段同时提供时优先max_completion_tokens。"
          },
          "max_tokens": {
            "type": "integer",
            "minimum": 1,
            "description": "可选输出上限。缺省时不注入上限；65536仅用于预占估算，模型自身限制仍适用。新旧Chat字段同时提供时优先max_completion_tokens。"
          },
          "stream_options": {
            "type": "object",
            "properties": {
              "include_usage": {
                "type": "boolean"
              }
            },
            "required": []
          },
          "modalities": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Gemini生图仅[text,image]。"
          },
          "user": {
            "type": "string"
          }
        },
        "required": [
          "model",
          "messages"
        ],
        "description": "文本参数子集；其他字段不承诺支持。Gemini图片仅非流式；max_tokens可省略，填写时须为正整数，上限由所选模型及厂商接口校验。当前在售GPT-6携带function tools或工具历史时转换为Responses并返回Chat格式；仅n=1、function工具，effort支持low/medium/high/xhigh/max，默认medium，none/minimal转low。普通Chat移除reasoning_effort及不支持的采样字段。客户端应保留工具调用ID和结果，详见/docs#compatibility。"
      },
      "ResponsesRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string"
          },
          "input": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "object"
                }
              }
            ]
          },
          "stream": {
            "type": "boolean",
            "default": false
          },
          "max_output_tokens": {
            "type": "integer",
            "minimum": 1,
            "description": "可选输出上限。缺省时不注入上限；65536仅用于预占估算，模型自身限制仍适用。推理Token属于输出预算。"
          }
        },
        "required": [
          "model",
          "input"
        ],
        "description": "当前在售gpt-6-astra、gpt-6-sol、gpt-6-luna的文本推理请求。使用input，不发送Chat的stream_options。其他Responses管理端点未开放。"
      },
      "ImageRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "gpt-image-2.5-flare",
              "gpt-image-2.5-sunburst"
            ]
          },
          "prompt": {
            "type": "string",
            "minLength": 1
          },
          "size": {
            "type": "string",
            "enum": [
              "1024x1024",
              "1536x1024",
              "1024x1536"
            ],
            "default": "1024x1024"
          },
          "quality": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ],
            "default": "low"
          },
          "n": {
            "type": "integer",
            "enum": [
              1
            ],
            "default": 1
          },
          "stream": {
            "type": "boolean",
            "enum": [
              false
            ],
            "default": false
          },
          "output_format": {
            "type": "string",
            "enum": [
              "png"
            ],
            "default": "png"
          },
          "partial_images": {
            "type": "integer",
            "enum": [
              0
            ]
          },
          "user": {
            "type": "string"
          }
        },
        "required": [
          "model",
          "prompt"
        ],
        "additionalProperties": false,
        "description": "JSON请求体大小由模型服务校验；prompt不可仅空白。新增档位验证状态见文档。"
      },
      "ImageEditRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "gpt-image-2.5-flare",
              "gpt-image-2.5-sunburst"
            ]
          },
          "prompt": {
            "type": "string",
            "minLength": 1
          },
          "size": {
            "type": "string",
            "enum": [
              "1024x1024",
              "1536x1024",
              "1024x1536"
            ]
          },
          "quality": {
            "type": "string",
            "enum": [
              "low",
              "medium",
              "high"
            ]
          },
          "n": {
            "type": "integer",
            "enum": [
              1
            ],
            "default": 1
          },
          "stream": {
            "type": "boolean",
            "enum": [
              false
            ],
            "default": false
          },
          "output_format": {
            "type": "string",
            "enum": [
              "png"
            ],
            "default": "png"
          },
          "partial_images": {
            "type": "integer",
            "enum": [
              0
            ]
          },
          "user": {
            "type": "string"
          },
          "image": {
            "type": "string",
            "format": "binary",
            "description": "单张PNG/JPEG/WebP文件，非URL。"
          },
          "mask": {
            "type": "string",
            "format": "binary",
            "description": "可选蒙版，尚未逐模型验证。"
          }
        },
        "required": [
          "model",
          "prompt",
          "size",
          "quality",
          "image"
        ],
        "additionalProperties": false,
        "description": "multipart请求体大小由模型服务校验。image[]单文件别名也可用，但不得与image同时提交。此规范采用推荐image字段。"
      },
      "ChatResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "model": {
            "type": "string"
          },
          "choices": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "index": {
                  "type": "integer"
                },
                "message": {
                  "type": "object",
                  "properties": {
                    "role": {
                      "type": "string"
                    },
                    "content": {
                      "oneOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "null"
                        },
                        {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "type": {
                                "type": "string"
                              },
                              "text": {
                                "type": "string"
                              },
                              "image_url": {
                                "type": "object",
                                "properties": {
                                  "url": {
                                    "type": "string",
                                    "description": "可能为data:image/...;base64,...，不要当作可直接访问的HTTP地址。"
                                  }
                                },
                                "required": [
                                  "url"
                                ]
                              }
                            },
                            "required": []
                          }
                        }
                      ]
                    },
                    "images": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "image_url": {
                            "type": "object",
                            "properties": {
                              "url": {
                                "type": "string",
                                "description": "可能为data:image/...;base64,...，不要当作可直接访问的HTTP地址。"
                              }
                            },
                            "required": [
                              "url"
                            ]
                          }
                        },
                        "required": [
                          "image_url"
                        ]
                      }
                    },
                    "tool_calls": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      }
                    }
                  },
                  "required": [
                    "role"
                  ]
                },
                "finish_reason": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "index",
                "message"
              ]
            }
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          }
        },
        "required": [
          "choices"
        ],
        "description": "Gemini图片内容布局可能不同，参考文档提取器；不保证仅文本content。"
      },
      "ResponsesResponse": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "output": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "type": {
                  "type": "string"
                },
                "role": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "content": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "type": {
                        "type": "string"
                      },
                      "text": {
                        "type": "string"
                      },
                      "annotations": {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      }
                    },
                    "required": [
                      "type"
                    ]
                  }
                }
              },
              "required": [
                "type"
              ]
            }
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          }
        },
        "required": [
          "output"
        ]
      },
      "ImageResponse": {
        "type": "object",
        "properties": {
          "created": {
            "type": "integer"
          },
          "data": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1,
            "items": {
              "type": "object",
              "properties": {
                "b64_json": {
                  "type": "string"
                }
              },
              "required": [
                "b64_json"
              ]
            }
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          }
        },
        "required": [
          "data",
          "usage"
        ]
      },
      "ModelsResponse": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "object": {
                  "type": "string"
                },
                "created": {
                  "type": "integer"
                },
                "owned_by": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "object",
                "created",
                "owned_by"
              ]
            }
          }
        },
        "required": [
          "object",
          "data"
        ]
      },
      "EmbeddingRequest": {
        "type": "object",
        "properties": {
          "model": {
            "type": "string"
          },
          "input": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {}
              }
            ]
          }
        },
        "required": [
          "model",
          "input"
        ],
        "description": "仅供平台已开放的嵌入模型；路由存在不保证当前有可用模型。其他参数需验证。"
      },
      "EmbeddingResponse": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string"
          },
          "data": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "object": {
                  "type": "string"
                },
                "index": {
                  "type": "integer"
                },
                "embedding": {
                  "oneOf": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "array",
                      "items": {
                        "type": "number"
                      }
                    }
                  ]
                }
              },
              "required": [
                "embedding",
                "index"
              ]
            }
          },
          "model": {
            "type": "string"
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          }
        },
        "required": [
          "data"
        ]
      }
    }
  }
}
