1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const axios = require('axios');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/lyria-3";
const data = {
"prompt": "An uplifting indie-pop anthem at 120 BPM in C major. Bright acoustic and electric guitars, punchy live drums, warm bass, shimmering synth pads, and a catchy female lead vocal with layered harmonies. [Verse] We were driving through the night, chasing lights so far away. [Chorus] Hold on, hold on, the morning's on its way, we're gonna be okay. Full-band arrangement with clear vocals, polished radio-ready mix."
};
(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);
}
})();Text describing genre, instruments, BPM, key and mood; supports [Verse]/[Chorus] tags, timestamps and custom lyrics. Add instrumental only for backing tracks.
Optional array of up to 10 image URLs guiding the music's mood, colour and subject. Leave empty for pure text-to-music.
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.
Lyria 3 is Google DeepMind's music generation model, served on Segmind as a text-to-audio API. From a single text prompt, it composes a 30-second, 44.1 kHz stereo clip complete with vocals, timed lyrics, and full instrumental arrangements — or an instrumental-only backing track when you ask for one. Lyria 3 also accepts up to 10 reference images, so you can turn a photo's mood, color, and subject into a matching soundtrack. Before it renders audio, the model reasons through musical structure (intro, verse, chorus, bridge) to keep the composition coherent from the first note to the last.
Lyria 3 is built for creators who need custom, royalty-aware audio fast: social and short-form video soundtracks, background music for games and apps, marketing jingles, podcast intros, lo-fi study loops, and demo songs with sung hooks. The image-to-music workflow is ideal for auto-scoring campaign assets or matching a track to a brand photo. In testing, a single prompt reliably produced a full-band, radio-ready mix with clean lead vocals in about 30 seconds.
Be specific: name the genre, instruments, BPM, key, and mood. Use section tags or timestamps to shape progression, and paste your own lyrics for sung vocals. Add "instrumental only, no vocals" for a clean backing track. Vague prompts yield generic results, so layer detail. Results vary between calls since generation is non-deterministic.
Does Lyria 3 generate vocals and lyrics? Yes — it sings time-aligned lyrics and can also produce instrumental-only tracks.
How long are the clips? Each generation is a fixed 30-second, 44.1 kHz stereo MP3.
Can I generate music from an image? Yes — supply up to 10 reference images to guide mood and style.
Does it support other languages? Yes — lyrics are generated in the language of your prompt.
Are outputs watermarked? Yes — every track includes an imperceptible SynthID watermark.
Can I request longer, full-length songs? For multi-minute tracks with detailed structure, use Lyria 3 Pro.