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

# Tasks & Polling

> task_id, terminal states, polling intervals, and output URLs.

## Why does generation return a task?

Image and video generation can take time. Create endpoints return a `task_id` so your app can poll for status without blocking the initial request.

## Which query endpoint should I use?

| Task type        | Query endpoint                |
| ---------------- | ----------------------------- |
| Image generation | `GET /query/image-generation` |
| Video generation | `GET /query/video-generation` |

## When should I stop polling?

Stop when `status` is `Success`, `Failed`, or `Cancelled`.

## Where do I find the final output?

For image tasks, successful responses include `output_images`. For video tasks, successful responses include `file_url`.

## How often should I poll?

For images, wait about 10 seconds before polling, then poll every few seconds. For videos, wait about 30 seconds before polling, then use a slower interval as the task ages. Avoid polling every second in production.

## Why do query endpoints use `message` instead of `msg`?

The create endpoints use `msg`, while query endpoints use `message` at the envelope level. Plan for both field names when parsing responses.
