К обзору модели

API-документация

Подробное подключение Task API для Seedance 2.5 Text-to-Video

API-документация

Эндпоинт

Базовый URLhttps://api.mashagpt.ru/v1
Эндпоинт
POST
/v1/tasks/seedance-v2-5-text-to-video
Авторизация
x-api-key: YOUR_API_KEY
илиAuthorization: Bearer YOUR_API_KEY

Как прикрепить изображение

В запрос модели файл не отправляется напрямую. Сначала загрузите файл в MashaGPT storage, получите публичный URL и передайте его в параметр firstFrameUrl, lastFrameUrl, referenceImageUrls, referenceAudioUrls.

Не передавайте в JSON blob:, file://, data:, base64 или сырые байты. Storage принимает multipart/form-data с одним полем file. Подробный контракт: /v1/storage/upload.

1. Загрузить файл
curl -X POST "https://api.mashagpt.ru/v1/storage/upload" \
  -H "x-api-key: YOUR_API_KEY" \
  -F "file=@./reference.png"

Ответ вернет URL вида https://static.mashagpt.ru/...

2. Передать URL в модель
curl -X POST "https://api.mashagpt.ru/v1/tasks/seedance-v2-5-text-to-video" \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
  "prompt": "Опишите желаемый результат",
  "firstFrameUrl": "https://static.mashagpt.ru/dl/mashagpt/reference.webp"
}'

Если файл уже доступен по публичному URL, его можно передать сразу. Загрузка через MashaGPT storage надежнее для файлов с компьютера.

Параметры запроса

ПараметрТипОписание
prompt*
stringText prompt describing the video content (max 5000 characters). Пример — A single 30-second tracking shot through a rainy neon market.
aspectRatio
stringДопустимые значения: 1:1, 16:9, 9:16, 4:3, 3:4, 21:9, adaptive. Output aspect ratio. Ignored for frame tasks: when firstFrameUrl or lastFrameUrl is set the provider accepts only "adaptive", so the value is normalized to it. По умолчанию — 16:9.
resolution
stringДопустимые значения: 480p, 720p. Output resolution. Price per second increases with resolution. По умолчанию — 720p.
duration*
numberVideo duration in seconds (4-30). Seedance 2.5 generates single takes of up to 30 seconds with native sound; price is per second based on resolution. Диапазон 4–30. Пример — 10.
fixedLens
booleanUse fixed/static camera (true) or dynamic camera movement (false).
firstFrameUrl
stringFirst frame image URL — use last frame of previous scene for continuity.
lastFrameUrl
stringLast frame image URL — specify the ending frame.
referenceImageUrls
string[]Reference image URLs for character/style consistency (up to 9, max 30MB each).
referenceAudioUrls
string[]Reference audio URLs for audio style (up to 3, 2-15s each, max 15MB).

Пример запроса и ответа

Запрос
curl -X POST https://api.mashagpt.ru/v1/tasks/seedance-v2-5-text-to-video \
  -H "Content-Type: application/json" \
  -H "x-api-key: YOUR_API_KEY" \
  -d '{
  "prompt": "A single 30-second tracking shot through a rainy neon market",
  "aspectRatio": "16:9",
  "resolution": "720p",
  "duration": 4
}'
Ответ
{
  "code": 200,
  "msg": "success",
  "data": {
    "taskId": "550e8400-e29b-41d4-a716-446655440000",
    "state": "queued"
  }
}

Асинхронная обработка

Модель работает асинхронно. После запроса вы получите taskId задачи для отслеживания статуса.

GET
/v1/tasks/{id}статус задачи
Проверка статуса задачи:
curl -X GET "https://api.mashagpt.ru/v1/tasks/{task_id}" \
  -H "x-api-key: YOUR_API_KEY"

Жизненный цикл задачи:

queuedprocessingcompleted|failed