# Flux 3 Video API Documentation > LLM-optimized documentation for Flux 3 Video. Copy into your AI assistant for integration help. ## Overview **Model ID:** `flux-3-video` **Type:** Video Generation **Credit Cost:** 25 credits per video Flux 3 Video generation. Text-to-video or image-to-video up to 20 seconds with synchronized audio, or extend and transform an existing clip. ## Endpoint ``` POST https://pixeldojo.ai/api/v1/models/flux-3-video/run ``` ## Authentication All requests require an API key in the Authorization header: ``` Authorization: Bearer YOUR_API_KEY ``` Get your API key: https://pixeldojo.ai/api-platform/api-keys ## Input Parameters | Parameter | Type | Required | Default | Description | |-----------|------|----------|---------|-------------| | `prompt` | string | Yes | - | Text description of the video to generate | | `image` | url | No | - | Optional starting image for image-to-video. Billed at the text-to-video rate and supports the full 5 to 20 second range. Cannot be combined with video, and aspect_ratio is ignored — the image defines the frame. | | `last_frame_image` | url | No | - | Optional ending image. Requires image. The model generates the transition between the two frames. | | `video` | url | No | - | Optional public HTTPS URL of a clip to extend or transform. When set, the job runs in video-to-video mode (higher credit rate, duration capped at 15 seconds) and aspect_ratio is ignored — the source clip defines the frame. Cannot be combined with image or last_frame_image. | | `resolution` | enum | No | 720p | Video output resolution (Options: 720p, 1080p) | | `aspect_ratio` | enum | No | 16:9 | Video aspect ratio. Text-to-video only — ignored when a start frame or source video is supplied. (Options: 16:9, 9:16, 1:1, 4:3, 3:4...) | | `duration` | integer | No | 5 | Clip length in seconds. 5 to 20 for text-to-video; 5 to 15 when a source video is supplied. (min: 5, max: 20) | | `generate_audio` | boolean | No | true | Generate synchronized audio with the video | ## Supported Aspect Ratios - `16:9` - `9:16` - `1:1` - `4:3` - `3:4` - `21:9` ## Capabilities - Text to Video - Image to Video - Audio Generation ## Quick Start ### 1. Submit a Job ```bash curl -X POST "https://pixeldojo.ai/api/v1/models/flux-3-video/run" \ -H "Authorization: Bearer YOUR_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "prompt": "A cinematic drone shot over a glacier at sunrise", "duration": 5, "resolution": "720p", "aspect_ratio": "16:9" }' ``` **Response:** ```json { "jobId": "job_abc123...", "status": "pending", "statusUrl": "https://pixeldojo.ai/api/v1/jobs/job_abc123", "creditCost": 25, "creditsRemaining": 95 } ``` ### 2. Poll for Results ```bash curl "https://pixeldojo.ai/api/v1/jobs/job_abc123" \ -H "Authorization: Bearer YOUR_API_KEY" ``` **Completed Response:** ```json { "jobId": "job_abc123...", "status": "completed", "output": { "video": "https://temp.pixeldojo.ai/..." }, "creditCost": 25 } ``` ## Python Example ```python import requests import time API_KEY = "YOUR_API_KEY" # Submit job response = requests.post( "https://pixeldojo.ai/api/v1/models/flux-3-video/run", headers={ "Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json" }, json={ "prompt": "A cinematic drone shot over a glacier at sunrise", "duration": 5, "resolution": "720p", "aspect_ratio": "16:9" } ) job = response.json() job_id = job["jobId"] # Poll for completion while True: status_response = requests.get( f"https://pixeldojo.ai/api/v1/jobs/{'{job_id}'}", headers={"Authorization": f"Bearer {API_KEY}"} ) status = status_response.json() if status["status"] == "completed": print("Output:", status["output"]) break elif status["status"] == "failed": print("Error:", status.get("error")) break time.sleep(2) ``` ## JavaScript Example ```javascript const API_KEY = 'YOUR_API_KEY'; // Submit job const submitResponse = await fetch('https://pixeldojo.ai/api/v1/models/flux-3-video/run', { method: 'POST', headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ "prompt": "A cinematic drone shot over a glacier at sunrise", "duration": 5, "resolution": "720p", "aspect_ratio": "16:9" }) }); const job = await submitResponse.json(); // Poll for completion const pollForResult = async (jobId) => { while (true) { const statusResponse = await fetch(`https://pixeldojo.ai/api/v1/jobs/${jobId}`, { headers: { 'Authorization': `Bearer ${API_KEY}` } }); const status = await statusResponse.json(); if (status.status === 'completed') return status.output; if (status.status === 'failed') throw new Error(status.error); await new Promise(r => setTimeout(r, 2000)); } }; const output = await pollForResult(job.jobId); console.log('Output:', output); ``` ## Error Codes | Code | Status | Description | |------|--------|-------------| | `unauthorized` | 401 | Invalid or missing API key | | `insufficient_credits` | 402 | Not enough credits | | `invalid_request` | 400 | Invalid parameters | | `model_not_found` | 404 | Model ID not found | | `rate_limited` | 429 | Too many requests | | `internal_error` | 500 | Server error | ## Links - **Full Documentation:** https://pixeldojo.ai/api-platform/flux-3-video - **API Keys:** https://pixeldojo.ai/api-platform/api-keys - **Buy Credits:** https://pixeldojo.ai/api-platform/buy-credits - **All Models:** https://pixeldojo.ai/api/v1/models - **OpenAPI Spec:** https://pixeldojo.ai/api/openapi