Extend Videos
January 29, 2026 (May 11, 2026)
Table of contents
Extend a previously generated video with a new prompt. Creates an additional 8-second segment that continues from the last ~1 second of the source video.
- Video extension requires a paid Google AI subscription with remaining credits.
- The extended video inherits the aspect ratio from the source video (landscape or portrait).
- Extended videos have ~1 second overlap with the source videoβs last frame. Use
trimStartin POST /videos/concatenate to remove overlap when combining clips.
https://api.useapi.net/v1/google-flow/videos/extend
Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
API tokenis required, see Setup useapi.net for details.
Request Body
{
"mediaGenerationId": "user:12345-email:6a6f...-video:CAMaJDMx...",
"prompt": "The camera slowly pans right revealing a majestic waterfall"
}
mediaGenerationIdis required. ThemediaGenerationIdfrom a previously generated or extended video via POST /videos or POST /videos/extend.promptis required. Text description for the video extension (what happens next).modelis optional. Video generation model (default:veo-3.1-fast). Supported values:veo-3.1-fast,veo-3.1-quality,veo-3.1-lite,veo-3.1-lite-low-priority(Ultra $200 only, no credits, lower priority).countis optional. Number of video variations to generate (1-4, default: 1). Each variation uses a different seed.seedis optional. Random seed for reproducible results. If not specified, a random seed is generated. Whencount> 1, seeds are incremented (seed, seed+1, seed+2, β¦).asyncis optional, enables fire-and-forget mode (default:false). Whentrue, returns immediately with201 Createdand job metadata. Poll GET /jobs/jobIdfor completion status.replyUrlis optional, webhook URL for job status callbacks. Receives POST requests with job status updates (created,started,completed,failed). The JSON payload shape matches GET /jobs/jobIdresponse.replyRefis optional, custom reference string passed back in webhook callbacks.captchaToken,captchaRetry,captchaOrderare optional, mutually exclusive captcha parameters. See Captcha Parameters for details.
Responses
-
Video extended successfully. All video data is in the
media[]array.{ "jobId": "j1737312345678v-u12345-email:jo***@gmail.com-bot:google-flow", "media": [ { "name": "a1d95d21-75d2-482d-a354-14ef8802ce66", "projectId": "9f63078c-...redacted...", "workflowId": "fa986834-...redacted...", "workflowStepId": "CAE", "mediaMetadata": { "createTime": "2026-05-20T23:14:02.931677Z", "mediaTitle": "The camera slowly pans right revealing a majestic waterfall", "requestData": { "videoGenerationRequestData": { "...": "..." }, "clientPlatform": "CLIENT_PLATFORM_WEB" }, "mediaStatus": { "mediaGenerationStatus": "MEDIA_GENERATION_STATUS_SUCCESSFUL" }, "visibility": "PRIVATE" }, "video": { "generatedVideo": { "seed": 987654321, "prompt": "The camera slowly pans right revealing a majestic waterfall", "model": "veo_3_1_t2v", "baseImageMediaGenerationId": "", "isLooped": false, "aspectRatio": "VIDEO_ASPECT_RATIO_LANDSCAPE" }, "dimensions": { "length": "8s" }, "operation": { "name": "a1d95d21-...redacted..." } }, "mediaGenerationId": "user:12345-email:6a6f...-video:a1d95d21-...redacted...", "videoUrl": "https://flow-content.google/video/a1d95d21-...redacted...?Expires=...", "thumbnailUrl": "https://flow-content.google/image/a1d95d21-...redacted...?Expires=..." } ], "remainingCredits": 18760, "captcha": { "service": "AntiCaptcha", "taskId": "abc123...", "durationMs": 3500, "attempts": [ { "service": "AntiCaptcha", "taskId": "abc123...", "durationMs": 3500, "success": true } ] } } -
Job created in async mode (
async: true). Video extension is processing in the background.Use GET /jobs/
jobIdto poll for completion status.{ "jobid": "j1737312345678v-u12345-email:jo***@gmail.com-bot:google-flow", "type": "video", "status": "created", "created": "2026-01-29T12:34:56.789Z", "request": { "async": true, "prompt": "The camera slowly pans right revealing a majestic waterfall", "mediaGenerationId": "user:12345-email:6a6f...-video:CAMaJDMx..." }, "response": { "captcha": { "service": "AntiCaptcha", "taskId": "14af1dbb-885c-4e25-8121-7a79489dfd0e", "durationMs": 5357 } } } -
Invalid request.
{ "error": "Error message", "code": 400 } -
Invalid API token.
{ "error": "Unauthorized" } -
Request rejected by Google.
Recommendations:
- Ensure
captchaRetryis set to at least 3 (default). Try increasing to a higher value (e.g., 5) to see if that helps - If issues persist, contact useapi.net support
{ "error": { "code": 403, "details": [ { "@type": "type.googleapis.com/google.rpc.ErrorInfo", "reason": "PUBLIC_ERROR_SOMETHING_WENT_WRONG" } ], "message": "reCAPTCHA evaluation failed", "status": "PERMISSION_DENIED" } } - Ensure
-
Account not found or video not found.
{ "error": "Google Flow account [email protected] not found" } -
Video extension polling timeout (after 10 minutes).
{ "error": "Polling timeout" }
Model
-
Video extension completed. Returns extended video data with signed URLs.
{ jobId: string // Job identifier media: Array<{ // Preferred β use this instead of operations name: string // Media identifier (raw UUID) projectId: string workflowId?: string workflowStepId?: string // e.g. "CAE" mediaMetadata: { createTime?: string // ISO 8601 timestamp mediaTitle?: string // Extension prompt requestData?: object // Full Google Flow request payload mediaStatus: { mediaGenerationStatus: string // MEDIA_GENERATION_STATUS_SUCCESSFUL | FAILED error?: { code: number; message: string } } visibility?: string } video?: { generatedVideo: { seed: number prompt?: string // Extension prompt model: string // veo_3_1_t2v baseImageMediaGenerationId?: string // Source video media ID isLooped: boolean aspectRatio: string // VIDEO_ASPECT_RATIO_LANDSCAPE | PORTRAIT } dimensions?: { length?: string } // Duration string (e.g. "8s") operation: { name: string } } mediaGenerationId: string // Encoded reference ID for use in subsequent API calls videoUrl?: string // Signed video download URL (MP4, valid ~24h) thumbnailUrl?: string // Signed thumbnail download URL (JPEG, valid ~24h) }> remainingCredits?: number captcha?: { // Captcha metadata service: string // "CapSolver" | "AntiCaptcha" | "YesCaptcha" | "CapMonster" | "SolveCaptcha" | "2Captcha" | "EzCaptcha" | "UserProvided" taskId?: string durationMs: number attempts: Array<{ service: string taskId?: string durationMs: number success: boolean error?: string }> } } -
Job created and processing in background. Structure matches GET /jobs/
jobIdresponse.{ jobid: string // Job identifier type: 'video' // Job type status: 'created' // Job status created: string // ISO 8601 timestamp request: { async: true prompt: string // Extension prompt mediaGenerationId: string // Source video reference model?: string // "veo-3.1-fast" seed?: number replyUrl?: string replyRef?: string } response: { captcha?: { // Present when captcha was used service: string // Provider or "UserProvided" taskId?: string // Absent for UserProvided durationMs: number } } } -
Error response structure.
{ jobId?: string // Present for job-related errors error: string // Error summary message code?: number // HTTP status code response?: { // API response with error details error?: { code: number message: string status: string details?: Array<{ '@type': string reason: string }> } } }
Examples
-
# First generate a video curl -X POST \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"prompt": "A serene mountain landscape at sunset"}' \ "https://api.useapi.net/v1/google-flow/videos" > generate.json # Extract mediaGenerationId from the response MEDIA_ID=$(jq -r '.media[0].mediaGenerationId' generate.json) # Extend the video curl -X POST \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d "{\"mediaGenerationId\": \"$MEDIA_ID\", \"prompt\": \"The camera slowly pans right revealing a majestic waterfall\"}" \ "https://api.useapi.net/v1/google-flow/videos/extend" > extend.json # Extract extended video URL and download VIDEO_URL=$(jq -r '.media[0].videoUrl' extend.json) curl "$VIDEO_URL" --output extended_video.mp4 -
const token = 'YOUR_API_TOKEN'; // First generate a video const generateResponse = await fetch('https://api.useapi.net/v1/google-flow/videos', { method: 'POST', headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ prompt: 'A serene mountain landscape at sunset' }) }); const generated = await generateResponse.json(); // Prefer media[] over deprecated operations[] const mediaGenerationId = generated.media[0].mediaGenerationId; // Extend the video const extendResponse = await fetch('https://api.useapi.net/v1/google-flow/videos/extend', { method: 'POST', headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ mediaGenerationId, prompt: 'The camera slowly pans right revealing a majestic waterfall' }) }); const extended = await extendResponse.json(); // Prefer media[] over deprecated operations[] const videoUrl = extended.media[0].videoUrl; // Download extended video (Node.js) const videoResponse = await fetch(videoUrl); const videoBuffer = await videoResponse.arrayBuffer(); require('fs').writeFileSync('extended_video.mp4', Buffer.from(videoBuffer)); console.log('Extended video saved!'); -
import requests token = 'YOUR_API_TOKEN' headers = { 'Authorization': f'Bearer {token}', 'Content-Type': 'application/json' } # First generate a video generate_response = requests.post( 'https://api.useapi.net/v1/google-flow/videos', headers=headers, json={'prompt': 'A serene mountain landscape at sunset'} ) generated = generate_response.json() # Prefer media[] over deprecated operations[] media_generation_id = generated['media'][0]['mediaGenerationId'] # Extend the video extend_response = requests.post( 'https://api.useapi.net/v1/google-flow/videos/extend', headers=headers, json={ 'mediaGenerationId': media_generation_id, 'prompt': 'The camera slowly pans right revealing a majestic waterfall' } ) extended = extend_response.json() # Prefer media[] over deprecated operations[] video_url = extended['media'][0]['videoUrl'] # Download extended video video_response = requests.get(video_url) with open('extended_video.mp4', 'wb') as f: f.write(video_response.content) print('Extended video saved!')