# Create Video

`POST /v1/videos/generations`

Start a video generation. Returns a task to poll.

Video is asynchronous: this call returns immediately with a task id, and you poll `GET /v1/videos/tasks/{id}` until it succeeds or fails.
Image-to-video models need an `image_url` your account generated. Failed generations are refunded automatically.

Base URL: `https://api.spicyapi.com`

## Authorizations

- `Authorization` (string, header, required): Bearer authentication header of the form `Bearer <token>`, where `<token>` is your SpicyAPI key (`sk-spicy-…`). Create one in the dashboard under API Keys.

## Body (application/json)

- `model` (string, required): A video model id, e.g. `spicy-pov-missionary-1`.
- `prompt` (string, required): What should happen in the clip.
- `image_url` (string, optional): First frame; must be one of your generated images. Required where `requires_image` is true. Optional on `spicy-motion-3` and `spicy-motion-3-fast`, which generate from text alone when it is omitted.
- `resolution` (string, optional): One of the model's `limits.resolutions` from `GET /v1/models`: `720P` or `1080P` on the wan2.x models, `480P`, `720P` or `1080P` on `spicy-motion-3` and `spicy-motion-3-fast`. Defaults to `720P`.
- `duration` (integer, optional): Seconds, between the model's `minDuration` and `maxDuration` (2 to 15 on the wan2.x models, 2 to 30 on `spicy-motion-3` and `spicy-motion-3-fast`). Defaults to 5.
- `negative_prompt` (string, optional): What to avoid.
- `audio` (boolean, optional): Generate audio where the model supports it.
- `seed` (integer, optional): Reproducibility seed.

## Request

```bash
curl --request POST \
  --url https://api.spicyapi.com/v1/videos/generations \
  --header 'Authorization: Bearer $SPICYAPI_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
    "model": "spicy-pov-missionary-1",
    "prompt": "slow build, steady rhythm",
    "image_url": "https://cdn.spicyapi.com/outputs/a1b2/req_8f2a91c4-0.png",
    "resolution": "720P",
    "duration": 5
  }'
```

## Response: 200 application/json

Successful Response

A task you can poll.

- `id` (string, required): Task id. Pass it to `GET /v1/videos/tasks/{id}`.
- `object` (string, required): Always `task`.
- `type` (string, required): Always `video`.
- `model` (string, required): The model generating the clip.
- `status` (string, required): `queued`, `processing`, `finalizing`, `succeeded`, or `failed`.
- `output` (object | null, optional): Null until the task succeeds.
  - `video_url` (string, required): Durable CDN URL of the finished clip.
- `error` (string | null, optional): Why the task failed, when it did.
- `cost_usd` (number, required): What this request cost, in US dollars, already debited from your balance.

```json
{
  "id": "task_5d9e2f10",
  "object": "task",
  "type": "video",
  "model": "spicy-pov-missionary-1",
  "status": "queued",
  "output": null,
  "error": null,
  "cost_usd": 0.875
}
```
