POST
javascript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 const axios = require('axios'); const api_key = "YOUR API-KEY"; const url = "https://api.segmind.com/v1/sonilo-video-to-audio"; const data = { "video_url": "https://segmind-resources.s3.amazonaws.com/input/sonilo-video-to-audio-src.mp4", "sound_type": "music_and_sfx", "music_prompt": "cinematic emotional orchestral score, warm swelling strings, hopeful and majestic, ocean adventure theme", "sfx_prompt": "ocean waves crashing on rocks, sea spray, distant seagulls, coastal wind" }; (async function() { try { const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } }); console.log(response.data); } catch (error) { console.error('Error:', error.response.data); } })();
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


video_urlstr *

Public HTTP(S) URL of the source MP4 or MOV. Use a finished cut so audio tracks the edit.


sound_typestr ( default: music_and_sfx )

Selects music, sfx, or combined output. Pick music_and_sfx for a full soundtrack plus effects.


music_promptstr ( default: cinematic emotional orchestral score, warm swelling strings, hopeful and majestic, ocean adventure theme )

Optional text steering score mood, genre, and instruments. Describe the scene for music or music_and_sfx.


sfx_promptstr ( default: ocean waves crashing on rocks, sea spray, distant seagulls, coastal wind )

Optional text guiding sound effects and ambience. Describe on-screen events for sfx or music_and_sfx.


preserve_speechbool ( default: 1 )

Keeps source speech in music modes. Enable for narration, interviews, or voice-over clips.


duckingbool ( default: true )

Lowers music under detected speech in music modes. Keep true to keep dialogue clear.


output_formatstr ( default: 1 )

Audio container; unsupported for music_and_sfx. music: m4a/wav; sfx: wav, mp3, aac or flac.


music_segmentslist ( default: 1 )

Optional timed music prompts for music mode. Segment starts must be at least 5 seconds apart.


sfx_segmentslist ( default: 1 )

Optional contiguous timed SFX prompts for sfx or music_and_sfx. First segment must start at 0.

To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.

Sonilo Video to Audio — Video-to-Audio (Music & Sound Effects) Model

What is Sonilo Video to Audio?

Sonilo Video to Audio turns a video into a finished soundtrack. Instead of writing a text prompt and hoping the result fits, you pass a video URL and Sonilo reads the footage itself — runtime, pacing, motion, scene changes, transitions, and voice-over space — then generates audio that tracks the edit. A single sound_type switch chooses music, sfx, or music_and_sfx (a combined score plus synced sound effects). Generated audio matches the exact length of your clip and lands on a natural ending rather than an abrupt cut or loop, so it drops straight onto the timeline.

Sonilo is positioned as a professionally licensed, video-native audio model, making it a strong fit for creators and developers who need commercially usable music and sound design without searching stock libraries or manually syncing tracks.

Key Features

  • Video-conditioned generation: the visuals drive the output; text prompts are optional creative direction.
  • Three modes in one endpoint: music, sound effects, or a combined music_and_sfx soundtrack.
  • Length-matched, beat-aware audio with natural endings aligned to cuts and transitions.
  • Frame-accurate SFX — Foley, impacts, ambience, and transition effects placed to on-screen action.
  • Segment controls (music_segments, sfx_segments) for timed prompts across sections.
  • Speech handling via preserve_speech and ducking so narration stays clear in music modes.

Best Use Cases

Score 30-second product ads that lift on the reveal, generate podcast intros, outros, and sponsor beds, follow interval energy on workout and fitness reels, and add cinematic music to drone and wedding footage. In testing, a silent cinematic ocean clip returned a clean, well-leveled stereo soundtrack that layered orchestral music under synced wave and seagull effects — exactly matching the clip length. The music_and_sfx mode is ideal for AI-generated video that otherwise arrives with no usable audio.

Prompt Tips and Output Quality

Start with a finished or near-final cut so timing is accurate. Leave prompts empty to let the video lead, or add a short music_prompt (mood, genre, instruments) and sfx_prompt (on-screen events) to steer style. For dialogue, keep ducking on and enable preserve_speech. Output is production-ready stereo audio delivered as a separate track you can balance in your editor.

FAQs

Do I need a text prompt? No. Prompts are optional; the video is the primary input. Add music_prompt or sfx_prompt only when you want specific direction.

Does the audio match my video length? Yes. The soundtrack is generated to your clip's exact duration with a natural ending.

Can it make music and sound effects together? Yes — set sound_type to music_and_sfx for a combined soundtrack.

Will it keep my narration or dialogue? In music modes, enable preserve_speech and keep ducking on so speech stays audible under the music.

Does it generate video too? No. Sonilo produces audio only; it does not create or edit footage.

What input format should I use? Provide a public MP4 or MOV URL; a locked edit gives the best timing.