Concatenate Videos
January 29, 2026 (November 16, 2026)
Table of contents
Concatenate multiple previously generated videos into a single video. This is a synchronous operation that returns base64-encoded video data.
- Combines 2-10 videos into a single video file.
- Each clip contributes its full recorded length: 8 seconds for a standard Veo clip, 4 or 6 seconds for the short Veo durations, up to 10 seconds for an Omni 1.1 Flash clip, up to 15 seconds for an Omni 1.2 Flash clip, and just under 40 seconds for an Omni 1.2 Flash extension. Earlier versions cut every clip at 8 seconds, which silently dropped the last 2 seconds of each 10-second Omni clip.
- All videos must have the same aspect ratio (all landscape or all portrait).
- No captcha required - this endpoint doesn’t require reCAPTCHA solving.
- Joining videos costs no Google Flow credits: the account’s credit balance read the same before and after a concatenation (measured September 18, 2026).
- Optional trimming allows removing frames from the start/end of each video for smoother transitions.
- Returns large base64-encoded video data (~7MB per input video).
- Concatenation typically completes within 15-25 seconds, occasionally up to about a minute when Google’s first export fails and has to be restarted.
- Google’s export sometimes fails outright. When it does, this endpoint answers
408in well under a minute rather than waiting out the full timeout, and retrying the same request is free — it costs no credits.
https://api.useapi.net/v1/google-flow/videos/concatenate
Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
API tokenis required, see Setup useapi.net for details.
Request Body
{
"media": [
{ "mediaGenerationId": "user:12345-email:6a6f...-video:CAMaJDMx..." },
{ "mediaGenerationId": "user:12345-email:6a6f...-video:CAMaJDMy...", "trimStart": 0.5 },
{ "mediaGenerationId": "user:12345-email:6a6f...-video:CAMaJDMz...", "trimEnd": 1 }
]
}
mediais required. Array of 2-10 video references to concatenate. Each item contains:mediaGenerationIdis required. ThemediaGenerationIdfrom a previously generated or extended video.trimStartis optional. Seconds to trim from the start of this video (0-60, default: 0). When joining a Veo extension to its source, usetrimStart: 1to remove the ~1 second overlap. An Omni 1.2 Flash extension already holds its source, so it needs no join.trimEndis optional. Seconds to trim from the end of this video (0-60, default: 0).trimStartplustrimEndmust be less than the clip’s own length, otherwise the request returns400.- Clips from POST /videos/upscale can be joined too, and the output keeps their resolution. Google records no length on an upscaled clip, so its length is taken from the clip it was upscaled from.
Notes:
- All videos must belong to the same Google Flow account (same email).
- All videos must have the same aspect ratio.
- Videos are concatenated in the order provided.
- Omni 1.1 Flash edits chained from one source all re-render the same time window, so joining them repeats the source motion with each edit applied. See the video reference notes on POST /videos.
Responses
-
Videos concatenated successfully. Returns job ID and base64-encoded video data.
{ "jobId": "j1115124012345270981v-u12345-email:john@gmail.com-bot:google-flow", "status": "MEDIA_GENERATION_STATUS_SUCCESSFUL", "inputsCount": 3, "encodedVideo": "AAAAIGZ0eXBpc29t...~21MB base64...", "backend": "flow" } -
Invalid request.
{ "error": "Parameter media must have at least 2 videos", "code": 400 } -
Invalid API token.
{ "error": "useapi.net ⁝ Unauthorized", "code": 401 } -
Your useapi.net subscription is missing or has expired, so nothing was sent to Google. Subscribe or renew it, then send the request again.
{ "error": "useapi.net ⁝ Your account has no subscription, please subscribe to our services before submitting requests", "code": 402 }When the subscription has expired:
{ "error": "useapi.net ⁝ Monthly subscription 261008 expired, please renew your subscription before submitting new requests.", "code": 402 } -
Account not found or video not found.
{ "error": "Google Flow account john@gmail.com not found", "code": 404 } -
Concatenation polling timeout (after 3 minutes).
{ "error": "Polling timeout", "code": 408 } -
Google Flow could not be reached for this request, so nothing was made. Retry shortly. If Google signed the account out, the API re-verifies it on its own and the account answers
596meanwhile.{ "error": { "code": 503, "message": "flow.google.com unavailable for this request — retry", "status": "UNAVAILABLE", "details": [] } } -
596 Session Error
Google rejected the account’s session, and the API is re-verifying the account on its own: retry in about a minute. If Google signed the account out, the account keeps answering
596and you get a reconnect email: add it again by following Setup Google Flow.{ "error": "Google Flow account john@gmail.com Google rejected this account session (HTTP 401). We are automatically re-verifying it — please retry in about a minute. If the account was signed out, you will receive a reconnect email.", "code": 596 }
Model
The joined video as Base64 MP4 data, with the job id and the number of input videos.
The joined video, field by field
{
jobId: string // the job id
status: 'MEDIA_GENERATION_STATUS_SUCCESSFUL' // always this value on a 200
inputsCount: number // number of input videos
encodedVideo: string // Base64-encoded MP4 (~7MB per input, decode and save as .mp4)
backend: 'flow' // the video was joined on `flow.google.com`
}
When the request fails:
{
jobId?: string // the job id, when the job had been created
error: string | { // what went wrong, e.g. "Concatenation failed" or "Polling timeout", or Google's error object when the request failed before the job was created
code: number // HTTP status Google answered, e.g. 503
message: string // the error message
status: string // Google's status name, e.g. "UNAVAILABLE"
details: Array<{ // Google's error details
'@type': string // the type name of the detail
reason: string // Google's reason code
}>
}
code?: number // the HTTP status, with our own text
response?: { // what Google answered, when the job had been created
error?: string | { // Google's error when Google refused the request, or our own text (a polling timeout)
code: number // HTTP status Google answered
message: string // the error message
status: string // Google's status name, e.g. "INTERNAL"
details: Array<{ // Google's error details
'@type': string // the type name of the detail
reason: string // Google's reason code
}>
}
head?: unknown[] // Google's raw status record of a failed export ("Concatenation failed")
backend?: 'flow' // with head: the video was joined on `flow.google.com`
}
}
Examples
-
# Generate first video curl -X POST \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"prompt": "A serene mountain landscape at sunrise"}' \ "https://api.useapi.net/v1/google-flow/videos" > video1.json # Generate second video (or extend the first) curl -X POST \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d '{"prompt": "The sun rises higher, birds fly across the sky"}' \ "https://api.useapi.net/v1/google-flow/videos" > video2.json # Extract mediaGenerationIds VIDEO1_ID=$(jq -r '.media[0].mediaGenerationId' video1.json) VIDEO2_ID=$(jq -r '.media[0].mediaGenerationId' video2.json) # Concatenate videos curl -X POST \ -H "Authorization: Bearer YOUR_API_TOKEN" \ -H "Content-Type: application/json" \ -d "{\"media\": [{\"mediaGenerationId\": \"$VIDEO1_ID\"}, {\"mediaGenerationId\": \"$VIDEO2_ID\", \"trimStart\": 0.5}]}" \ "https://api.useapi.net/v1/google-flow/videos/concatenate" > concat.json # Decode base64 and save as MP4 jq -r '.encodedVideo' concat.json | base64 -d > concatenated_video.mp4 -
const token = 'YOUR_API_TOKEN'; // Assume you have two video mediaGenerationIds const videoId1 = 'user:12345-email:6a6f...-video:CAMaJDMx...'; const videoId2 = 'user:12345-email:6a6f...-video:CAMaJDMy...'; // Concatenate videos const concatResponse = await fetch('https://api.useapi.net/v1/google-flow/videos/concatenate', { method: 'POST', headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' }, body: JSON.stringify({ media: [ { mediaGenerationId: videoId1 }, { mediaGenerationId: videoId2, trimStart: 0.5 } // Trim 0.5s from start for smooth transition ] }) }); const result = await concatResponse.json(); // Decode base64 and save (Node.js) const buffer = Buffer.from(result.encodedVideo, 'base64'); require('fs').writeFileSync('concatenated_video.mp4', buffer); console.log('Concatenated video saved!'); // Or use in browser as data URL for preview const dataUrl = `data:video/mp4;base64,${result.encodedVideo}`; document.getElementById('video-player').src = dataUrl; -
import requests import base64 token = 'YOUR_API_TOKEN' headers = { 'Authorization': f'Bearer {token}', 'Content-Type': 'application/json' } # Assume you have two video mediaGenerationIds video_id_1 = 'user:12345-email:6a6f...-video:CAMaJDMx...' video_id_2 = 'user:12345-email:6a6f...-video:CAMaJDMy...' # Concatenate videos concat_response = requests.post( 'https://api.useapi.net/v1/google-flow/videos/concatenate', headers=headers, json={ 'media': [ {'mediaGenerationId': video_id_1}, {'mediaGenerationId': video_id_2, 'trimStart': 0.5} # Trim 0.5s for smooth transition ] } ) result = concat_response.json() # Decode base64 and save video_data = base64.b64decode(result['encodedVideo']) with open('concatenated_video.mp4', 'wb') as f: f.write(video_data) print(f'Concatenated video saved! ({len(video_data)} bytes)')