> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs-dev.ltx.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs-dev.ltx.io/_mcp/server.

# Retake video section

POST https://api.ltx.io/v1/retake
Content-Type: application/json

> **Deprecated:** After October 26, 2026 at 11:59 PM UTC, requests to this endpoint will no longer work. See [Migrate from V1 to V2](/migrate-v1-to-v2).

Re-generate a section of an existing video by replacing either its audio, its video, or both. Iterate on part of a generation without starting over — the rest of the video is preserved. The edited section is defined by the `start_time` and `duration` parameters.

Returns the generated video directly in the response. For an asynchronous version that returns a job to poll, see [v2/retake](/api-documentation/api-reference/async-video-generation/submit-retake).

Billed per second of the input video. See [Pricing](/pricing).


Reference: https://docs-dev.ltx.io/api-documentation/api-reference/video-generation/retake

## Authentication

- `Authorization` header (bearer token, required) — API key authentication

## Request

### Body (application/json)

This endpoint expects an EditVideoRequest.

- `video_uri` (string, required) — Input video for editing. See [Input Formats](/input-formats#video-input) for supported formats and codecs. - Maximum resolution: 3840x2160 (4K) - Minimum frame count: 73 (around 3 seconds at 24fps)
- `start_time` (double, required) — Start time in seconds, defines the section to be edited in the input video. The section defined by `start_time` and `duration` should be within the duration of the input video. If the section extends beyond the duration of the video, it will be clamped to the video duration.
- `duration` (double, required) — Duration in seconds, defines the duration of the section to be edited in the input video. Must be at least 2 seconds. The section defined by `start_time` and `duration` should be within the duration of the input video. If the section extends beyond the duration of the video, it will be clamped to the video duration.
- `prompt` (string, optional) — Describing what needs to happen in the generated video in a section defined by `start_time` and `duration`.
- `mode` (enum, optional, default: replace_audio_and_video) — Can be any of the following: - `replace_audio` - Replace only the audio track - `replace_video` - Replace only the video track - `replace_audio_and_video` - Replace both audio and video tracks The default value is `replace_audio_and_video` if not specified.
  - Allowed values: `replace_audio`, `replace_video`, `replace_audio_and_video`
- `resolution` (enum, optional) — The resolution of the generated video in WIDTHxHEIGHT format. When omitted, the resolution is automatically determined based on the input video orientation — portrait videos produce 1080x1920 output, landscape videos produce 1920x1080 output.
  - Allowed values: `1920x1080`, `1080x1920`
- `model` (enum, optional, default: ltx-2-3-pro) — Model to use for video generation.
  - Allowed values: `ltx-2-3-pro`

## Response

### 200

Video edited successfully

- File download.

## Errors

### 400 Bad Request Error

The request is invalid or malformed

- `type` (enum, required) — Response type indicator
  - Allowed values: `error`
- `error` (ErrorError, required)

### 401 Unauthorized Error

Authentication failed

- `type` (enum, required) — Response type indicator
  - Allowed values: `error`
- `error` (ErrorError, required)

### 422 Unprocessable Entity Error

Content rejected by safety filters

- `type` (enum, required) — Response type indicator
  - Allowed values: `error`
- `error` (ErrorError, required)

### 429 Too Many Requests Error

Concurrency or queue limit exceeded

- `type` (enum, required) — Response type indicator
  - Allowed values: `error`
- `error` (ErrorError, required)

### 500 Internal Server Error

An unexpected error occurred

- `type` (enum, required) — Response type indicator
  - Allowed values: `error`
- `error` (ErrorError, required)

### 503 Service Unavailable Error

Service temporarily unavailable

- `type` (enum, required) — Response type indicator
  - Allowed values: `error`
- `error` (ErrorError, required)

### 504 Gateway Timeout Error

Request timeout

- `type` (enum, required) — Response type indicator
  - Allowed values: `error`
- `error` (ErrorError, required)

## Types

### ErrorError

- `type` (string, required) — Error type for programmatic handling
- `message` (string, required) — Human-readable error description

## Examples

**Request**

```json
{
  "video_uri": "YOUR_VIDEO_URI",
  "start_time": 0,
  "duration": 5,
  "prompt": "A dramatic explosion with bright orange flames",
  "mode": "replace_audio_and_video"
}
```

**SDK Code**

```python
import requests

url = "https://api.ltx.io/v1/retake"

payload = {
    "video_uri": "YOUR_VIDEO_URI",
    "prompt": "A dramatic explosion with bright orange flames",
    "start_time": 0,
    "duration": 5,
    "mode": "replace_audio_and_video"
}

headers = {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

# Save the video file
with open("edited_video.mp4", "wb") as f:
    f.write(response.content)

```

```typescript
const url = "https://api.ltx.io/v1/retake";

const payload = {
  video_uri: "YOUR_VIDEO_URI",
  prompt: "A dramatic explosion with bright orange flames",
  start_time: 0,
  duration: 5,
  mode: "replace_audio_and_video"
};

const response = await fetch(url, {
  method: "POST",
  headers: {
    "Authorization": "Bearer YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify(payload)
});

// Save the video file
const buffer = await response.arrayBuffer();
const fs = require('fs');
fs.writeFileSync("edited_video.mp4", Buffer.from(buffer));

```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.ltx.io/v1/retake"

	payload := strings.NewReader("{\n  \"video_uri\": \"YOUR_VIDEO_URI\",\n  \"start_time\": 0,\n  \"duration\": 5,\n  \"prompt\": \"A dramatic explosion with bright orange flames\",\n  \"mode\": \"replace_audio_and_video\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.ltx.io/v1/retake")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"video_uri\": \"YOUR_VIDEO_URI\",\n  \"start_time\": 0,\n  \"duration\": 5,\n  \"prompt\": \"A dramatic explosion with bright orange flames\",\n  \"mode\": \"replace_audio_and_video\"\n}")
  .asString();
```