Schema
Input
Send a JSON object with the generation parameters.
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | required | Text description of the video to generate. |
duration | number | required | Clip length in seconds: 5 or 8. |
resolution | string | required | 1920x1088, 1088x1920, 1280x768, or 768x1280. |
seed | integer | optional | Seed used to reproduce a generation. |
image_url | string | optional | Condition the first frame on a public HTTPS image URL. |
image_strength | number | optional | Image-conditioning strength from 0 to 1. |
image_inputs | array<object> | optional | Frame-specific image conditioning. Each object provides exactly one of url or data, plus frame_idx and strength. Use data for an inline data:image/... URI. |
Output
The API returns binary media on success and structured JSON when a request fails.
| Status | Content type | Body |
|---|---|---|
200 | video/mp4 | Binary MP4 data. |
4xx / 5xx | application/json | Error code and human-readable message. |
Setup API key
Export your key in the shell before making a request.
export TENSORSCALE_API_KEY="your-api-key"
Examples
Text-to-video generation
curl "https://api.tensorscale.io/v2/ltx-2.3/fast" \
-H "Authorization: Bearer ${TENSORSCALE_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A fluffy kitten looks at the camera and tilts its head.",
"duration": 5,
"resolution": "1280x768",
"seed": 42
}' \
--output "kitten.mp4"
import os
import requests
resp = requests.post(
"https://api.tensorscale.io/v2/ltx-2.3/fast",
json={
"prompt": "A fluffy kitten looks at the camera and tilts its head.",
"duration": 5,
"resolution": "1280x768",
"seed": 42,
},
headers={
"Authorization": f"Bearer {os.environ['TENSORSCALE_API_KEY']}",
},
)
resp.raise_for_status()
open("kitten.mp4", "wb").write(resp.content)
Image-to-video with a public URL
Pass a public HTTPS image URL to condition the first frame of the generated video.
curl "https://api.tensorscale.io/v2/ltx-2.3/fast" \
-H "Authorization: Bearer ${TENSORSCALE_API_KEY}" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A cinematic aerial push toward the lighthouse as ocean waves roll against the cliffs.",
"duration": 5,
"resolution": "1280x768",
"seed": 42,
"image_url": "https://example.com/coastal-lighthouse.jpg",
"image_strength": 1.0
}' \
--output "lighthouse.mp4"
import os
import requests
resp = requests.post(
"https://api.tensorscale.io/v2/ltx-2.3/fast",
json={
"prompt": "A cinematic aerial push toward the lighthouse as ocean waves roll against the cliffs.",
"duration": 5,
"resolution": "1280x768",
"seed": 42,
"image_url": "https://example.com/coastal-lighthouse.jpg",
"image_strength": 1.0,
},
headers={
"Authorization": f"Bearer {os.environ['TENSORSCALE_API_KEY']}",
},
timeout=600,
)
resp.raise_for_status()
open("lighthouse.mp4", "wb").write(resp.content)
Image-to-video with a local file
Read a local image and send it as an inline Base64 data URI. The API does not accept a client-local filesystem path directly.
import base64
import os
from pathlib import Path
import requests
def data_uri(path: Path) -> str:
encoded = base64.b64encode(path.read_bytes()).decode("ascii")
return f"data:image/png;base64,{encoded}"
resp = requests.post(
"https://api.tensorscale.io/v2/ltx-2.3/fast",
json={
"prompt": "A cinematic aerial push toward the lighthouse as ocean waves roll against the cliffs.",
"duration": 5,
"resolution": "1280x768",
"seed": 42,
"image_inputs": [
{
"data": data_uri(Path("coastal-lighthouse.png")),
"frame_idx": 0,
"strength": 1.0,
}
],
},
headers={
"Authorization": f"Bearer {os.environ['TENSORSCALE_API_KEY']}",
},
timeout=600,
)
resp.raise_for_status()
Path("lighthouse-local.mp4").write_bytes(resp.content)