FLUX 3 API
Vollständige API-Referenz für die FLUX 3-Modelle zur Videogenerierung. Alle Varianten verwenden den einheitlichen Endpunkt für Videoaufgaben.
Modellvarianten
Schnellvergleich
Alle vier Modelle unterstützen diese Seitenverhältnisse:
21:9, 2:1, 16:9, 4:3, 1:1, 3:4, 9:16
Endpunkt
POST /api/v1/video/task
Authentifizierung
Authorization: Bearer YOUR_API_KEY
FLUX 3 Text zu Video
Anfrageparameter
Erforderlich
Optional
Beispielanfrage
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model_name: 'flux-3.0-text-to-video',
prompt: 'A cinematic aerial shot of a coastal city at sunrise',
resolution: '1080p',
aspect_ratio: '16:9',
duration: 10,
sound: true,
}),
});
const { data } = await response.json();
const taskId = data.task_id;
FLUX 3 Bild zu Video
Anfrageparameter
Erforderlich
Optional
Beispielanfrage
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model_name: 'flux-3.0-image-to-video',
prompt: 'A gentle camera push forward with natural subject motion',
resolution: '1080p',
aspect_ratio: '16:9',
image_url: 'https://example.com/first-frame.jpg',
duration: 10,
sound: true,
}),
});
const { data } = await response.json();
const taskId = data.task_id;
FLUX 3 Start-Ende zu Video
Anfrageparameter
Erforderlich
Optional
Beispielanfrage
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model_name: 'flux-3.0-start-end-to-video',
prompt: 'Create a smooth cinematic transition with consistent lighting',
resolution: '720p',
aspect_ratio: '16:9',
image_url: 'https://example.com/start-frame.jpg',
image_end_url: 'https://example.com/end-frame.jpg',
duration: 8,
sound: true,
}),
});
const { data } = await response.json();
const taskId = data.task_id;
FLUX 3 Videoverlängerung
Das Eingabevideo muss im MP4-Format vorliegen, darf höchstens 15 Sekunden lang und nicht größer als 50 MB sein.
Anfrageparameter
Erforderlich
Optional
Beispielanfrage
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model_name: 'flux-3.0-video-extend',
prompt: 'Continue the scene as the subject walks toward the skyline',
resolution: '1080p',
aspect_ratio: '16:9',
video_url: 'https://example.com/source-video.mp4',
duration: 10,
sound: true,
}),
});
const { data } = await response.json();
const taskId = data.task_id;
Erste Antwort
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "submitted"
}
}
Polling-Antwort
Rufe GET /api/v1/video/{task_id} regelmäßig ab, um den Aufgabenstatus zu prüfen:
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "succeed",
"task_status_msg": null,
"task_result": {
"videos": [
{
"url": "https://example.com/generated-video.mp4"
}
]
}
}
}
Statuswerte
submitted: Aufgabe angenommen
processing: Videogenerierung läuft
succeed: Videogenerierung erfolgreich abgeschlossen
failed: Videogenerierung fehlgeschlagen
Bewährte Verfahren
- Seitenverhältnis: Wähle vor dem Absenden der Aufgabe das Verhältnis für den Zielkanal aus.
- Dauer: Verwende für jede Variante einen Wert von 5 bis 20 Sekunden.
- Eingabemedien: Verwende zugängliche Bild-URLs und eine MP4-Quelle innerhalb der Grenzwerte für die Videoverlängerung.
- Polling: Frage den Status alle 5–10 Sekunden ab, bis
task_status den Wert succeed oder failed hat.