Video Audio Merge Serverless API
Effortlessly merge audio and video with our intuitive Video Audio Merge model. Create stunning multimedia content with precise timing, fade effects, and customizable audio options. Perfect for content creators, filmmakers, and marketers.
POST /v2/video-audio-merge · submit + poll 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3from segmind import SegmindClient, InferenceFailed, InferenceTimeout
4
5# Async (v2) — recommended for long-running / video models.
6# run() blocks up to 600s; submit_async + job.wait(timeout=...) sets a longer
7# deadline and keeps the request_id so you can re-poll later.
8client = SegmindClient() # reads SEGMIND_API_KEY
9payload = {
10 "input_video": "https://segmind-sd-models.s3.amazonaws.com/display_images/video-audio-merge-input.mp4",
11 "input_audio": "https://segmind-sd-models.s3.amazonaws.com/display_images/audio-merge-input-aud.mp3",
12 "video_start": 0,
13 "video_end": -1,
14 "audio_start": 0,
15 "audio_end": -1,
16 "audio_fade_in": 0,
17 "audio_fade_out": 0,
18 "override_audio": False,
19 "merge_intensity": 0.5,
20}
21job = client.submit_async("video-audio-merge", **payload)
22print(job.request_id) # available immediately
23try:
24 result = job.wait(timeout=900, interval=2.0)
25 print(result["status"]) # COMPLETED
26 print(result.get("output")) # model output (e.g. video URL)
27except InferenceTimeout as e:
28 print("still running:", e.request_id) # re-poll later with this id
29except InferenceFailed as e:
30 print("failed:", e.detail)
31
32# Fast models (<=600s) can use the one-liner instead:
33# result = segmind.run("video-audio-merge", **payload) 1# pip install "segmind>=1.1.0"
2# export SEGMIND_API_KEY="YOUR_API_KEY"
3from segmind import SegmindClient, InferenceFailed, InferenceTimeout
4
5# Async (v2) — recommended for long-running / video models.
6# run() blocks up to 600s; submit_async + job.wait(timeout=...) sets a longer
7# deadline and keeps the request_id so you can re-poll later.
8client = SegmindClient() # reads SEGMIND_API_KEY
9payload = {
10 "input_video": "https://segmind-sd-models.s3.amazonaws.com/display_images/video-audio-merge-input.mp4",
11 "input_audio": "https://segmind-sd-models.s3.amazonaws.com/display_images/audio-merge-input-aud.mp3",
12 "video_start": 0,
13 "video_end": -1,
14 "audio_start": 0,
15 "audio_end": -1,
16 "audio_fade_in": 0,
17 "audio_fade_out": 0,
18 "override_audio": False,
19 "merge_intensity": 0.5,
20}
21job = client.submit_async("video-audio-merge", **payload)
22print(job.request_id) # available immediately
23try:
24 result = job.wait(timeout=900, interval=2.0)
25 print(result["status"]) # COMPLETED
26 print(result.get("output")) # model output (e.g. video URL)
27except InferenceTimeout as e:
28 print("still running:", e.request_id) # re-poll later with this id
29except InferenceFailed as e:
30 print("failed:", e.detail)
31
32# Fast models (<=600s) can use the one-liner instead:
33# result = segmind.run("video-audio-merge", **payload)API Endpoint
https://api.segmind.com/v1/video-audio-mergeParameters
input_audiorequiredstring (uri)URL of the input audio to be merged with the video
"https://segmind-sd-models.s3.amazonaws.com/display_images/audio-merge-input-aud.mp3"input_videorequiredstring (uri)URL of the input video to be merged
"https://segmind-sd-models.s3.amazonaws.com/display_images/video-audio-merge-input.mp4"audio_endoptionalnumberEnd time of the audio in seconds (-1 for full duration)
-1Range: -1 - 3600audio_fade_inoptionalnumberDuration of audio fade-in effect in seconds
0Range: 0 - 10audio_fade_outoptionalnumberDuration of audio fade-out effect in seconds
0Range: 0 - 10audio_startoptionalnumberStart time of the audio in seconds
0Range: 0 - 3600merge_intensityoptionalnumberIntensity of audio merging (0.0 to 1.0)
0.5Range: 0 - 1override_audiooptionalbooleanWhether to completely replace the original video audio
falsevideo_endoptionalnumberEnd time of the video in seconds (-1 for full duration)
-1Range: -1 - 3600video_startoptionalnumberStart time of the video in seconds
0Response Type
Returns: Video
Asynchronous requests (v2)
Use Async for video, long-running (>~60s), or high-concurrency workloads; Sync is simplest for fast image & LLM calls. Async submits a request and you poll it to completion.
- 1
POST /v2/video-audio-mergeSubmit — returns request_id, status_url, response_url
- 2
GET /v2/requests/{id}/statusPoll — until COMPLETED or FAILED
- 3
GET /v2/requests/{id}Result — final response body
Status states
- A FAILED request is served as HTTP 422 — the body still carries the error detail.
- An unknown or expired request_id returns HTTP 404.
- Results are retained for 1 hour, then expire.
- Content / RAI blocks surface as FAILED, not a separate state.
- Track completion by polling the status endpoint.
Common Error Codes
The API returns standard HTTP status codes. Detailed error messages are provided in the response body.
Bad Request
Invalid parameters or request format
Unauthorized
Missing or invalid API key
Forbidden
Insufficient permissions
Not Found
Model or endpoint not found
Insufficient Credits
Not enough credits to process request
Rate Limited
Too many requests
Server Error
Internal server error
Bad Gateway
Service temporarily unavailable
Timeout
Request timed out