{
  "openapi": "3.1.0",
  "info": {
    "title": "OmniHuman-1.5 디지털 휴먼 비디오 생성 API",
    "description": "OmniHuman-1.5 모델을 사용하여 오디오 기반 디지털 휴먼 비디오 생성 작업 생성",
    "license": {
      "name": "MIT"
    },
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://api.evolink.ai",
      "description": "프로덕션 환경"
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/v1/videos/generations": {
      "post": {
        "summary": "OmniHuman-1.5 디지털 휴먼 비디오 생성",
        "description": "- OmniHuman-1.5 (omnihuman-1.5) 모델은 오디오 기반으로 디지털 휴먼 비디오를 생성합니다\n- 비동기 처리 모드이며, 반환된 작업 ID를 사용하여 [조회](/ko/api-manual/task-management/get-task-detail)\n- 생성된 비디오 링크는 24시간 동안 유효하며, 즉시 저장하시기 바랍니다\n\n**참고:**\n- 오디오 길이 제한: 최대 35초\n- 지원 오디오 형식: MP3, WAV\n- 요금은 오디오 길이를 기준으로 합니다(초 단위 올림)",
        "operationId": "createOmniHumanVideoGeneration",
        "tags": [
          "디지털 휴먼 비디오 생성"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OmniHumanVideoGenerationRequest"
              },
              "examples": {
                "basic_generation": {
                  "summary": "기본 디지털 휴먼 생성",
                  "value": {
                    "model": "omnihuman-1.5",
                    "audio_url": "https://example.com/audio.mp3",
                    "image_urls": [
                      "https://example.com/person.jpg"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "디지털 휴먼 비디오 생성 작업이 성공적으로 생성되었습니다",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OmniHumanVideoGenerationResponse"
                }
              }
            }
          },
          "400": {
            "description": "요청 매개변수가 잘못되었습니다",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": "invalid_request",
                    "message": "Invalid request parameters",
                    "type": "invalid_request_error"
                  }
                }
              }
            }
          },
          "401": {
            "description": "인증되지 않았거나 토큰이 유효하지 않거나 만료되었습니다",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": "unauthorized",
                    "message": "Invalid or expired token",
                    "type": "authentication_error"
                  }
                }
              }
            }
          },
          "402": {
            "description": "할당량이 부족합니다. 충전이 필요합니다",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": "insufficient_quota",
                    "message": "Insufficient quota. Please top up your account.",
                    "type": "insufficient_quota"
                  }
                }
              }
            }
          },
          "403": {
            "description": "접근이 거부되었습니다",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": "model_access_denied",
                    "message": "Token does not have access to model: omnihuman-1.5",
                    "type": "invalid_request_error"
                  }
                }
              }
            }
          },
          "429": {
            "description": "요청 한도를 초과했습니다",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": "rate_limit_exceeded",
                    "message": "Too many requests, please try again later",
                    "type": "rate_limit_error"
                  }
                }
              }
            }
          },
          "500": {
            "description": "서버 내부 오류",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": {
                    "code": "internal_error",
                    "message": "Internal server error",
                    "type": "api_error"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "OmniHumanVideoGenerationRequest": {
        "type": "object",
        "required": [
          "model",
          "audio_url",
          "image_urls"
        ],
        "properties": {
          "model": {
            "type": "string",
            "description": "디지털 휴먼 비디오 생성 모델 이름",
            "enum": [
              "omnihuman-1.5"
            ],
            "default": "omnihuman-1.5",
            "example": "omnihuman-1.5"
          },
          "audio_url": {
            "type": "string",
            "format": "uri",
            "description": "립싱크 및 신체 동작을 구동하기 위한 오디오 URL\n\n**참고:**\n- 최대 오디오 길이: `35`초\n- 지원 형식: `.mp3`, `.wav`\n- 오디오 URL은 서버에서 직접 접근 가능해야 합니다\n- 요금은 오디오 길이를 기준으로 합니다(초 단위 올림)",
            "example": "https://example.com/audio.mp3"
          },
          "image_urls": {
            "type": "array",
            "description": "애니메이션할 인물이 포함된 참조 이미지 URL 목록\n\n**참고:**\n- 요청당 이미지 수: `1`\n- 이미지에 명확한 인물이 포함되어야 합니다\n- 이미지 크기: `10MB` 이하\n- 지원 파일 형식: `.jpg`, `.jpeg`, `.png`, `.webp`\n- 이미지 URL은 서버에서 직접 조회 가능해야 합니다",
            "items": {
              "type": "string",
              "format": "uri"
            },
            "maxItems": 1,
            "example": [
              "https://example.com/person.jpg"
            ]
          },
          "prompt": {
            "type": "string",
            "description": "생성 스타일을 안내하는 선택적 텍스트 프롬프트, 중국어, 영어, 일본어, 한국어, 멕시코 스페인어 및 인도네시아어만 지원합니다",
            "example": "A person speaking naturally with subtle expressions"
          },
          "pe_fast_mode": {
            "type": "boolean",
            "description": "빠른 처리 모드 활성화\n\n**참고:**\n- `true`: 품질이 다소 낮아질 수 있지만 더 빠른 생성\n- `false`: 표준 품질 처리 (기본값)",
            "default": false,
            "example": false
          },
          "mask_url": {
            "type": "array",
            "description": "애니메이션 영역을 지정하기 위한 마스크 URL 배열\n\n**참고:**\n- 고급 제어를 위한 선택적 매개변수\n- 마스크 이미지는 참조 이미지 해상도와 일치해야 합니다",
            "items": {
              "type": "string",
              "format": "uri"
            },
            "example": [
              "https://example.com/mask.png"
            ]
          },
          "seed": {
            "type": "integer",
            "description": "초기 확산 상태를 결정하기 위한 기준이 되는 랜덤 시드, 기본값은 랜덤입니다. 시드가 동일한 양의 정수이고 다른 모든 매개변수가 일치하면 생성된 콘텐츠가 일관된 결과를 가질 수 있습니다"
          },
          "subject_check": {
            "type": "boolean",
            "description": "이미지에서 인물 존재를 확인하기 위한 피사체 감지 활성화\n\n**참고:**\n- `true`: 피사체 감지 활성화, 요청 시작 시간이 증가합니다\n- `false`: 피사체 감지 건너뛰기 (기본값)",
            "default": false,
            "example": false
          },
          "auto_mask": {
            "type": "boolean",
            "description": "자동 마스크 생성 활성화\n\n**참고:**\n- `true`: 자동으로 인물을 감지하고 마스킹합니다. 요청 시작 시간이 증가합니다. `mask_url`에 값이 있으면 이 매개변수는 무시됩니다\n- `false`: 제공된 mask_url을 사용하거나 마스크 없음 (기본값)",
            "default": false,
            "example": false
          },
          "callback_url": {
            "type": "string",
            "description": "작업 완료 후 HTTPS 콜백 주소\n\n**콜백 타이밍:**\n- 작업이 완료, 실패 또는 취소될 때 트리거됨\n- 과금 확인 완료 후 전송\n\n**보안 제한:**\n- HTTPS 프로토콜만 지원\n- 내부 IP 주소로의 콜백 금지 (127.0.0.1, 10.x.x.x, 172.16-31.x.x, 192.168.x.x 등)\n- URL 길이는 `2048`자를 초과할 수 없음\n\n**콜백 메커니즘:**\n- 타임아웃: `10`초\n- 실패 시 최대 `3`회 재시도 (`1`초/`2`초/`4`초 후 재시도)\n- 콜백 응답 본문 형식은 작업 조회 API 응답 형식과 동일\n- 콜백 주소가 2xx 상태 코드를 반환하면 성공으로 간주, 다른 상태 코드는 재시도를 트리거",
            "format": "uri",
            "example": "https://your-domain.com/webhooks/video-task-completed"
          }
        }
      },
      "OmniHumanVideoGenerationResponse": {
        "type": "object",
        "properties": {
          "created": {
            "type": "integer",
            "description": "작업 생성 타임스탬프",
            "example": 1757169743
          },
          "id": {
            "type": "string",
            "description": "작업 ID",
            "example": "task-unified-1757169743-7cvnl5zw"
          },
          "model": {
            "type": "string",
            "description": "실제 사용된 모델 이름",
            "example": "omnihuman-1.5"
          },
          "object": {
            "type": "string",
            "enum": [
              "video.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/VideoTaskInfo",
            "description": "비디오 작업 상세 정보"
          },
          "type": {
            "type": "string",
            "enum": [
              "text",
              "image",
              "audio",
              "video"
            ],
            "description": "작업 출력 유형",
            "example": "video"
          },
          "usage": {
            "$ref": "#/components/schemas/VideoUsage",
            "description": "사용량 및 과금 정보"
          }
        }
      },
      "VideoTaskInfo": {
        "type": "object",
        "properties": {
          "can_cancel": {
            "type": "boolean",
            "description": "작업 취소 가능 여부 (OmniHuman의 경우 항상 false)",
            "example": false
          },
          "estimated_time": {
            "type": "integer",
            "description": "예상 완료 시간 (초)",
            "minimum": 0,
            "example": 120
          },
          "video_duration": {
            "type": "integer",
            "description": "영상 길이 (초), 오디오 길이 기준",
            "example": 10
          }
        }
      },
      "VideoUsage": {
        "type": "object",
        "description": "사용량 및 과금 정보",
        "properties": {
          "billing_rule": {
            "type": "string",
            "description": "과금 규칙 (OmniHuman의 경우 per_second)",
            "enum": [
              "per_call",
              "per_token",
              "per_second"
            ],
            "example": "per_second"
          },
          "credits_reserved": {
            "type": "number",
            "description": "예상 크레딧 소비량 (오디오 길이 기준)",
            "minimum": 0,
            "example": 10
          },
          "user_group": {
            "type": "string",
            "description": "사용자 그룹 카테고리",
            "example": "default"
          }
        }
      },
      "ErrorResponse": {
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "description": "오류 코드 식별자"
              },
              "message": {
                "type": "string",
                "description": "오류 설명"
              },
              "type": {
                "type": "string",
                "description": "오류 유형"
              }
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "##모든 API는 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```"
      }
    }
  },
  "tags": [
    {
      "name": "디지털 휴먼 비디오 생성",
      "description": "OmniHuman-1.5 디지털 휴먼 영상 생성 API"
    }
  ]
}
