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

# Generate video from text

POST https://api.ltx.io/v1/text-to-video
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).

Generate a video from a text prompt. Describe the scene, camera motion, and mood — the model returns a video with matching audio.

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

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


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

## Authentication

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

## Request

### Body (application/json)

This endpoint expects a TextToVideoRequest.

- `prompt` (string, required) — Text prompt describing the desired video content
- `model` (enum, required) — Model to use for generation. See [Supported Models](/models) for details.
  - Allowed values: `ltx-2-3-fast`, `ltx-2-3-pro`, `ltx-2-5-fast`, `ltx-2-5-pro`
- `duration` (integer, required, nullable) — Video duration in seconds. See [Supported Models](/models) for available durations per model. Pass `null` to let `ltx-2-5-fast` or `ltx-2-5-pro` choose the length from your prompt — see [Automatic duration](/models/ltx-2-5#automatic-duration).
- `resolution` (string, required) — Output video resolution. See [Supported Models](/models) for available resolutions per model.
- `fps` (integer, optional, default: 24) — Frame rate in frames per second. See [Supported Models](/models) for available FPS per model and resolution.
- `generate_audio` (boolean, optional, default: true) — Generate audio for the video. When true, the generated video will include AI-generated audio matching the scene. When false, only silent video is generated.
- `camera_motion` (enum, optional) — Apply camera motion effects to the generated video.
  - Allowed values: `dolly_in`, `dolly_out`, `dolly_left`, `dolly_right`, `jib_up`, `jib_down`, `static`, `focus_shift`

## Response

### 200

Video generated 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
{
  "prompt": "A majestic eagle soaring through clouds at sunset",
  "model": "ltx-2-5-pro",
  "duration": 8,
  "resolution": "1920x1080"
}
```

**SDK Code**

```python
import requests

url = "https://api.ltx.io/v1/text-to-video"

payload = {
    "prompt": "A majestic eagle soaring through clouds at sunset",
    "model": "ltx-2-5-pro",
    "duration": 8,
    "resolution": "1920x1080"
}

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

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

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

```

```typescript
const url = "https://api.ltx.io/v1/text-to-video";

const payload = {
  prompt: "A majestic eagle soaring through clouds at sunset",
  model: "ltx-2-5-pro",
  duration: 8,
  resolution: "1920x1080"
};

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("generated_video.mp4", Buffer.from(buffer));

```

```go
package main

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

func main() {

	url := "https://api.ltx.io/v1/text-to-video"

	payload := strings.NewReader("{\n  \"prompt\": \"A majestic eagle soaring through clouds at sunset\",\n  \"model\": \"ltx-2-5-pro\",\n  \"duration\": 8,\n  \"resolution\": \"1920x1080\"\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/text-to-video")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"prompt\": \"A majestic eagle soaring through clouds at sunset\",\n  \"model\": \"ltx-2-5-pro\",\n  \"duration\": 8,\n  \"resolution\": \"1920x1080\"\n}")
  .asString();
```