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

# Bir Veo 3 videosu oluşturun

> POST /v1/videos ile CometAPI üzerinden eşzamansız olarak Veo 3.1 videoları oluşturun, ardından görevi sorgulayın ve tamamlanan MP4 dosyasını indirin.

Bu endpoint'i bir Veo 3.1 video görevi başlatmak için kullanın. API hemen bir görev kimliği döndürür; bu nedenle dönen `id` değerini saklayın ve terminal bir duruma ulaşana kadar görevi sorgulayın.

`POST /v1/videos` `multipart/form-data` kullanır; skaler kontrolleri form alanları olarak, medya girdilerini ise `input_reference` dosya alanları olarak iletin.

## Bir model seçin

| Model ID      | Ne zaman kullanılır                                                  | Notlar                   |
| ------------- | -------------------------------------------------------------------- | ------------------------ |
| `veo3.1-fast` | Çoğu kısa klip için varsayılan seçim                                 | Daha hızlı Veo 3.1 yolu. |
| `veo3.1`      | Özellikle standart Veo 3.1 modelini kullanmak istediğinizde kullanın | Standart Veo 3.1 yolu.   |

## Bir giriş modu seçin

| Amaç               | Gerekli alanlar                      | İsteğe bağlı alanlar |
| ------------------ | ------------------------------------ | -------------------- |
| Metinden videoya   | `model`, `prompt`                    | `seconds`, `size`    |
| Görüntüden videoya | `model`, `prompt`, `input_reference` | `seconds`, `size`    |

## Süre ve boyut ayarlayın

OpenAI uyumlu yol için, süre adına `seconds` ve çıktı boyutu için `size` kullanın. Değerleri form alanları olarak gönderin.

| Model ID      | `seconds`     | Varsayılan             |
| ------------- | ------------- | ---------------------- |
| `veo3.1-fast` | `4`, `6`, `8` | `4` saniye, `1280x720` |
| `veo3.1`      | `4`, `6`, `8` | `4` saniye, `1280x720` |

`size` değerini aşağıdaki WxH değerlerinden biri olarak ayarlayın.

| Çözünürlük katmanı | En-boy oranı | `size` (`WxH`) |
| ------------------ | ------------ | -------------- |
| `720p`             | `16:9`       | `1280x720`     |
|                    | `9:16`       | `720x1280`     |
| `1080p`            | `16:9`       | `1920x1080`    |
| `4K`               | `16:9`       | `3840x2160`    |

## Görev akışı

<Steps>
  <Step title="Görevi oluşturun">
    Multipart form isteğini gönderin ve dönen `id` değerini saklayın.
  </Step>

  <Step title="Görevi sorgulayın">
    `status` değeri `completed`, `failed` veya `error` olana kadar [Veo3 Retrieve](./retrieve) kullanın.
  </Step>

  <Step title="Sonucu indirin">
    Görev `completed` olduğunda, tamamlanan görev yanıtından MP4 dosyasını indirin.
  </Step>
</Steps>


## OpenAPI

````yaml api/openapi/video/veo3/post-create.openapi.json POST /v1/videos
openapi: 3.1.0
info:
  title: Veo 3.1 Async Generation API
  version: 1.0.0
  description: >-
    Create an asynchronous Veo 3.1 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 a Veo 3.1 video task
      description: >-
        Create a Veo 3.1 task through the OpenAI-compatible /v1/videos endpoint.
        Send fields as multipart/form-data.
      operationId: veo3_async_generation
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/VeoCreateRequest'
            examples:
              text_to_video:
                summary: Text-to-video
                value:
                  model: veo3.1-fast
                  prompt: A paper kite floats above a field.
                  seconds: '4'
                  size: 1280x720
      responses:
        '200':
          description: >-
            Task created. Store the returned id and poll GET
            /v1/videos/{task_id}.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VeoVideoTask'
              example:
                id: task_example
                task_id: task_example
                object: video
                model: veo3.1-fast
                status: queued
                progress: 0
                created_at: 1779938152
        '400':
          description: >-
            The request is missing a required field or contains a value that the
            selected model cannot use.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: The API key is missing or invalid.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      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=veo3.1-fast \
              -F 'prompt=A paper kite floats above a field.' \
              -F seconds=4 \
              -F size=1280x720
        - lang: Python
          label: Text-to-video
          source: |
            import os
            import requests

            fields = [
                ("model", (None, "veo3.1-fast")),
                ("prompt", (None, "A paper kite floats above a field.")),
                ("seconds", (None, "4")),
                ("size", (None, "1280x720")),
            ]

            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", "veo3.1-fast");
            form.append("prompt", "A paper kite floats above a field.");
            form.append("seconds", "4");
            form.append("size", "1280x720");

            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:
    VeoCreateRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          description: >-
            Veo 3.1 model ID. Use veo3.1-fast for the default route or veo3.1
            when you specifically need the standard model.
          enum:
            - veo3.1-fast
            - veo3.1
          example: veo3.1-fast
        prompt:
          type: string
          description: Text prompt for the video job.
          example: A paper kite floats above a field.
        seconds:
          type: string
          description: >-
            Requested clip duration. Use 4, 6, or 8. Send the value as a form
            field string.
          enum:
            - '4'
            - '6'
            - '8'
          default: '4'
          example: '4'
        size:
          type: string
          description: >-
            Supported WxH size values: 1280x720, 720x1280, 1920x1080, 3840x2160.
            Default is 1280x720.
          example: 1280x720
        input_reference:
          type: string
          format: binary
          description: Optional first-frame image file for image-to-video.
      additionalProperties: true
    VeoVideoTask:
      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: veo3.1-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.
          additionalProperties: true
      additionalProperties: true
    ErrorResponse:
      description: >-
        Error body returned when a request cannot be processed or the task
        fails.
      type: object
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer authentication. Use your CometAPI API key.

````