{
  "openapi": "3.1.0",
  "info": {
    "title": "mj-v7-outpaint 인터페이스",
    "version": "1.0.0",
    "description": "- 사방으로 동시에 이미지 캔버스를 확장하여 원본 이미지와 매끄럽게 이어지는 새 콘텐츠 생성\n- pan과의 차이: outpaint는 사방으로 동시 확장, pan은 단일 방향으로 확장\n- **draft 모드로 생성된 소스 작업은 지원되지 않습니다**\n- 비동기 처리 모드, 반환된 작업 ID로 [조회](/ko/api-manual/task-management/get-task-detail)"
  },
  "servers": [
    {
      "url": "https://api.evolink.ai"
    }
  ],
  "paths": {
    "/v1/images/generations": {
      "post": {
        "operationId": "mjV7Outpaint",
        "summary": "Midjourney V7 아웃페인트",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MjV7OutpaintRequest"
              },
              "examples": {
                "outpaint_example": {
                  "summary": "사방 확장",
                  "value": {
                    "model": "mj-v7-outpaint",
                    "model_params": {
                      "task_id": "task-unified-xxx",
                      "image_number": 1,
                      "scale": 1.5
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "작업 생성 성공",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImageGenerationResponse"
                }
              }
            }
          },
          "400": {
            "description": "잘못된 요청 매개변수",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "미인증",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "402": {
            "description": "쿼터 부족",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "접근 거부",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "속도 제한 초과",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "내부 서버 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "##모든 인터페이스는 Bearer Token 인증이 필요합니다##\n\n**API Key 발급:**\n\n[API Key 관리 페이지](https://evolink.ai/dashboard/keys)에서 API Key를 발급받으세요\n\n**요청 헤더에 다음을 추가하세요:**\n```\nAuthorization: Bearer YOUR_API_KEY\n```"
      }
    },
    "schemas": {
      "MjV7OutpaintRequest": {
        "type": "object",
        "required": [
          "model",
          "model_params"
        ],
        "properties": {
          "model": {
            "type": "string",
            "enum": [
              "mj-v7-outpaint"
            ],
            "default": "mj-v7-outpaint",
            "description": "모델 이름"
          },
          "prompt": {
            "type": "string",
            "description": "확장 영역의 내용 안내"
          },
          "model_params": {
            "type": "object",
            "required": [
              "task_id"
            ],
            "description": "모델 매개변수",
            "properties": {
              "task_id": {
                "type": "string",
                "description": "소스 작업 ID",
                "example": "task-unified-xxx"
              },
              "image_number": {
                "type": "integer",
                "enum": [
                  0,
                  1,
                  2,
                  3
                ],
                "default": 0,
                "description": "이미지 선택 (0-3)"
              },
              "scale": {
                "type": "number",
                "minimum": 1.1,
                "maximum": 2.0,
                "default": 1.5,
                "description": "확장 비율 (최대 2.0, pan의 3.0 범위보다 작음)"
              },
              "speed": {
                "type": "string",
                "enum": [
                  "fast",
                  "turbo"
                ],
                "default": "fast",
                "description": "속도 모드 (prompt 입력 시에만 적용)\n\n**비용 안내:** turbo 모드는 비용이 더 높습니다"
              }
            }
          },
          "callback_url": {
            "type": "string",
            "format": "uri",
            "description": "작업 완료 후 콜백 URL"
          }
        }
      },
      "ImageGenerationResponse": {
        "type": "object",
        "properties": {
          "created": {
            "type": "integer",
            "description": "작업 생성 타임스탬프",
            "example": 1757165031
          },
          "id": {
            "type": "string",
            "description": "작업 ID",
            "example": "task-unified-1757165031-mjv7"
          },
          "model": {
            "type": "string",
            "description": "실제 사용된 모델 이름"
          },
          "object": {
            "type": "string",
            "enum": [
              "image.generation.task"
            ],
            "description": "작업 유형"
          },
          "progress": {
            "type": "integer",
            "description": "작업 진행률 (0-100)",
            "minimum": 0,
            "maximum": 100,
            "example": 0
          },
          "status": {
            "type": "string",
            "description": "작업 상태",
            "enum": [
              "pending",
              "processing",
              "completed",
              "failed"
            ],
            "example": "pending"
          },
          "task_info": {
            "$ref": "#/components/schemas/TaskInfo"
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "image",
              "audio",
              "video"
            ],
            "example": "image"
          },
          "usage": {
            "$ref": "#/components/schemas/Usage"
          }
        }
      },
      "TaskInfo": {
        "type": "object",
        "properties": {
          "can_cancel": {
            "type": "boolean",
            "description": "작업 취소 가능 여부",
            "example": true
          },
          "estimated_time": {
            "type": "integer",
            "description": "예상 완료 시간(초)",
            "minimum": 0,
            "example": 45
          }
        }
      },
      "Usage": {
        "type": "object",
        "properties": {
          "billing_rule": {
            "type": "string",
            "enum": [
              "per_call",
              "per_token",
              "per_second"
            ],
            "example": "per_call"
          },
          "credits_reserved": {
            "type": "number",
            "description": "예상 소비 크레딧",
            "minimum": 0,
            "example": 1.8
          },
          "user_group": {
            "type": "string",
            "example": "default"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "type": {
                "type": "string"
              }
            }
          }
        }
      }
    }
  }
}
