Skip to content
Docs menu

Upload a video and use the agent

Let the agent design sound for a video, with a plan you can edit.

The agent designs sound for a whole video. You upload a clip and describe what you want. It writes a plan, you approve or edit it, then it generates and places the sounds on a timeline.

1. Upload the video

Only MP4 (video/mp4) is accepted. Files up to about 90 MB go in one request; bigger ones go up in resumable 16 MiB parts, each checked, and the SDKs choose for you.

up = catalyst.upload("clip.mp4", on_progress=lambda done, total: print(f"{done}/{total}"))
video_id = up.data["video_id"]

2. Talk to the agent

Chat streams by default (server-sent events). Send "options": {"stream": false} for one JSON reply. The SDKs wait for the full answer unless you ask for a stream.

reply = catalyst.chat.create("Add ambient city night with footsteps", video_id=video_id)
reply.status          # "needs_input" while it waits for you
reply.plan_markdown   # the plan it proposes
reply.reply           # its text

When status is needs_input the turn is over and waits for you. Approve by chatting again in the same session ("proceed"), or send your edited plan with plan_markdown.

Chat options

FieldNotes
session_idYour conversation. Reuse it to continue. SDKs default to their own session.
input.messageYour message (input.prompt is the same thing). Up to 8000 characters.
input.video_id / input.file_idPoint the agent at an uploaded video or a generated file.
plan_markdownYour edited version of the plan the agent proposed.
options.streamDefault true for HTTP (events). Send false for one JSON reply.
options.idempotency_keyRepeat the same key to avoid doing the work twice.
client_id, client_tool_resultUsed with registered tools (below).

Register your editor's tools

If your app exposes actions the agent can ask for (for example "set track volume"), register them once. mode is upsert (default), replace or delete.

catalyst.tools.register("my-editor", [{
    "name": "set_track_volume",
    "description": "Set the volume of a track from 0 to 1.",
    "input_schema": {"type": "object", "properties": {"track": {"type": "string"}, "volume": {"type": "number"}}, "required": ["track", "volume"]},
}])

Then pass client_id in chat requests. When the agent needs a tool, the reply asks you to run it: run it in your app and send the outcome back in the next chat call as client_tool_result.

Tip

The SDKs also include a ready-made tool runner and a one-call helper that does the whole upload, plan, approve, generate and download flow. See the SDK reference.