# Docs for v2 can be found by changing the above selector ^
from together import Together
import os
client = Together(
api_key=os.environ.get("TOGETHER_API_KEY"),
)
response = client.videos.create(
model="together/video-model",
prompt="A cartoon of an astronaut riding a horse on the moon"
)
print(response.id)
{
"id": "<string>",
"model": "<string>",
"status": "in_progress",
"created_at": 123,
"size": "<string>",
"seconds": "<string>",
"object": "video",
"completed_at": 123,
"error": {
"message": "<string>",
"code": "<string>"
},
"outputs": {
"cost": 123,
"video_url": "<string>"
}
}Create a video
# Docs for v2 can be found by changing the above selector ^
from together import Together
import os
client = Together(
api_key=os.environ.get("TOGETHER_API_KEY"),
)
response = client.videos.create(
model="together/video-model",
prompt="A cartoon of an astronaut riding a horse on the moon"
)
print(response.id)
{
"id": "<string>",
"model": "<string>",
"status": "in_progress",
"created_at": 123,
"size": "<string>",
"seconds": "<string>",
"object": "video",
"completed_at": 123,
"error": {
"message": "<string>",
"code": "<string>"
},
"outputs": {
"cost": 123,
"video_url": "<string>"
}
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Parameters for creating a new video generation job.
The model to be used for the video creation request.
Text prompt that describes the video to generate.
1 - 32000Clip duration in seconds.
Frames per second. Defaults to 24.
The number of denoising steps the model performs during video generation. More steps typically result in higher quality output but require longer processing time.
10 <= x <= 50Seed to use in initializing the video generation. Using the same seed allows deterministic video generation. If not provided a random seed is generated for each request.
Controls how closely the video generation follows your prompt. Higher values make the model adhere more strictly to your text description, while lower values allow more creative freedom. guidence_scale affects both visual content and temporal consistency.Recommended range is 6.0-10.0 for most video models. Values above 12 may cause over-guidance artifacts or unnatural motion patterns.
Specifies the format of the output video. Defaults to MP4.
MP4, WEBM Compression quality. Defaults to 20.
Similar to prompt, but specifies what to avoid instead of what to include
Array of images to guide video generation, similar to keyframes.
Show child attributes
URL path to hosted image that is used for a frame
Optional param to specify where to insert the frame. If this is omitted, the following heuristics are applied:
[
[
{
"input_image": "aac49721-1964-481a-ae78-8a4e29b91402",
"frame": 0
},
{
"input_image": "c00abf5f-6cdb-4642-a01d-1bfff7bc3cf7",
"frame": 48
},
{
"input_image": "3ad204c3-a9de-4963-8a1a-c3911e3afafe",
"frame": "last"
}
]
]
Unlike frame_images which constrain specific timeline positions, reference images guide the general appearance that should appear consistently across the video.
Success
Structured information describing a generated video job.
Unique identifier for the video job.
The video generation model that produced the job.
Current lifecycle status of the video job.
in_progress, completed, failed Unix timestamp (seconds) for when the job was created.
The resolution of the generated video.
Duration of the generated clip in seconds.
The object type, which is always video.
video Unix timestamp (seconds) for when the job completed, if finished.
Was this page helpful?