{
  "openapi": "3.1.0",
  "info": {
    "title": "mj-v7-enhance 인터페이스",
    "version": "1.0.0",
    "description": "- draft 모드로 생성된 스케치를 표준 품질 이미지로 향상\n- 권장 워크플로: mj-v7 + draft 모드로 저렴하고 빠르게 미리보기 후, 만족스러우면 향상\n- **draft 모드로 생성된 소스 작업만 지원**\n- 비동기 처리 모드, 반환된 작업 ID로 [조회](/ko/api-manual/task-management/get-task-detail)"
  },
  "servers": [
    {
      "url": "https://api.evolink.ai"
    }
  ],
  "paths": {
    "/v1/images/generations": {
      "post": {
        "operationId": "mjV7Enhance",
        "summary": "Midjourney V7 향상",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MjV7EnhanceRequest"
              },
              "examples": {
                "enhance_example": {
                  "summary": "스케치 향상",
                  "value": {
                    "model": "mj-v7-enhance",
                    "model_params": {
                      "task_id": "task-unified-xxx",
                      "image_number": 0
                    }
                  }
                }
              }
            }
          }
        },
        "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": {
      "MjV7EnhanceRequest": {
        "type": "object",
        "required": ["model", "model_params"],
        "properties": {
          "model": {
            "type": "string",
            "enum": ["mj-v7-enhance"],
            "default": "mj-v7-enhance",
            "description": "모델 이름"
          },
          "model_params": {
            "type": "object",
            "required": ["task_id"],
            "description": "모델 매개변수",
            "properties": {
              "task_id": {
                "type": "string",
                "description": "소스 작업 ID (**draft 모드로 생성된 작업이어야 합니다**)",
                "example": "task-unified-xxx"
              },
              "image_number": {
                "type": "integer",
                "enum": [0, 1, 2, 3],
                "default": 0,
                "description": "이미지 선택 (0-3)"
              }
            }
          },
          "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"
              }
            }
          }
        }
      }
    }
  }
}
