Loading...
Loading...
Generate videos from text and image prompts via Together AI. 15+ models including Veo 2/3, Sora 2, Kling 2.1, Hailuo 02, Seedance, PixVerse, Vidu. Supports text-to-video, image-to-video, keyframe control, and reference images. Use when users want to generate videos, create video content, animate images, or work with any video generation task.
npx skill4agent add zainhas/togetherai-skills together-video/v2/videosimport time
from together import Together
client = Together()
job = client.videos.create(
prompt="A serene sunset over the ocean with gentle waves",
model="minimax/video-01-director",
width=1366,
height=768,
)
print(f"Job ID: {job.id}")
# Poll until completion
while True:
status = client.videos.retrieve(job.id)
if status.status == "completed":
print(f"Video URL: {status.outputs.video_url}")
break
elif status.status == "failed":
print("Failed")
break
time.sleep(5)import Together from "together-ai";
const together = new Together();
const job = await together.videos.create({
prompt: "A serene sunset over the ocean with gentle waves",
model: "minimax/video-01-director",
width: 1366, height: 768,
});
// Poll until completion
while (true) {
const status = await together.videos.retrieve(job.id);
if (status.status === "completed") {
console.log(`Video URL: ${status.outputs.video_url}`);
break;
} else if (status.status === "failed") break;
await new Promise(r => setTimeout(r, 5000));
}# Create a video generation job
curl -X POST "https://api.together.xyz/v2/videos" \
-H "Authorization: Bearer $TOGETHER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "minimax/video-01-director",
"prompt": "A serene sunset over the ocean with gentle waves",
"width": 1366,
"height": 768
}'
# Poll for completion (replace $JOB_ID with the id from the create response)
curl -X GET "https://api.together.xyz/v2/videos/$JOB_ID" \
-H "Authorization: Bearer $TOGETHER_API_KEY"import base64, requests
image_url = "https://example.com/photo.jpg"
img_data = base64.b64encode(requests.get(image_url).content).decode("utf-8")
job = client.videos.create(
prompt="Smooth camera zoom out",
model="minimax/hailuo-02",
frame_images=[{"input_image": img_data, "frame": 0}],
)import * as fs from "fs";
import Together from "together-ai";
const together = new Together();
// Load and encode your image
const imageBuffer = fs.readFileSync("keyframe.jpg");
const base64Image = imageBuffer.toString("base64");
const job = await together.videos.create({
prompt: "Smooth camera zoom out",
model: "minimax/hailuo-02",
frame_images: [{ input_image: base64Image, frame: 0 }],
});
// Poll until completion
while (true) {
const status = await together.videos.retrieve(job.id);
if (status.status === "completed") {
console.log(`Video URL: ${status.outputs.video_url}`);
break;
} else if (status.status === "failed") break;
await new Promise(r => setTimeout(r, 5000));
}# Create an image-to-video job (replace $BASE64_IMAGE with your base64-encoded image)
curl -X POST "https://api.together.xyz/v2/videos" \
-H "Authorization: Bearer $TOGETHER_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "minimax/hailuo-02",
"prompt": "Smooth camera zoom out",
"frame_images": [{"input_image": "$BASE64_IMAGE", "frame": 0}]
}'
# Poll for completion (replace $JOB_ID with the id from the create response)
curl -X GET "https://api.together.xyz/v2/videos/$JOB_ID" \
-H "Authorization: Bearer $TOGETHER_API_KEY"job = client.videos.create(
prompt="A cat dancing energetically",
model="minimax/hailuo-02",
reference_images=["https://example.com/cat.jpg"],
)| Parameter | Type | Description | Default |
|---|---|---|---|
| string | Text description (required for all models except Kling) | - |
| string | Model ID (required) | - |
| int | Video width | 1366 |
| int | Video height | 768 |
| int | Duration (1-10) | 5-6 |
| int | Frames per second | 24-25 |
| int | Diffusion steps | varies |
| float | Prompt adherence (6-10) | varies |
| int | Random seed | random |
| string | What to exclude | - |
| array | Keyframe images (base64) | - |
| array | Style reference URLs | - |
| string | "MP4" or "WEBM" | "MP4" |
| int | Bitrate/quality (lower = higher quality) | 20 |
| Status | Description |
|---|---|
| Waiting in queue |
| Generating |
| Done — video URL available |
| Check |
| Job cancelled |
| Model | API String | Duration | Dimensions |
|---|---|---|---|
| Veo 3.0 | | 8s | 1280x720, 1920x1080 |
| Veo 3.0 + Audio | | 8s | 1280x720, 1920x1080 |
| Sora 2 | | 8s | 1280x720 |
| Hailuo 02 | | 10s | 1366x768, 1920x1080 |
| Kling 2.1 Master | | 5s | 1920x1080 |
| Seedance 1.0 Pro | | 5s | Multiple |
| PixVerse v5 | | 5s | Multiple |
| Vidu 2.0 | | 8s | Multiple |
x-codeSamples