# Seedance 2.0 — /videos/generations

Генерация видео Seedance 2.0 (асинхронно): длительность — любое целое число от 5 до 15 секунд, разрешение 480P / 720P / 1080P (по умолчанию 720P, у каждого уровня своя цена), пять соотношений сторон, audio включает/выключает звуковую дорожку (по умолчанию true); для режима изображение в видео укажите image. Возвращает job id (HTTP 202); опрашивайте GET /v1/videos/jobs/{id}. Оплата посекундная, при ошибке — полный возврат.

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

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

## Тело запроса
| Параметр | Тип | Обязательный | Описание |
| --- | --- | --- | --- |
| `model` | string | Да | Model ID, here seedance-2.0. |
| `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 5-15 (default 5); alias seconds. Billed per second. |
| `resolution` | string | Нет | Resolution: 480P / 720P / 1080P (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 4 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 1. 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.0", "prompt": "a cat surfing a wave at sunset", "duration": 5, "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.0"
}
```