LTX Retake Video Serverless API
Retake enables precise edits in video segments, maintaining continuity while enhancing dialogue and emotional delivery.
1import requests
2import json
3
4url = "https://api.segmind.com/v1/ltx-retake-video"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "video_uri": "https://segmind-resources.s3.amazonaws.com/output/ef54dfe1-8e36-48f2-8811-1f31c7f52afe-ltx-2-input.mp4",
12 "start_time": 0,
13 "duration": 4,
14 "prompt": "change the background to beach",
15 "mode": "replace_audio_and_video"
16}
17
18response = requests.post(url, headers=headers, json=data)
19
20if response.status_code == 200:
21 result = response.json()
22 print(json.dumps(result, indent=2))
23else:
24 print(f"Error: {response.status_code}")
25 print(response.text) 1import requests
2import json
3
4url = "https://api.segmind.com/v1/ltx-retake-video"
5headers = {
6 "x-api-key": "YOUR_API_KEY",
7 "Content-Type": "application/json"
8}
9
10data = {
11 "video_uri": "https://segmind-resources.s3.amazonaws.com/output/ef54dfe1-8e36-48f2-8811-1f31c7f52afe-ltx-2-input.mp4",
12 "start_time": 0,
13 "duration": 4,
14 "prompt": "change the background to beach",
15 "mode": "replace_audio_and_video"
16}
17
18response = requests.post(url, headers=headers, json=data)
19
20if response.status_code == 200:
21 result = response.json()
22 print(json.dumps(result, indent=2))
23else:
24 print(f"Error: {response.status_code}")
25 print(response.text)API Endpoint
https://api.segmind.com/v1/ltx-retake-videoParameters
durationrequirednumberDefine the section duration in seconds. Recommendations start from 2 up to 20 seconds.
start_timerequirednumberSet the start time for editing in seconds. Ideal range is within 0 to video length.
video_urirequiredstring (uri)Provide the URL or data URI of your video. Use high-resolution samples for best results.
modeoptionalstringSelect what to replace: audio, video, or both. 'Both' is recommended for a complete overhaul.
"replace_audio_and_video""replace_audio""replace_video""replace_audio_and_video"promptoptionalstringDescribe changes desired in the video scene. Add details like effects or mood changes.
Response Type
Returns: Video
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