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 Videogenerierung
- Asynchroner Verarbeitungsmodus, gibt eine Task-ID für spätere Abfragen zurück
- Einheitlicher Einstieg: Text-to-Video / Image-to-Video / Videofortsetzung / Draft-Zweistufig
- Ausgabe H.264 + AAC mit synchronem Audio, Dauer 5~20 Sekunden
- Auflösung hd / fhd, sieben Seitenverhältnisse
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"
}
}
Autorisierung
string
erforderlich
Alle Endpunkte erfordern eine Bearer-Token-AuthentifizierungHolen Sie Ihren API-Key von der API-Key-Verwaltungsseite:
Authorization: Bearer YOUR_API_KEY
Generierungsmodi
flux-3-video ist ein einheitlicher Einstieg: Der Modus wird aus den Feldern abgeleitet oder explizit mit mode gesetzt.
| Modus | Auslöser | Hinweise |
|---|---|---|
| Text-to-Video (t2v) | nur prompt | Reiner Text |
| Image-to-Video (i2v) | image_urls | Keyframes; siehe unten |
| Videofortsetzung (v2v) | video_url / video_urls | Höherer Stückpreis; bei Bild und Video gewinnt Fortsetzung |
| Draft → Final | draft:true oder draft_from_task_id | Günstige Vorschau, dann Final zum vollen Preis |
mode-Werte: t2v / i2v / v2v / draft_enhance oder offizielle Schreibweisen text-to-video / image-continuation / video-continuation. Explizites mode hat höchste Priorität.
Image-to-Video-Keyframe-Semantik
Die Reihenfolge inimage_urls ist semantisch — nicht sortieren oder deduplizieren:
| Anzahl | Bedeutung |
|---|---|
| 1 | Startframe |
| 2 | Erster Start, zweiter Endframe |
| 3~10 | Erster Start, letzter Ende, mittlere Frames gleichmäßig verteilt (duration explizit setzen) |
Anfrageparameter
string
erforderlich
Fester Wert:
flux-3-videoboolean
Standard:"false"
Legt fest, ob der Inhalt vor dem Absenden des Videoauftrags moderiert wird.
true: Prompts und Eingabebilder mitomni-moderation-latestprüfenfalseoder nicht angegeben: keine Moderationsanfrage und damit keine zusätzlichen Moderationskosten oder Verzögerung (Standard)
string
erforderlich
Prompt. Darf nicht gesendet werden, wenn
draft_from_task_id verwendet wird (wird abgelehnt).integer
Standard:"5"
Dauer in Sekunden, Ganzzahl 5~20, Standard
5duration: "auto" wird nicht unterstützt (Abrechnung braucht eine feste Sekundenzahl). Weglassen, "auto" oder Nicht-Ganzzahlen → als 5 Sekunden behandelt, ohne Fehler und ohne adaptive Länge.Bei Videofortsetzung kann die gelieferte Dauer kürzer sein als angefordert (z. B. Anfrage 5 s, Ergebnis 4 s). Die angeforderten Sekunden werden vorab belastet und die Differenz nach Abschluss erstattet; Endbetrag ist Query-
cost. Text/Image-to-Video zeigen diese Lücke nicht.string
Standard:"hd"
Auflösung
hd(Standard; akzeptiert auch720p)fhd(akzeptiert auch1080p)
hd ~1280×704 bei 16:9; fhd ~1920×1088.Draft-Modus (
draft:true) erlaubt nur hd.string
Standard:"auto"
SeitenverhältnisOptionen:
21:9, 2:1, 16:9, 4:3, 1:1, 3:4, 9:16 oder auto (Standard; wird aus Prompt und Assets automatisch gewählt)string[]
Image-to-Video-Keyframes, 1~10, öffentliche http(s)-URL oder Base64
string
Eingabevideo für Fortsetzung (mp4, öffentliche URL oder Base64)
string[]
Wie
video_url; verwendet das erste Element (Kompatibilität)boolean
Standard:"true"
Synchrones Audio erzeugen, Standard
true. false ergibt stummes Video (kein Rabatt)boolean
Standard:"false"
Draft-Modus: ~1/3 Preis niedrige Vorschauqualität; nur mit
resolution: hdstring
Draft → Final: ID Ihrer erfolgreichen Draft-Aufgabe
- Nur
resolutiondarf geändert werden; Prompt, Dauer, Bilder, Video nicht - Zum vollen Finalpreis abgerechnet; Draft-Gebühr wird nicht angerechnet
- Gegenseitig ausschließend mit
draft:true
integer
Standard:"2"
Moderations-Toleranz 0~4, Standard
2 (höher = permissiver)Nicht mit FLUX.2-Bildern (05) oder Kontext (06) verwechseln.
string
Expliziter Modus (optional); siehe Generierungsmodi
Draft-Modus
Zweistufiger Workflow, wenn Iteration teuer ist:Step 1 draft:true → ~1/3 Preis niedrige Vorschauqualität
Step 2 draft_from_task_id → Final zum vollen Preis mit Draft-Look
Draft erstellen
{
"model": "flux-3-video",
"prompt": "An orange cat jumps onto a sunlit wooden table",
"duration": 5,
"draft": true
}
Draft zu Final
{
"model": "flux-3-video",
"draft_from_task_id": "task_01K_DRAFT...",
"resolution": "fhd"
}
Anfragebeispiele
Text-to-Video (Hochformat)
{
"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 (Start + Endframe)
{
"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
}
Videofortsetzung
{
"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
}
Stummes Video
{
"model": "flux-3-video",
"prompt": "...",
"audio": false
}
Einschränkungen
| Limit | Wert |
|---|---|
| Dauer | Ganzzahl 5~20 (auto nicht unterstützt; 21 wird abgelehnt) |
| Keyframes | 1~10 |
| Auflösung | nur hd / fhd; Draft nur hd |
| Seitenverhältnis | Sieben Optionen oder auto |
safety_tolerance | 0~4 |
Häufige Submit-Fehler (meist nicht berechnet)
| Fall | Hinweise |
|---|---|
Fehlendes prompt | Erforderlich außer bei Draft-Finalisierung |
Ungültige resolution / aspect_ratio / duration | Außerhalb des Bereichs |
| Keyframes > 10 | Obergrenze überschritten |
Explizites i2v ohne Bilder / v2v ohne Video | Modus/Asset-Mismatch |
draft:true + fhd | Draft nur hd |
Ungültige / Nicht-Draft / unfertige draft_from_task_id | Finalisierungs-Vorbedingungen |
| Prompt / Dauer bei Finalisierung ändern | Nur resolution erlaubt |
Sowohl draft als auch draft_from_task_id | Gegenseitig ausschließend |
failed mit voller Rückerstattung.
Funktionsabdeckung
| Fähigkeit | Status |
|---|---|
| t2v / i2v / v2v | ✅ Auto oder explizites mode |
| Draft / Draft-Finalisierung | ✅ draft / draft_from_task_id |
| Synchrones Audio | ✅ Standard an; audio:false aus (kein Rabatt) |
Zeitgesteuerte Keyframes [Sekunden, Bild] | ❌ Nur gleichmäßig verteiltes Keyframe-Array |
duration: "auto" | ❌ Nicht unterstützt |
Response
integer
Statuscode; 200 bei Erfolg
array
Ergebnisse abfragenDie Videogenerierung ist asynchron. Abfragen Sie Aufgabenstatus abrufen.Empfohlenes Intervall 5~10 Sekunden; Client-Timeout 15 Minuten (20 s fhd ist langsamer). Gemessen ~60 s für
t2v + hd + 5 s.Bei Erfolg result.videos[0].url verwenden; Assets werden auf das Plattform-CDN gespiegelt. cost ist der Endbetrag. Bei Fehlern volle Rückerstattung.