{
  "openapi": "3.0.3",
  "info": {
    "title": "生图编辑图服务",
    "description": "Generate images based on text prompts and image resources",
    "termsOfService": "https://www.showapi.com/helpcenter/view#/4019/2",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://route.showapi.com"
    }
  ],
  "paths": {
    "/3599-3": {
      "x-pointCode": 3,
      "x-mode": "mapping",
      "x-read-timeout": 10,
      "x-connect-timeout": 10,
      "post": {
        "summary": "生图状态查询",
        "description": "提交请求后返回 `task_id` 查询任务状态。当 `task_status` 为 `SUCCEEDED` 时，可通过 提交请求后返回的`result_url` 获取最终生成的图像。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "ret_code": {
                              "type": "number",
                              "description": "接口状态 0为成功，其它为失败"
                            },
                            "remark": {
                              "type": "string",
                              "description": "返回的描述信息"
                            },
                            "task_id": {
                              "type": "string",
                              "description": "任务id"
                            },
                            "task_status": {
                              "type": "string",
                              "description": "任务状态 \nPENDING \nRUNNING \nSUCCEEDED \nFAILED \nUNDEFINED"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "3599_3_POST",
        "parameters": [
          {
            "name": "task_id",
            "in": "query",
            "description": "任务id，用于查询生图任务状态",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ]
      }
    },
    "/3599-2": {
      "x-pointCode": 2,
      "x-mode": "pass_through",
      "x-read-timeout": 300,
      "x-connect-timeout": 300,
      "post": {
        "summary": "Image图像生成_上传文件",
        "description": "本接口采用异步任务模式，提交请求后返回 `task_id` 与初始任务状态。建议根据返回的 `task_status` 进行轮询，或在万维易源控制台查看任务最终状态。当 `task_status` 为 `SUCCEEDED` 时，可通过 `result_url` 获取最终生成的图像；若为 `FAILED`，请根据系统错误码排查后重新提交。\n注意事项：\n1. 系统已**内置最优高清图像生成模型**，无需用户传入模型参数，由接口自动匹配对应模型；\n2. `aspect_ratio` 可选值为：`1:1`、`3:4`、`4:3`、`16:9`、`9:16`；\n3. `referImages` 为引用图片 URL 数组，支持传入多张参考图；\n4. 请求地址中的 `{your_appKey}` 需替换为真实的 AppKey；\n5. 图像生成为异步执行，提交成功后请妥善保存返回的 `task_id`，用于后续查询任务状态及获取结果。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "task_id": {
                              "type": "string",
                              "description": "任务id"
                            },
                            "task_status": {
                              "type": "string",
                              "description": "任务状态 PENDING RUNNING SUCCEEDED FAILED"
                            },
                            "result_url": {
                              "type": "string",
                              "description": "结果URL"
                            },
                            "ret_code": {
                              "type": "number"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "3599_2_POST",
        "parameters": []
      }
    },
    "/3599-1": {
      "x-pointCode": 1,
      "x-mode": "pass_through",
      "x-read-timeout": 300,
      "x-connect-timeout": 300,
      "post": {
        "summary": "Image图像生成",
        "description": "本接口采用异步任务模式，提交请求后返回 `task_id` 与初始任务状态。建议根据返回的 `task_status` 进行轮询，或在万维易源控制台查看任务最终状态。当 `task_status` 为 `SUCCEEDED` 时，可通过 `result_url` 获取最终生成的图像；若为 `FAILED`，请根据系统错误码排查后重新提交。\n注意事项：\n1. 系统已**内置最优高清图像生成模型**，无需用户传入模型参数，由接口自动匹配对应模型；\n2. `aspect_ratio` 可选值为：`1:1`、`3:4`、`4:3`、`16:9`、`9:16`；\n3. `referImages` 为引用图片 URL 数组，支持传入多张参考图；\n4. 请求地址中的 `{your_appKey}` 需替换为真实的 AppKey；\n5. 图像生成为异步执行，提交成功后请妥善保存返回的 `task_id`，用于后续查询任务状态及获取结果。",
        "responses": {
          "200": {
            "description": "成功响应",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/ShowapiResEnvelope"
                    },
                    {
                      "type": "object",
                      "properties": {
                        "showapi_res_body": {
                          "type": "object",
                          "properties": {
                            "task_id": {
                              "type": "string",
                              "description": "任务id"
                            },
                            "task_status": {
                              "type": "string",
                              "description": "任务状态 PENDING RUNNING SUCCEEDED FAILED"
                            },
                            "result_url": {
                              "type": "string",
                              "description": "结果URL"
                            },
                            "ret_code": {
                              "type": "number"
                            }
                          },
                          "description": "业务返回体"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "operationId": "3599_1_POST",
        "parameters": [],
        "requestBody": {
          "description": "入参示例原文（含注解）：\n\n```json5\n{\n    \"prompt\": \"a cute cat\",//生成图片描述词 支持中文（必选）\n  \t\"aspect_ratio\":\"9:16\", //  可选值：1:1, 3:4, 4:3, 16:9, 9:16\n  \t\"referImages\": [\"\"]//引用图片URL或base64，支持多张图\n}\n```",
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "prompt": {
                    "type": "string",
                    "description": "生成图片描述词 支持中文（必选）"
                  },
                  "aspect_ratio": {
                    "type": "string",
                    "description": "可选值：1:1, 3:4, 4:3, 16:9, 9:16"
                  },
                  "referImages": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "引用图片URL或base64，支持多张图"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "AppKeyAuth": {
        "type": "apiKey",
        "in": "query",
        "name": "appKey",
        "description": "从 ShowAPI 控制台获取的 appKey，管理地址：https://www.showapi.com/console#/myApp"
      }
    },
    "schemas": {
      "ShowapiResEnvelope": {
        "type": "object",
        "description": "ShowAPI 统一返回包裹（业务数据位于 showapi_res_body）",
        "properties": {
          "showapi_res_code": {
            "type": "integer",
            "description": "API 返回的状态码"
          },
          "showapi_res_error": {
            "type": "string",
            "description": "API 返回的错误信息"
          },
          "showapi_res_id": {
            "type": "string",
            "description": "API 请求的唯一标识"
          },
          "showapi_fee_num": {
            "type": "integer",
            "description": "API 调用计费次数"
          }
        }
      }
    }
  },
  "security": [
    {
      "AppKeyAuth": []
    }
  ],
  "externalDocs": {
    "url": "https://www.showapi.com/apiGateway/view/3599?tab=book"
  },
  "x-apiCode": "3599",
  "x-is-own": false,
  "x-is-op": false
}