Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Implementation:Togethercomputer Together python Video Types

From Leeroopedia
Knowledge Sources
Domains Video_Generation, Type_System
Last Updated 2026-02-15 16:00 GMT

Overview

Concrete type definitions for video generation requests and responses provided by the Together Python SDK.

Description

This module defines the Pydantic models for the video generation API: CreateVideoBody (request parameters including model, prompt, dimensions, and generation settings), CreateVideoResponse (job ID), VideoJob (full job status with outputs), and VideoOutputs (video URL and cost).

Usage

Import these types when you need to type-hint video-related data structures or inspect video generation response objects.

Code Reference

Source Location

Signature

class CreateVideoBody(BaseModel):
    model: str
    prompt: str | None = None
    height: int | None = None
    width: int | None = None
    seconds: str | None = None
    fps: int | None = None
    steps: int | None = None
    seed: int | None = None
    guidance_scale: float | None = None
    output_format: Literal["MP4", "WEBM"] | None = None
    output_quality: int | None = None
    negative_prompt: str | None = None
    frame_images: List[Dict[str, Any]] | None = None
    reference_images: List[str] | None = None

class CreateVideoResponse(BaseModel):
    id: str

class VideoJob(BaseModel):
    id: str
    model: str
    object: Literal["video"]
    status: Literal["queued", "in_progress", "completed", "failed", "cancelled"]
    seconds: str
    size: str
    created_at: int
    error: Error | None = None
    outputs: VideoOutputs | None = None
    completed_at: int | None = None

Import

from together.types.videos import CreateVideoBody, CreateVideoResponse, VideoJob, VideoOutputs

I/O Contract

Inputs

Name Type Required Description
(constructed from API response dicts) Dict[str, Any] Yes API JSON response data parsed into typed models

Outputs

Name Type Description
CreateVideoResponse Pydantic Model Job ID for polling
VideoJob Pydantic Model Full job with status, model, outputs, error info
VideoOutputs Pydantic Model video_url and cost

Usage Examples

from together import Together

client = Together()

response = client.videos.create(
    model="together/video-model",
    prompt="A cat walking on a beach",
)
# response is CreateVideoResponse with .id

job = client.videos.retrieve(response.id)
# job is VideoJob
print(job.status)  # "queued", "in_progress", "completed", "failed", or "cancelled"
if job.outputs:
    print(job.outputs.video_url)
    print(job.outputs.cost)

Related Pages

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment