curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "flux-3-video",
"prompt": "An orange cat jumps onto a sunlit wooden table, its tail brushes a glass that wobbles but does not fall. Cinematic, shallow depth of field.",
"duration": 5,
"resolution": "hd",
"aspect_ratio": "16:9"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "flux-3-video",
"prompt": "An orange cat jumps onto a sunlit wooden table, its tail brushes a glass that wobbles but does not fall. Cinematic, shallow depth of field.",
"duration": 5,
"resolution": "hd",
"aspect_ratio": "16:9",
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "flux-3-video",
prompt: "An orange cat jumps onto a sunlit wooden table, its tail brushes a glass that wobbles but does not fall. Cinematic, shallow depth of field.",
duration: 5,
resolution: "hd",
aspect_ratio: "16:9",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "flux-3-video",
"prompt": "An orange cat jumps onto a sunlit wooden table",
"duration": 5,
"resolution": "hd",
"aspect_ratio": "16:9",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Authentication failed, please check your API key",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient account balance, please top up and try again",
"type": "payment_required"
}
}
{
"error": {
"code": 422,
"message": "Parameter conflict or invalid value",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 429,
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}
FLUX 3 Video
Генерация видео FLUX 3
- Асинхронный режим обработки, возвращает ID задачи для последующих запросов
- Единая точка входа: text-to-video / image-to-video / продолжение видео / двухшаговый черновик
- Вывод H.264 + AAC с синхронным аудио, длительность 5~20 секунд
- Разрешение hd / fhd, семь соотношений сторон
POST
/
v1
/
videos
/
generations
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "flux-3-video",
"prompt": "An orange cat jumps onto a sunlit wooden table, its tail brushes a glass that wobbles but does not fall. Cinematic, shallow depth of field.",
"duration": 5,
"resolution": "hd",
"aspect_ratio": "16:9"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "flux-3-video",
"prompt": "An orange cat jumps onto a sunlit wooden table, its tail brushes a glass that wobbles but does not fall. Cinematic, shallow depth of field.",
"duration": 5,
"resolution": "hd",
"aspect_ratio": "16:9",
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "flux-3-video",
prompt: "An orange cat jumps onto a sunlit wooden table, its tail brushes a glass that wobbles but does not fall. Cinematic, shallow depth of field.",
duration: 5,
resolution: "hd",
aspect_ratio: "16:9",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "flux-3-video",
"prompt": "An orange cat jumps onto a sunlit wooden table",
"duration": 5,
"resolution": "hd",
"aspect_ratio": "16:9",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Authentication failed, please check your API key",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient account balance, please top up and try again",
"type": "payment_required"
}
}
{
"error": {
"code": 422,
"message": "Parameter conflict or invalid value",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 429,
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}
curl --request POST \
--url https://api.apimart.ai/v1/videos/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
"model": "flux-3-video",
"prompt": "An orange cat jumps onto a sunlit wooden table, its tail brushes a glass that wobbles but does not fall. Cinematic, shallow depth of field.",
"duration": 5,
"resolution": "hd",
"aspect_ratio": "16:9"
}'
import requests
url = "https://api.apimart.ai/v1/videos/generations"
payload = {
"model": "flux-3-video",
"prompt": "An orange cat jumps onto a sunlit wooden table, its tail brushes a glass that wobbles but does not fall. Cinematic, shallow depth of field.",
"duration": 5,
"resolution": "hd",
"aspect_ratio": "16:9",
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json",
}
response = requests.post(url, json=payload, headers=headers)
print(response.json())
const url = "https://api.apimart.ai/v1/videos/generations";
const payload = {
model: "flux-3-video",
prompt: "An orange cat jumps onto a sunlit wooden table, its tail brushes a glass that wobbles but does not fall. Cinematic, shallow depth of field.",
duration: 5,
resolution: "hd",
aspect_ratio: "16:9",
};
const headers = {
Authorization: "Bearer <token>",
"Content-Type": "application/json",
};
fetch(url, {
method: "POST",
headers: headers,
body: JSON.stringify(payload),
})
.then((response) => response.json())
.then((data) => console.log(data))
.catch((error) => console.error("Error:", error));
package main
import (
"bytes"
"encoding/json"
"fmt"
"io/ioutil"
"net/http"
)
func main() {
url := "https://api.apimart.ai/v1/videos/generations"
payload := map[string]interface{}{
"model": "flux-3-video",
"prompt": "An orange cat jumps onto a sunlit wooden table",
"duration": 5,
"resolution": "hd",
"aspect_ratio": "16:9",
}
jsonData, _ := json.Marshal(payload)
req, _ := http.NewRequest("POST", url, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
{
"code": 200,
"data": [
{
"status": "submitted",
"task_id": "task_01J9HA7JPQ9A0Z6JZ3V8M9W6PZ"
}
]
}
{
"error": {
"code": 400,
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 401,
"message": "Authentication failed, please check your API key",
"type": "authentication_error"
}
}
{
"error": {
"code": 402,
"message": "Insufficient account balance, please top up and try again",
"type": "payment_required"
}
}
{
"error": {
"code": 422,
"message": "Parameter conflict or invalid value",
"type": "invalid_request_error"
}
}
{
"error": {
"code": 429,
"message": "Too many requests, please try again later",
"type": "rate_limit_error"
}
}
Авторизация
string
обязательно
Все конечные точки требуют аутентификации Bearer TokenПолучите API Key на странице управления API Key:
Authorization: Bearer YOUR_API_KEY
Режимы генерации
flux-3-video — единая точка входа: режим выводится из полей или задаётся явно через mode.
| Режим | Триггер | Примечание |
|---|---|---|
| Text-to-video (t2v) | только prompt | Чистый текст |
| Image-to-video (i2v) | image_urls | Ключевые кадры; см. ниже |
| Продолжение видео (v2v) | video_url / video_urls | Более высокая цена; при наличии и изображения, и видео побеждает продолжение |
| Черновик → финал | draft:true или draft_from_task_id | Дешёвый превью, затем полный финал |
mode: t2v / i2v / v2v / draft_enhance или официальные text-to-video / image-continuation / video-continuation. Явный mode имеет наивысший приоритет.
Семантика ключевых кадров image-to-video
Порядок вimage_urls семантичен — не сортируйте и не удаляйте дубликаты:
| Количество | Значение |
|---|---|
| 1 | Стартовый кадр |
| 2 | Первый — старт, второй — конечный кадр |
| 3~10 | Первый — старт, последний — конец, средние кадры равномерно (задайте duration явно) |
Параметры запроса
string
обязательно
Фиксированное значение:
flux-3-videoboolean
по умолчанию:"false"
Выполнять ли проверку содержимого перед отправкой задачи генерации видео.
true: проверить промпты и входные изображения с помощьюomni-moderation-latestfalseили параметр не указан: не отправлять запрос на проверку, без дополнительных затрат и задержки (по умолчанию)
string
обязательно
Промпт. Нельзя отправлять при использовании
draft_from_task_id (будет отклонён).integer
по умолчанию:"5"
Длительность в секундах, целое 5~20, по умолчанию
5duration: "auto" не поддерживается (для биллинга нужна фиксированная длительность). Пропуск, "auto" или нецелые → трактуются как 5 секунд без ошибки и без адаптивной длины.При продолжении видео фактическая длительность может быть меньше запрошенной (например, запрос 5 с, результат 4 с). Предварительно списывается плата за запрошенные секунды, после завершения разница возвращается; итоговая сумма — в
cost запроса статуса. Для text/image-to-video такого разрыва нет.string
по умолчанию:"hd"
Разрешение
hd(по умолчанию; также принимается720p)fhd(также принимается1080p)
hd ~1280×704 при 16:9; fhd ~1920×1088.Режим черновика (
draft:true) только допускает hd.string
по умолчанию:"auto"
Соотношение сторонВарианты:
21:9, 2:1, 16:9, 4:3, 1:1, 3:4, 9:16 или auto (по умолчанию; выбирается автоматически по промпту и материалам)string[]
Ключевые кадры image-to-video, 1~10, публичный http(s) URL или base64
string
Входное видео для продолжения (mp4, публичный URL или base64)
string[]
То же, что
video_url; используется первый элемент (совместимость)boolean
по умолчанию:"true"
Генерировать синхронное аудио, по умолчанию
true. false даёт немое видео (без скидки)boolean
по умолчанию:"false"
Режим черновика: ~1/3 цены низкокачественный превью; только с
resolution: hdstring
Черновик → финал: ID вашей успешной черновой задачи
- Можно менять только
resolution; промпт, длительность, изображения, видео — нельзя - Тарифицируется по полной финальной цене; стоимость черновика не зачитывается
- Взаимоисключающе с
draft:true
integer
по умолчанию:"2"
Допуск модерации 0~4, по умолчанию
2 (выше = мягче)Не путать с FLUX.2 images (05) или Kontext (06).
string
Явный режим (необязательно); см. Режимы генерации
Режим черновика
Двухшаговый процесс, когда итерации дороги:Step 1 draft:true → ~1/3 цены низкокачественный превью
Step 2 draft_from_task_id → полный финал, совпадающий с видом черновика
Создать черновик
{
"model": "flux-3-video",
"prompt": "An orange cat jumps onto a sunlit wooden table",
"duration": 5,
"draft": true
}
Черновик в финал
{
"model": "flux-3-video",
"draft_from_task_id": "task_01K_DRAFT...",
"resolution": "fhd"
}
Примеры запросов
Text-to-video (портрет)
{
"model": "flux-3-video",
"prompt": "Rainy Tokyo street at night, neon in puddles, a person walks with an umbrella.",
"duration": 8,
"resolution": "fhd",
"aspect_ratio": "9:16"
}
Image-to-video (старт + конечный кадр)
{
"model": "flux-3-video",
"prompt": "Slow push-in as a flower opens from bud to bloom",
"image_urls": [
"https://example.com/bud.jpg",
"https://example.com/bloom.jpg"
],
"duration": 5
}
Продолжение видео
{
"model": "flux-3-video",
"prompt": "Camera keeps following as the lead turns toward a distant lighthouse",
"video_url": "https://example.com/clip.mp4",
"duration": 5
}
Немое видео
{
"model": "flux-3-video",
"prompt": "...",
"audio": false
}
Ограничения
| Ограничение | Значение |
|---|---|
| Длительность | Целое 5~20 (auto не поддерживается; 21 отклоняется) |
| Ключевые кадры | 1~10 |
| Разрешение | только hd / fhd; черновик только hd |
| Соотношение сторон | Семь вариантов или auto |
safety_tolerance | 0~4 |
Частые ошибки отправки (обычно без списания)
| Случай | Примечание |
|---|---|
Отсутствует prompt | Обязателен, кроме финализации черновика |
Недопустимые resolution / aspect_ratio / duration | Вне диапазона |
| Ключевые кадры > 10 | Превышен лимит |
Явный i2v без изображений / v2v без видео | Несоответствие режима и активов |
draft:true + fhd | Черновик только hd |
Недействительный / не-черновик / незавершённый draft_from_task_id | Предусловия финализации |
| Изменение prompt / duration при финализации | Разрешён только resolution |
Одновременно draft и draft_from_task_id | Взаимоисключающие |
failed с полным возвратом.
Покрытие возможностей
| Возможность | Статус |
|---|---|
| t2v / i2v / v2v | ✅ Авто или явный mode |
| Черновик / финализация | ✅ draft / draft_from_task_id |
| Синхронное аудио | ✅ По умолчанию вкл.; audio:false выкл. (без скидки) |
Временные ключевые кадры [секунды, изображение] | ❌ Только равномерно распределённый массив |
duration: "auto" | ❌ Не поддерживается |
Response
integer
Код статуса; 200 при успехе
array
Запрос результатовГенерация видео асинхронна. Опрашивайте Получить статус задачи.Рекомендуемый интервал 5~10 секунд; таймаут клиента 15 минут (20 с fhd медленнее). Измерения ~60 с для
t2v + hd + 5 с.При успехе используйте result.videos[0].url; активы зеркалируются на CDN платформы. cost — итоговая сумма. При сбоях — полный возврат.