메인 콘텐츠로 건너뛰기

Documentation Index

Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt

Use this file to discover all available pages before exploring further.

작업 유형에 맞는 provider 워크플로를 선택해 CometAPI 비디오 모델 문서를 사용하세요. 대부분의 비디오 엔드포인트는 비동기 작업을 생성하므로 task ID를 저장하고 polling을 사용해 결과를 조회해야 합니다. callback은 모델별 페이지에 callback 지원이 문서화되어 있을 때만 추가하세요.

비디오 API 선택하기

Sora 비디오 생성

Sora 비디오 작업을 생성합니다.

Sora 비디오 조회

Sora 비디오 작업을 조회합니다.

Runway image to video

이미지로 Runway 비디오를 생성합니다.

Kling text to video

텍스트 프롬프트(Prompt)로 Kling 비디오를 생성합니다.

Seedance 생성

Seedance 비디오 작업을 생성합니다.

xAI 비디오 생성

xAI 비디오 작업을 생성합니다.

비디오 작업 생성 및 polling

Models page 또는 model directory에서 비디오를 지원하는 model ID를 사용하세요. 아래 예제는 POST /v1/videos로 비디오 작업을 생성한 다음, 반환된 task ID를 작업이 최종 상태에 도달할 때까지 polling합니다.
이 예제들은 your-video-model-id 플레이스홀더를 사용합니다. 요청을 실행하기 전에 Models page 또는 model directory에서 사용 가능한 비디오 model ID로 교체하세요.
API playground와 엔드포인트 스키마를 사용하려면 CreateQuery를 여세요.
import os
import time
import requests

headers = {"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]}

create_response = requests.post(
    "https://api.cometapi.com/v1/videos",
    headers=headers,
    data={
        "model": "your-video-model-id",
        "prompt": "A calm camera move across a desk with a paper airplane",
    },
    timeout=30,
)
create_response.raise_for_status()
task = create_response.json()
task_id = task["id"]

terminal_statuses = {"completed", "failed", "error"}

while True:
    poll_response = requests.get(
        f"https://api.cometapi.com/v1/videos/{task_id}",
        headers=headers,
        timeout=30,
    )
    poll_response.raise_for_status()
    result = poll_response.json()
    print(result["status"], result.get("progress"))

    if result["status"] in terminal_statuses:
        print(result.get("video_url"))
        break

    time.sleep(10)

응답 예제

성공적인 생성 응답은 다음과 같을 수 있습니다. polling하기 전에 task ID를 저장하세요:
{
  "id": "task_example",
  "task_id": "task_example",
  "object": "video",
  "model": "your-video-model-id",
  "status": "queued",
  "progress": 0,
  "created_at": 1779872000
}
성공적인 polling 응답은 다음과 같을 수 있습니다. 완료된 응답에는 video_url이 포함될 수 있으며, 일부 provider 형식은 모델별 결과 필드나 해당 경로가 문서화된 경우 비디오 콘텐츠 경로를 사용합니다:
{
  "id": "task_example",
  "object": "video",
  "model": "your-video-model-id",
  "status": "completed",
  "progress": 100,
  "completed_at": 1779872300,
  "video_url": "https://example.com/generated-video.mp4"
}

예시 모델 레코드

이 예시 모델 카탈로그 응답은 /api/models envelope와 하나의 비디오 모델 레코드 형태를 보여줍니다. 전체 모델 목록은 아닙니다.
cURL
curl https://api.cometapi.com/api/models
{
  "success": true,
  "page": 1,
  "page_size": 20,
  "total": 302,
  "data": [
    {
      "created": 1767529753,
      "id": "your-video-model-id",
      "code": "your-video-model-id",
      "provider": "ExampleProvider",
      "provider_code": "example",
      "name": "Example video model",
      "model_type": "video",
      "features": [
        "text-to-video"
      ],
      "endpoints": "{\n  \"seedance\": {\n    \"path\": \"/v1/videos\",\n    \"method\": \"POST\"\n  }\n}",
      "pricing": {
        "currency": "USD / M Tokens",
        "input": null,
        "output": null,
        "per_request": null,
        "per_second": 0.024
      }
    }
  ]
}

일반적인 오류

작업 핸들러에서 반환하기 전에 생성 응답의 ID를 저장하세요.
상태 확인 사이에 지연과 backoff를 추가하세요.
선택한 비디오 엔드포인트에 문서화된 duration 및 resolution 필드를 사용하세요.
video_url은 선택 사항으로 처리하고, 사용 가능할 때는 모델별 결과 필드 또는 content 경로를 대신 사용하세요.
polling을 기준 정보로 사용하고 callback URL이 POST 요청을 받는지 확인하세요.

오류 코드 및 재시도 전략

프롬프트(Prompt), 파일, duration 또는 size 필드가 수정되기 전까지는 재시도하지 마세요.
API 키가 존재하고 유효해질 때까지는 재시도하지 마세요.
재시도하기 전에 task ID, base URL, path, model ID를 확인하세요.
재시도하기 전에 업로드 크기를 줄이세요.
exponential backoff로 재시도하고 생성 또는 polling 동시성을 줄이세요.
backoff를 사용해 작업 생성을 재시도하세요. 작업이 최종 오류 상태에 도달하지 않는 한 기존 작업에 대한 polling은 계속하세요.

가격 및 모델 디렉터리

Models page

문서에서 CometAPI가 model ID를 어떻게 제공하는지 알아보세요.

Model directory

사용 가능한 모델과 기능을 살펴보세요.

가격

모델을 호출하기 전에 가격을 확인하세요.
Last modified on May 28, 2026