LTX Retake Video Serverless API

Retake enables precise edits in video segments, maintaining continuity while enhancing dialogue and emotional delivery.

~38.50s
~$0.791
 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

POSThttps://api.segmind.com/v1/ltx-retake-video

Parameters

durationrequired
number

Define the section duration in seconds. Recommendations start from 2 up to 20 seconds.

start_timerequired
number

Set the start time for editing in seconds. Ideal range is within 0 to video length.

video_urirequired
string (uri)

Provide the URL or data URI of your video. Use high-resolution samples for best results.

modeoptional
string

Select what to replace: audio, video, or both. 'Both' is recommended for a complete overhaul.

Default: "replace_audio_and_video"
Allowed values :
"replace_audio""replace_video""replace_audio_and_video"
promptoptional
string

Describe 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.

400

Bad Request

Invalid parameters or request format

401

Unauthorized

Missing or invalid API key

403

Forbidden

Insufficient permissions

404

Not Found

Model or endpoint not found

406

Insufficient Credits

Not enough credits to process request

429

Rate Limited

Too many requests

500

Server Error

Internal server error

502

Bad Gateway

Service temporarily unavailable

504

Timeout

Request timed out