Model Information
| Model ID | black-forest-labs/flux-3/text-to-video |
| Category | Video |
| Endpoint | /api/v1/videos |
| Input Modalities | text |
| Output Modalities | video, audio |
Create Task
POST https://mogu.io/api/v1/videosAuthentication: Authorization: Bearer <api-key>
Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| model | string | ✓ | Model ID: black-forest-labs/flux-3/text-to-video | |
| prompt | string | ✓ | Describe the scene, action, camera movement or requested edit | |
| timeout | number (60..3600) | 1800 | Maximum wait time in seconds | |
| duration | number (5..20) | 5 | Duration in whole seconds (5-20) | |
| resolution | enum: 720p | 1080p | "720p" | Output resolution | |
| aspect_ratio | enum: 21:9 | 2:1 | 16:9 | 4:3 | 1:1 | 3:4 | 9:16 | "9:16" | Output aspect ratio | |
| generate_audio | boolean | true | Generate synchronized audio |
Multimodal Output
This model can output video, audio. Add modalities to your request:
{
"model": "black-forest-labs/flux-3/text-to-video",
"messages": [
{
"role": "user",
"content": "Draw a cat"
}
],
"modalities": [
"video",
"audio"
]
}Image output does not support streaming. Set stream: false.
Code Examples
# Step 1: Create task
curl -X POST https://mogu.io/api/v1/videos \
-H "Authorization: Bearer <api-key>" \
-H "Content-Type: application/json" \
-d '{
"model": "black-forest-labs/flux-3/text-to-video",
"prompt": "Your prompt here",
"timeout": 1800,
"duration": 5,
"resolution": "720p",
"aspect_ratio": "9:16",
"generate_audio": true
}'
# Step 2: Poll for result
curl https://mogu.io/api/v1/videos/{task-id} \
-H "Authorization: Bearer <api-key>"Response
Create Response (202)
{
"id": "task-uuid",
"status": "pending",
"polling_url": "/api/v1/videos/task-uuid"
}Poll: GET https://mogu.io/api/v1/videos/:id — Completed
{
"id": "task-uuid",
"status": "completed",
"output": {
"urls": [
"https://cdn.example.com/video.mp4"
]
},
"credit": 4000
}Poll every 3-5 seconds. Status values: pending → in_progress → completed | failed
Error Codes
| HTTP | Type | Description |
|---|---|---|
| 400 | invalid_request_error | Invalid parameters |
| 400 | content_moderation | Content blocked by safety system |
| 400 | input_too_large | Input exceeds model limit |
| 401 | auth_error | Invalid API key |
| 402 | insufficient_credits | Not enough credits |
| 429 | rate_limit_error | Too many requests |
| 502 | provider_error | Upstream error, retry later |
| 504 | timeout_error | Request timed out |