{
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "bearerFormat": "API Key",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "OpenAI Chat Completion API，包括图像分析、流式传输、函数调用和 Logprobs。",
    "title": "OpenAI Chat API",
    "version": "1.0.0"
  },
  "openapi": "3.0.3",
  "paths": {
    "/chat/completions": {
      "post": {
        "description": "生成聊天响应，支持图像、流式传输、函数调用和 logprobs。",
        "operationId": "createChatCompletion",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "properties": {
                  "function_call": {
                    "oneOf": [
                      {
                        "example": "auto",
                        "type": "string"
                      },
                      {
                        "properties": {
                          "name": {
                            "type": "string"
                          }
                        },
                        "type": "object"
                      }
                    ]
                  },
                  "functions": {
                    "items": {
                      "properties": {
                        "description": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "parameters": {
                          "properties": {},
                          "type": "object"
                        }
                      },
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "logprobs": {
                    "type": "boolean"
                  },
                  "messages": {
                    "items": {
                      "properties": {
                        "content": {
                          "description": "可以是文本字符串或数组（用于图像输入）。",
                          "oneOf": [
                            {
                              "type": "string"
                            },
                            {
                              "items": {
                                "properties": {
                                  "image_url": {
                                    "type": "string"
                                  },
                                  "text": {
                                    "type": "string"
                                  },
                                  "type": {
                                    "type": "string"
                                  }
                                },
                                "type": "object"
                              },
                              "type": "array"
                            }
                          ]
                        },
                        "role": {
                          "example": "user",
                          "type": "string"
                        }
                      },
                      "type": "object"
                    },
                    "type": "array"
                  },
                  "model": {
                    "example": "gpt-4.1-mini",
                    "type": "string"
                  },
                  "stream": {
                    "example": false,
                    "type": "boolean"
                  },
                  "top_logprobs": {
                    "type": "integer"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "成功完成"
          }
        },
        "summary": "创建聊天补全"
      }
    }
  },
  "security": [
    {
      "BearerAuth": []
    }
  ],
  "servers": [
    {
      "url": "https://api.aisa.one/v1"
    }
  ],
  "tags": [
    {
      "name": "Examples"
    }
  ]
}
