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

# Midjourney 비디오 작업 생성

> CometAPI에서 POST /mj/submit/video를 사용해 Midjourney 비디오 작업을 제출하고, 파라미터를 설정하며, 생성된 비디오 출력의 처리 상태를 추적합니다.

이 엔드포인트를 사용하면 Midjourney 이미지 결과를 짧은 비디오 렌더링으로 변환할 수 있습니다.

## 호출하기 전에

* 완료된 Midjourney 이미지 결과 또는 지원되는 이미지 URL에서 시작하세요
* 반환된 task id를 비동기 워크플로의 시작으로 간주하세요
* 완성된 에셋은 다른 Midjourney 작업에 사용하는 것과 동일한 polling 엔드포인트를 통해 전달된다고 예상하세요

## 작업 흐름

<Steps>
  <Step title="비디오 작업 제출">
    렌더링을 시작하고 반환된 task id를 저장합니다.
  </Step>

  <Step title="작업이 완료될 때까지 polling">
    작업이 최종 상태에 도달하고 최종 비디오 URL을 노출할 때까지 [단일 작업 가져오기](./task-fetching-api/fetch-single-task)를 사용하세요.
  </Step>

  <Step title="출력 저장">
    제공자 전달 URL을 넘어 안정적인 보관이 필요하다면 완료된 비디오를 자체 스토리지로 이동하세요.
  </Step>
</Steps>


## OpenAPI

````yaml api/openapi/image/midjourney/post-submit-video.openapi.json POST /mj/submit/video
openapi: 3.1.0
info:
  title: Submit Video API
  version: 1.0.0
servers:
  - url: https://api.cometapi.com
security:
  - bearerAuth: []
paths:
  /mj/submit/video:
    post:
      summary: Submit Video
      operationId: submit_video
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - motion
                - image
              properties:
                prompt:
                  type: string
                  description: Text prompt to guide the video generation.
                motion:
                  type: string
                  description: Motion intensity of the generated video.
                  enum:
                    - low
                    - high
                  default: low
                image:
                  type: string
                  description: >-
                    First-frame image as a public URL or base64-encoded data
                    URI.
                  default: https://your-image-host/source.jpg
                action:
                  type: string
                  description: >-
                    Action to perform on an existing video task. When set,
                    `index` and `taskId` are required.
                index:
                  type: integer
                  description: >-
                    Zero-based index selecting which video variant to act on
                    from the parent task.
                taskId:
                  type: string
                  description: >-
                    Parent task id to continue from. Required when `action` is
                    set.
                state:
                  type: string
                  description: >-
                    Custom state string. Returned as-is in the task result and
                    webhook callback for your own tracking.
                noStorage:
                  type: boolean
                  description: >-
                    When `true`, return the original provider video URL instead
                    of a CometAPI-proxied link.
                videoType:
                  type: string
                  description: >-
                    Video model variant, e.g. `vid_1.1_i2v_480` (480p) or
                    `vid_1.1_i2v_720` (720p).
              default:
                motion: low
                image: https://your-image-host/source.jpg
            examples:
              Image to video:
                summary: >-
                  Image to video (replace the image URL with your first-frame
                  image)
                value:
                  prompt: A Bee in Flight
                  motion: low
                  image: https://your-image-host/first-frame.png
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: object
                required:
                  - code
                  - description
                  - result
                  - properties
                properties:
                  code:
                    type: integer
                    description: >-
                      Submission status code. `1` = submitted successfully
                      (`result` carries the task id). `21` = the action opened a
                      confirmation modal; continue with `/mj/submit/modal` using
                      the returned task id. `4` = parameter error; `description`
                      explains the cause.
                  description:
                    type: string
                  result:
                    type: string
                  properties:
                    type: object
                    required:
                      - prompt
                    properties:
                      prompt:
                        type: string
      x-codeSamples:
        - lang: Shell
          label: Default
          source: |
            curl https://api.cometapi.com/mj/submit/video \
              -H "Authorization: Bearer $COMETAPI_KEY" \
              -H "Content-Type: application/json" \
              -d '{
                "prompt": "The paper boat drifts slowly forward",
                "motion": "low",
                "image": "https://your-image-host/first-frame.png",
                "videoType": "vid_1.1_i2v_480"
              }'
        - lang: Python
          label: Default
          source: |
            import os
            import requests

            response = requests.post(
                "https://api.cometapi.com/mj/submit/video",
                headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
                json={
                    "prompt": "The paper boat drifts slowly forward",
                    "motion": "low",
                    "image": "https://your-image-host/first-frame.png",
                    "videoType": "vid_1.1_i2v_480",
                },
            )

            task = response.json()
            print(task["code"], task.get("result"))
        - lang: JavaScript
          label: Default
          source: >
            const response = await
            fetch("https://api.cometapi.com/mj/submit/video", {
                method: "POST",
                headers: {
                    Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
                    "Content-Type": "application/json",
                },
                body: JSON.stringify({
                    prompt: "The paper boat drifts slowly forward",
                    motion: "low",
                    image: "https://your-image-host/first-frame.png",
                    videoType: "vid_1.1_i2v_480",
                }),
            });


            const task = await response.json();

            console.log(task.code, task.result);
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer token authentication. Use your CometAPI key.

````