{
  "openapi": "3.0.3",
  "info": {
    "title": "igo api",
    "version": "2026-10-24",
    "description": "本站已验证的最小兼容接口。上游路由名称与能力以本站文档为准。"
  },
  "servers": [
    {
      "url": "https://api.hygoi.com/v1"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  },
  "paths": {
    "/models": {
      "get": {
        "summary": "获取当前令牌可用模型",
        "responses": {
          "200": {
            "description": "模型列表"
          },
          "401": {
            "description": "无效令牌"
          }
        }
      }
    },
    "/chat/completions": {
      "post": {
        "summary": "文本与 SSE",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "messages"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": [
                      "gpt-5.6",
                      "auto",
                      "gemini-3.8-flash"
                    ]
                  },
                  "messages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "required": [
                        "role",
                        "content"
                      ],
                      "properties": {
                        "role": {
                          "type": "string",
                          "enum": [
                            "system",
                            "user",
                            "assistant"
                          ]
                        },
                        "content": {
                          "type": "string"
                        }
                      }
                    }
                  },
                  "stream": {
                    "type": "boolean",
                    "default": false
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "聊天结果或 text/event-stream；流内仍可能包含错误"
          },
          "400": {
            "description": "参数错误"
          },
          "401": {
            "description": "无效令牌"
          },
          "429": {
            "description": "限额或限流"
          }
        }
      }
    },
    "/images/generations": {
      "post": {
        "summary": "GPT 文生图",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "prompt"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "enum": [
                      "gpt-image-2",
                      "gpt-image-2.5",
                      "gpt-image-2.5-flare",
                      "gpt-image-2.5-sunburst"
                    ]
                  },
                  "prompt": {
                    "type": "string"
                  },
                  "n": {
                    "type": "integer",
                    "default": 1
                  },
                  "size": {
                    "type": "string",
                    "enum": [
                      "1024x1024",
                      "2048x2048",
                      "4096x4096"
                    ]
                  },
                  "response_format": {
                    "type": "string",
                    "enum": [
                      "url",
                      "b64_json"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "data 数组含 url 或 b64_json；需下载并完整解码验证"
          },
          "400": {
            "description": "参数错误"
          },
          "401": {
            "description": "无效令牌"
          }
        }
      }
    },
    "/images/edits": {
      "post": {
        "summary": "GPT 图生图 / 编辑",
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "type": "object",
                "required": [
                  "model",
                  "prompt",
                  "image"
                ],
                "properties": {
                  "model": {
                    "type": "string",
                    "example": "gpt-image-2"
                  },
                  "prompt": {
                    "type": "string"
                  },
                  "image": {
                    "type": "string",
                    "format": "binary"
                  },
                  "n": {
                    "type": "integer",
                    "default": 1
                  },
                  "size": {
                    "type": "string",
                    "example": "1024x1024"
                  },
                  "response_format": {
                    "type": "string",
                    "enum": [
                      "url",
                      "b64_json"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "图片结果"
          },
          "400": {
            "description": "参数或输入文件错误"
          }
        }
      }
    }
  }
}