video-to-music
Score a video with original music using Sonilo — the model watches the cut and matches pacing, motion, and emotion, returning either the audio or a new video with the score muxed in. Use when the user has a finished video that needs a soundtrack. Every track is licensed and cleared for commercial use. For music with no video, use the text-to-music skill.
sonilo-ai · AI review on file
Installation
Read the source and dependencies before running a command. Copying does not install or execute anything.
npx skills add sonilo-ai/skills --skill video-to-musicAbout this skill
name: video-to-music
description: Score a video with original music using Sonilo — the model watches the cut and matches pacing, motion, and emotion, returning either the audio or a new video with the score muxed in. Use when the user has a finished video that needs a soundtrack. Every track is licensed and cleared for commercial use. For music with no video, use the text-to-music skill.
license: MIT
compatibility: "Requires Sonilo through either transport — the MCP server connected, or the sonilo CLI installed and signed in — plus credentials: a sonilo login sign-in, the hosted OAuth plugin, or SONILO_API_KEY. See the setup-api-key skill."
allowed-tools: Bash, Read, Write, mcp__sonilo__*
Sonilo Video-to-Music
Hand Sonilo a finished video and it composes an original score to the cut — pacing, motion, and emotion matched, with transitions and beat drops aligned to the edit, at exactly the video's length. This is Sonilo's flagship capability. Every track is licensed (music licensed via Shutterstock) and cleared for commercial use on social, brand content, and advertising.
Setup: See the setup-api-key skill to connect the Sonilo MCP server and authenticate —
sonilo login(no key) orSONILO_API_KEY.
⚠️ Cost: every tool below makes an API call that may incur charges. Only call it when the user has actually asked for a generation. Check
get_account_services(see the account skill) if you're unsure whether free-trial runs remain.
Transport: MCP or CLI
Pick one at the start of the session and stay on it. Do not mix the two inside a single job, and do not announce the choice.
- Sonilo MCP tools visible in this session (
video_to_musicand friends) — use them. This is the preferred path: it needs no shell, and it is the only one that survives a very long generation. If a call fails to authenticate — rather than failing on its inputs — this transport is not usable in this session: go to 2 instead of retrying it. - No usable Sonilo MCP tools, but
sonilo accountexits 0 — use the CLI commands below. Same API, same account, same credential file. Probe withsonilo account, notsonilo whoami: whoami exits 0 even when signed out, so it cannot tell the two states apart. - Neither — stop and run the setup-api-key skill. Do not call
api.sonilo.comwith curl to work around it; both transports handle uploads, polling and retries that a bare request does not.
Quick Start
MCP tool call (recommended)
video_to_music(
video_path="~/Desktop/trailer.mp4",
prompt="Build suspense, then resolve with a warm cinematic finish"
)
Saves the generated file(s) to SONILO_MCP_BASE_PATH (~/Desktop by default) and returns the saved path(s) as text.
Python (pip install sonilo)
from sonilo import Sonilo
client = Sonilo() # reads SONILO_API_KEY
score = client.video_to_music.generate(video="trailer.mp4", prompt="Build suspense, then resolve with a warm cinematic finish")
score.save("score.m4a")
# video_to_video_music: get the video back with the music muxed in
video = client.video_to_video_music.generate(video="trailer.mp4", prompt="cinematic, uplifting")
video.save("scored.mp4")
preserve_speech=True on video_to_music requires the async path — use generate_async() instead of generate() to get the extra vocals/mux/ducked outputs; see sonilo-python's README for the full pattern.
JavaScript / TypeScript (npm install sonilo)
import { SoniloClient } from "sonilo";
const client = new SoniloClient(); // reads SONILO_API_KEY
const score = await client.videoToMusic.generate({
video: "./trailer.mp4",
prompt: "Build suspense, then resolve with a warm cinematic finish",
});
// video_to_video_music: get the video back with the music muxed in
const video = await client.videoToVideoMusic.generate({
video: "./trailer.mp4",
prompt: "cinematic, uplifting",
});
preserveSpeech: true on videoToMusic requires the async path — use .submit() + client.tasks.wait() instead of .generate(); see sonilo-js's README for the full pattern.
CLI (npm install -g sonilo-cli or pip install sonilo-cli)
sonilo video-to-music --video trailer.mp4 --prompt "Build suspense, then resolve with a warm cinematic finish" --output score.m4a
--format wav, --preserve-speech, and --isolate-vocals each switch video-to-music to the async submit-and-poll path.
# the muxed video, from the CLI
sonilo video-to-video-music --video trailer.mp4 --prompt "cinematic, uplifting" --output scored.mp4
cURL (raw REST API, no MCP host)
curl -X POST "https://api.sonilo.com/v1/video-to-music" \
-H "Authorization: Bearer $SONILO_API_KEY" \
-F "video=@trailer.mp4" \
-F "prompt=Build suspense, then resolve with a warm cinematic finish" \
--output score.m4a
video_to_music also accepts a video_url form field instead of an uploaded file — pass one or the other, never both.
Tools
| Tool | Description |
|---|---|
video_to_music(video_path? | video_url?, prompt?, preserve_speech?, output_format?, ducking?, variants_num?, prompt_influence?, stems?, output_directory?) | Score a video: matches pacing/motion/emotion, matches the video's duration exactly. Returns audio only (the video itself is not muxed). |
video_to_video_music(video_path? | video_url?, prompt?, segments?, keep_original_sound?, ducking?, preserve_speech?, variants_num?, prompt_influence?, output_directory?) | Same scoring, but returns a new .mp4 with the music already muxed in. By default the source's own audio is dropped — see keep_original_sound. |
Parameters
| Parameter | Type | Default | Notes |
|---|---|---|---|
prompt |