> ## 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.

# Omni 비디오 생성

> CometAPI를 통해 POST /v1/videos로 베타 Omni 비디오 작업을 생성한 다음, 작업을 폴링하고 완료된 MP4 파일을 다운로드합니다.

이 베타 엔드포인트를 사용해 Omni 비디오 작업을 생성합니다. API는 즉시 작업 ID를 반환하므로, 반환된 `id`를 저장하고 작업이 최종 상태에 도달할 때까지 폴링하세요.

<Badge color="orange" size="sm" shape="pill">베타</Badge>

`POST /v1/videos`는 `multipart/form-data`를 사용합니다. 스칼라 제어값은 form 필드로 전달하세요.

## 입력 모드 선택

| 목표        | 필수 필드             | 선택 필드                                   |
| --------- | ----------------- | --------------------------------------- |
| 텍스트-투-비디오 | `model`, `prompt` | `seconds`, `aspect_ratio`, `resolution` |

이 페이지에서는 `model=omni-fast`를 사용하세요.

## 길이, 비율, 해상도 설정

Omni는 입력과 선택한 route에 따라 생성 안정성이 달라질 수 있으므로 베타로 표시됩니다. 첫 번째 요청은 작게 시작한 다음, 특정 렌더링 길이나 프레임 크기에 의존하기 전에 완료된 비디오를 확인하세요.

| 설정             | 지원 값                           | 기본값    | 경계 동작                                                            |
| -------------- | ------------------------------ | ------ | ---------------------------------------------------------------- |
| `seconds`      | `4`부터 시작                       | `4`    | 이 엔드포인트가 베타인 동안에는 먼저 짧은 클립을 사용하세요.                               |
| `aspect_ratio` | `16:9`, `9:16`, `1:1`          | `16:9` | `9:16`은 세로형 출력을 렌더링할 수 있습니다. `1:1`은 허용될 수 있지만 가로형으로 렌더링될 수 있습니다. |
| `resolution`   | `720p`부터 시작; `1080p`도 허용될 수 있음 | `720p` | 현재 프로덕션 출력은 `1080p`를 요청해도 `720p`로 정규화될 수 있습니다.                   |

| 요청                                      | 관찰된 완료 프레임 |
| --------------------------------------- | ---------- |
| `resolution=720p`, `aspect_ratio=16:9`  | `1280x720` |
| `resolution=720p`, `aspect_ratio=9:16`  | `720x1280` |
| `resolution=720p`, `aspect_ratio=1:1`   | `1280x720` |
| `resolution=1080p`, `aspect_ratio=16:9` | `1280x720` |

이 엔드포인트는 베타이므로, `aspect_ratio`와 `resolution`은 생성 선호값으로 간주하고 최종 픽셀에 의존하기 전에 다운로드한 MP4를 확인하세요.

## 작업 흐름

<Steps>
  <Step title="작업 생성">
    multipart form 요청을 보내고 반환된 `id`를 저장합니다.
  </Step>

  <Step title="작업 폴링">
    `status`가 `completed` 또는 `failed`가 될 때까지 [Omni 비디오 조회](./retrieve)를 호출합니다.
  </Step>

  <Step title="결과 다운로드">
    작업이 `completed` 상태가 되면 [Omni 비디오 콘텐츠 조회](./retrieve-content)를 호출해 MP4 파일을 다운로드합니다.
  </Step>
</Steps>


## OpenAPI

````yaml api/openapi/video/omni/post-create.openapi.json POST /v1/videos
openapi: 3.1.0
info:
  title: Omni Video Create API
  version: 1.0.0
  description: >-
    Create an asynchronous beta Omni video task through CometAPI. Save the
    returned id, poll GET /v1/videos/{task_id}, and download the completed MP4
    file.
servers:
  - url: https://api.cometapi.com
security:
  - bearerAuth: []
paths:
  /v1/videos:
    post:
      summary: Create an Omni video task
      description: >-
        Create a beta Omni text-to-video task. Send request controls as
        multipart/form-data fields.
      operationId: omni_create_video
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/OmniCreateRequest'
            examples:
              text_to_video:
                summary: Text-to-video
                value:
                  model: omni-fast
                  prompt: Ocean waves rolling onto a sandy beach at golden hour
                  seconds: '4'
                  aspect_ratio: '16:9'
                  resolution: 720p
      responses:
        '200':
          description: >-
            Task accepted. Store the returned id and poll GET
            /v1/videos/{task_id}.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OmniVideoTask'
              example:
                id: task_example
                task_id: task_example
                object: video
                model: omni-fast
                status: queued
                progress: 0
                created_at: 1779938152
      security:
        - bearerAuth: []
      x-codeSamples:
        - lang: Shell
          label: Text-to-video
          source: |-
            curl https://api.cometapi.com/v1/videos \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -F model=omni-fast \
              -F 'prompt=Ocean waves rolling onto a sandy beach at golden hour' \
              -F seconds=4 \
              -F aspect_ratio=16:9 \
              -F resolution=720p
        - lang: Python
          label: Text-to-video
          source: |
            import os
            import requests

            fields = [
                ("model", (None, "omni-fast")),
                ("prompt", (None, "Ocean waves rolling onto a sandy beach at golden hour")),
                ("seconds", (None, "4")),
                ("aspect_ratio", (None, "16:9")),
                ("resolution", (None, "720p")),
            ]

            response = requests.post(
                "https://api.cometapi.com/v1/videos",
                headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
                files=fields,
                timeout=120,
            )

            response.raise_for_status()
            print(response.json())
        - lang: JavaScript
          label: Text-to-video
          source: >
            const form = new FormData();

            form.append("model", "omni-fast");

            form.append("prompt", "Ocean waves rolling onto a sandy beach at
            golden hour");

            form.append("seconds", "4");

            form.append("aspect_ratio", "16:9");

            form.append("resolution", "720p");


            const response = await fetch("https://api.cometapi.com/v1/videos", {
              method: "POST",
              headers: { Authorization: `Bearer ${process.env.COMETAPI_KEY}` },
              body: form,
            });


            const result = await response.json();

            console.log(result);
components:
  schemas:
    OmniCreateRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          description: Omni model ID for this endpoint. Use omni-fast for text-to-video.
          enum:
            - omni-fast
          example: omni-fast
        prompt:
          type: string
          description: Text prompt that describes the video to generate.
          example: Ocean waves rolling onto a sandy beach at golden hour
        seconds:
          type: string
          description: >-
            Requested clip duration in seconds. Start with 4 while this endpoint
            is beta.
          default: '4'
          example: '4'
        aspect_ratio:
          type: string
          description: >-
            Output aspect ratio preference. 16:9 and 9:16 are the most
            predictable; 1:1 can be accepted but may render as landscape.
          enum:
            - '16:9'
            - '9:16'
            - '1:1'
          default: '16:9'
          example: '16:9'
        resolution:
          type: string
          description: >-
            Output resolution preference. Start with 720p. 1080p can be accepted
            but current production output may normalize to 720p.
          example: 720p
      additionalProperties: false
    OmniVideoTask:
      type: object
      required:
        - id
        - object
        - model
        - status
        - progress
        - created_at
      properties:
        id:
          type: string
          description: Task ID. Use this value with retrieve and content endpoints.
          example: task_example
        task_id:
          type: string
          description: Compatibility alias for id when present.
          example: task_example
        object:
          type: string
          description: Object type. Video tasks return video.
          example: video
        model:
          type: string
          description: Model ID used for the task.
          example: omni-fast
        status:
          type: string
          description: >-
            Task lifecycle status. Poll until the value is completed, failed, or
            error.
          enum:
            - queued
            - in_progress
            - completed
            - failed
            - error
          example: queued
        progress:
          type: integer
          minimum: 0
          maximum: 100
          description: Task progress as a coarse percentage.
          example: 0
        created_at:
          type: integer
          description: Task creation time as a Unix timestamp in seconds.
          example: 1779938152
        completed_at:
          type: integer
          description: >-
            Task completion time as a Unix timestamp in seconds. This field
            appears on completed tasks.
          example: 1779938219
        video_url:
          type: string
          description: Temporary video delivery URL. This field appears on completed tasks.
          example: <temporary-video-url>
        error:
          type: object
          description: Failure details. This field appears when the task fails.
          properties:
            code:
              type: string
              description: Provider or CometAPI error code.
            message:
              type: string
              description: Human-readable failure reason.
            type:
              type: string
              description: Error category when returned.
          additionalProperties: true
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer authentication. Use your CometAPI API key.

````