> ## Documentation Index
> Fetch the complete documentation index at: https://docs.heyaskr.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Video generation

> Create video with an async submit-and-poll flow.

Video generation is **asynchronous**: you submit a job, then poll for the result.

<Steps>
  <Step title="Submit a job">
    ```bash theme={null}
    curl https://api.heyaskr.ai/v1/videos \
      -H "Authorization: Bearer ASKR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "model": "kling-2.0",
        "prompt": "a paper boat sailing down a rain gutter, slow motion",
        "aspect_ratio": "16:9",
        "duration": "5"
      }'
    ```

    The response returns a job `id`, an `estimated_cost`, and `status: "pending"`.
  </Step>

  <Step title="Poll for the result">
    ```bash theme={null}
    curl https://api.heyaskr.ai/v1/videos/JOB_ID \
      -H "Authorization: Bearer ASKR_API_KEY"
    ```

    Poll every 5–10 seconds until `status` is `completed` (the response includes
    the video URL) or `failed`.
  </Step>
</Steps>

<Note>
  You are only charged when a job completes successfully. Failed jobs are not
  billed.
</Note>
