# Seedance 2.5 — /videos/generations

Генерация видео Seedance 2.5 (асинхронно): не указывайте image для режима текст в видео, укажите image (по умолчанию как первый кадр) для режима изображение в видео; длительность — любое целое число от 4 до 30 секунд, разрешение 480P/720P, размер 16:9/9:16/21:9/4:3/1:1/3:4, audio включает/выключает сгенерированную звуковую дорожку (по умолчанию true). Возвращает job id (HTTP 202); опрашивайте GET /v1/videos/jobs/{id} до status=succeeded, результат — в data[0].url (перезалитый mp4). Оплата посекундная, при ошибке — полный возврат.

**Эндпоинт:** `POST https://nezhagate.com/v1/videos/generations`

## Аутентификация
```
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json
```

## Тело запроса
| Параметр | Тип | Обязательный | Описание |
| --- | --- | --- | --- |
| `model` | string | Да | Model ID, here seedance-2.5. |
| `prompt` | string | Да | Text prompt describing the video, camera and motion. Max 5000 bytes (UTF-8; a Chinese character counts as 3). With multiple reference images you can address them as @Image1 / @Image2 in the prompt, e.g. "the character from @Image1 in the scene from @Image2"; without tokens the model decides on its own. |
| `duration` | integer | Нет | Length in seconds, any integer 4-30 (default 4); alias seconds. Billed per second. |
| `resolution` | string | Нет | Resolution: 480P / 720P (default 720P; each tier has its own rate, see the model page). |
| `size` | string | Нет | Aspect ratio: 16:9 / 9:16 / 1:1 / 4:3 / 3:4 (16:9 default); alias aspect_ratio. |
| `audio` | boolean | Нет | Генерировать ли аудиодорожку, по умолчанию true. |
| `image` | string | Нет | Изображение в видео: укажите референсное изображение (по умолчанию используется как первый кадр) — публичный URL, data: URI или base64; не указывайте для режима текст в видео. |
| `images` | array | Нет | Multiple reference images, up to 9 for this model. Each item may be a public URL, a data: URI, or base64. Exceeding the cap is rejected, never truncated. Alias: reference_images. |
| `image_role` | string | Нет | Как используются референсные изображения: first_frame (по умолчанию; второе изображение становится последним кадром) или reference (референсы объекта/стиля — используйте при нескольких изображениях). При передаче reference_images по умолчанию применяется reference. |
| `audio_reference` | string / array | Нет | Public http(s) URL(s) for reference audio, up to 3. Must accompany a reference image or video; alias audio_references (do not send both). |
| `video_references` | array | Нет | Public http(s) URL(s) for source video, up to 3. Public links only (a data: URI fails upstream); cannot combine with a reference image or first/last frame. |

## Пример запроса
```bash
# 1) submit -> 202 {"id":"img_...","status":"queued"}
curl https://nezhagate.com/v1/videos/generations -H 'Authorization: Bearer YOUR_API_KEY' -H 'Content-Type: application/json' -d '{"model": "seedance-2.5", "prompt": "a cat surfing a wave at sunset", "duration": 4, "resolution": "720P", "size": "16:9"}'
# image-to-video: also pass  "image": "https://example.com/first-frame.png"
# 2) poll every ~5s until status=succeeded, then read data[0].url
curl https://nezhagate.com/v1/videos/jobs/img_3f9a...c2 -H 'Authorization: Bearer YOUR_API_KEY'
```

## Ответ
```json
{
  "id": "img_3f9a...c2",
  "object": "video.generation.job",
  "status": "queued",
  "model": "seedance-2.5"
}
```