Skip to main content

Generate Lyrics

Overview​

Our API allows you to generate lyrics and a title for your song. These lyrics can be used as the prompt property in custom song generation.

Example​

JavaScript

const main = async () => {
const prompt = `A song about the future.`;
const { id } = await fetch('https://api.umamiai.xyz/v2/generate/audio/suno-ai/lyric', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_UMAMIAI_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
prompt,
}),
}).then((res) => res.json());

console.log('Generated lyric id:', id);
};

main();

Python

import requests


def main():
prompt = "A song about the future."

response = requests.post(
"https://api.umamiai.xyz/v2/generate/audio/suno-ai/clip",
headers={
"Authorization": "Bearer YOUR_UMAMIAI_API_KEY",
"Content-Type": "application/json",
},
json={
"prompt": prompt,
},
)

response.raise_for_status()
data = response.json()

print("Generated lyric id:", data["id"])


if __name__ == "__main__":
main()

This request will return a generated lyrics ID. To fetch the actual lyrics data, you need to retrieve it using this ID.

fetch-lyrics