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

# Async tasks: create, poll, download

> Shared asynchronous lifecycle for all video models: status values, polling intervals, downloading, and failure handling

> [!NOTE]
>
> **Key points for AI agents**
>
> 1. Create a task with `POST https://1788.love/v1/videos` and save the returned `id`.
> 2. Poll `GET https://1788.love/v1/videos/{id}` every 3–5 seconds until `status` is `completed` or `failed`.
> 3. Once `completed`, download the MP4 from `GET https://1788.love/v1/videos/{id}/content` with your API key and follow redirects.
> 4. Every video model (Seedance, Grok, MiniMax H3, Muse, WAN, KLING) follows this exact same workflow.

## 1. Create a task

```http theme={null}
POST https://1788.love/v1/videos
Authorization: Bearer YOUR_1788_API_KEY
Content-Type: application/json
```

Fill the request body according to the target model page. Example response:

```json theme={null}
{ "id": "task_xxxxxxxx", "object": "video", "model": "seedance-hc-2.5", "status": "queued", "progress": 0, "created_at": 1793500000 }
```

Invalid parameters immediately return a 4xx error; no task is created and nothing is charged.

## 2. Poll task status

```http theme={null}
GET https://1788.love/v1/videos/{id}
Authorization: Bearer YOUR_1788_API_KEY
```

| `status` | Meaning | Next step |
| - | - | - |
| `queued` | Waiting in queue | Keep polling |
| `in_progress` (some models return `processing`) | Generating (`progress` is 0–100) | Keep polling |
| `completed` | Finished | Download video |
| `failed` | Failed; see `error.message` | Not charged; adjust and retry |

Treat `completed`, `succeeded`, and `success` as done; treat `failed`, `error`, and `canceled` as failed; keep polling for all other states. Generation usually takes 1–10 minutes (longer for long clips or peak hours). Set an overall timeout of at least 30 minutes.

## 3. Download the video

```bash theme={null}
curl -L https://1788.love/v1/videos/{id}/content \
  -H "Authorization: Bearer YOUR_1788_API_KEY" \
  -o result.mp4
```

* The endpoint returns video bytes directly or redirects to storage—always follow redirects (`curl -L`; Python `requests` follows redirects by default).
* The status payload may also include a `url` field, but `/content` works consistently across all models and is recommended.
* Output files are retained temporarily; download and persist them to your own storage promptly.

## Integrating from another New API instance?

If your downstream platform also runs New API, select channel type `Sora` (not `OpenAI`) and set Base URL to `https://1788.love`. See [Downstream New API integration](https://docs.1788.love/en/guides/new-api-sora-channel.md).

## Best practices

* Poll every 3–5 seconds—avoid tighter loops. Back off if you receive `429`.
* Control concurrency when submitting batches and poll each task by its `id`.
* Persist the task `id` in your database so you can resume polling after a restart without resubmitting.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.