logo Omni Video

오픈 API

이미지/비디오 생성 작업을 위한 REST API입니다. 계정 페이지에서 sk- 키로 인증하세요.

API 키 관리

인증

모든 요청에는 bearer 토큰이 필요합니다. 계정 페이지에서 생성하세요.

Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

사용 가능한 모델

아래 model_id 값만 오픈 API에서 허용됩니다.

model_id기능출력
seedance-2Seedance 2.0 (text / image to video)video_url
gpt-image-2ChatGPT Image 2 (text / image to image)image_url
nano-banana-2Nano Banana 2 (text / image to image)image_url

작업 생성

생성 요청을 제출하세요. 응답으로 조회할 수 있는 task_id가 반환됩니다.

POST /api/v1/tasks/create

요청 본문

{
  "model_id": "gpt-image-2",
  "prompt": "a serene zen garden at sunrise, ultra detailed",
  "image_urls": [],
  "aspect_ratio": "16:9"
}

cURL 예시

curl -X POST https://your-site.com/api/v1/tasks/create \
  -H "Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model_id": "gpt-image-2",
    "prompt": "a serene zen garden at sunrise",
    "aspect_ratio": "16:9"
  }'

응답

{
  "code": 200,
  "msg": "提交成功,等待生成",
  "data": {
    "task_id": "abcdef123456",
    "request_id": "kie_xxxxxxxxxxxx",
    "credits": 15
  }
}

제출 시 크레딧이 차감됩니다. 실패한 작업은 자동 환불됩니다.

작업 조회

id로 작업을 조회하여 task_status가 3(성공) 또는 4(실패)에 도달할 때까지 반복합니다.

GET /api/v1/tasks/{task_id}

cURL 예시

curl https://your-site.com/api/v1/tasks/abcdef123456 \
  -H "Authorization: Bearer sk-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"

응답

{
  "code": 200,
  "msg": "ok",
  "data": {
    "task_id": "abcdef123456",
    "task_status": 3,
    "task_type": "image",
    "model_id": "gpt-image-2",
    "image_url": "https://your-cdn.com/...",
    "video_url": null,
    "audio_url": null,
    "credits": 15,
    "created_at": 1730000000
  }
}

task_status: 1 대기, 2 실행 중, 3 성공, 4 실패.

오류

  • code: 200 — 성공
  • code: 0 — 비즈니스 실패 (자세한 내용은 msg 필드 참조)
  • HTTP 401 — API 키가 잘못되었거나 누락됨