> ## 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 Wan videosu oluştur

> CometAPI üzerinden POST /v1/videos ile bir Wan metinden videoya görevi oluşturun, ardından görevi sorgulayın ve tamamlanan MP4 dosyasını indirin.

Bu endpoint'i kullanarak bir Wan metinden videoya görevi oluşturun. API hemen bir görev kimliği döndürür, bu nedenle döndürülen `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 iletin.

## Bir model seçin

| Model ID | Girdi modu       |
| -------- | ---------------- |
| `wan2.7` | Metinden videoya |
| `wan2.6` | Metinden videoya |

## Süreyi ve boyutu ayarlayın

| Model ID | `seconds`         | Varsayılan              |
| -------- | ----------------- | ----------------------- |
| `wan2.7` | tam sayı `2`-`15` | `5` saniye, `1920x1080` |
| `wan2.6` | `5`, `10`, `15`   | `5` saniye, `1920x1080` |

Hedef model için `size` değerini aşağıdaki WxH değerlerinden biri olarak ayarlayın.

### Wan 2.7 boyut değerleri

| Çözünürlük seviyesi | En-boy oranı | `size` (`WxH`) |
| ------------------- | ------------ | -------------- |
| `720p`              | `16:9`       | `1280x720`     |
|                     | `9:16`       | `720x1280`     |
| `1080p`             | `16:9`       | `1920x1080`    |
|                     | `9:16`       | `1080x1920`    |
|                     | `1:1`        | `1440x1440`    |

### Wan 2.6 boyut değerleri

| Çözünürlük seviyesi | En-boy oranı | `size` (`WxH`) |
| ------------------- | ------------ | -------------- |
| `720p`              | `16:9`       | `1280x720`     |
|                     | `9:16`       | `720x1280`     |
|                     | `4:3`        | `1088x832`     |
|                     | `3:4`        | `832x1088`     |
| `1080p`             | `16:9`       | `1920x1080`    |
|                     | `9:16`       | `1080x1920`    |
|                     | `1:1`        | `1440x1440`    |
|                     | `4:3`        | `1632x1248`    |
|                     | `3:4`        | `1248x1632`    |

## Görev akışı

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

  <Step title="Görevi sorgula">
    `status` değeri `completed`, `failed` veya `error` olana kadar [Bir Wan videosunu al](./retrieve) çağrısını yapın.
  </Step>

  <Step title="Sonucu indir">
    Görev `completed` olduğunda, MP4 dosyasını indirmek için [Wan video içeriğini al](./retrieve-content) çağrısını yapın.
  </Step>
</Steps>


## OpenAPI

````yaml api/openapi/video/wan/post-create.openapi.json POST /v1/videos
openapi: 3.1.0
info:
  title: Wan Video Create API
  version: 1.0.0
  description: >-
    Create an asynchronous Wan text-to-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 Wan video task
      description: Create a Wan text-to-video task. Send fields as multipart/form-data.
      operationId: wan_create_video
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/WanCreateRequest'
            examples:
              text_to_video:
                summary: Text-to-video
                value:
                  model: wan2.6
                  prompt: >-
                    A small robot walks through a bright greenhouse with smooth
                    camera movement.
                  seconds: '5'
                  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/WanVideoTask'
              example:
                id: task_example
                task_id: task_example
                object: video
                model: wan2.6
                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=wan2.6 \
              -F 'prompt=A small robot walks through a bright greenhouse with smooth camera movement.' \
              -F seconds=5 \
              -F size=1280x720
        - lang: Python
          label: Text-to-video
          source: |
            import os
            import requests

            fields = [
                ("model", (None, "wan2.6")),
                ("prompt", (None, "A small robot walks through a bright greenhouse with smooth camera movement.")),
                ("seconds", (None, "5")),
                ("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", "wan2.6");

            form.append("prompt", "A small robot walks through a bright
            greenhouse with smooth camera movement.");

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

            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:
    WanCreateRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          description: Wan model ID for this endpoint.
          enum:
            - wan2.6
            - wan2.7
          example: wan2.6
        prompt:
          type: string
          description: Text prompt that describes the video to generate.
          example: >-
            A small robot walks through a bright greenhouse with smooth camera
            movement.
        seconds:
          type: string
          description: >-
            Requested clip duration in seconds. For wan2.6, use 5, 10, or 15.
            For wan2.7, use an integer from 2 through 15. Default is 5.
          example: '5'
        size:
          type: string
          description: >-
            Supported WxH size values. For wan2.6: 1280x720, 720x1280, 1088x832,
            832x1088, 1920x1080, 1080x1920, 1440x1440, 1632x1248, 1248x1632. For
            wan2.7: 1280x720, 720x1280, 1920x1080, 1080x1920, 1440x1440. Default
            is 1920x1080.
          example: 1280x720
      additionalProperties: false
    WanVideoTask:
      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: wan2.6
        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 created or the task fails.
      type: object
      additionalProperties: true
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Bearer authentication. Use your CometAPI API key.

````