



const main = async () => {
const response = await fetch('https://api.ai.cc/v2/generate/audio', {
method: 'POST',
headers: {
Authorization: 'Bearer ',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model: 'google/lyria2',
prompt: 'lo-fi pop hip-hop ambient music',
}),
}).then((res) => res.json());
console.log('Generation:', response);
};
main()
import requests
def main():
url = "https://api.ai.cc/v2/generate/audio"
payload = {
"model": "google/lyria2",
"prompt": "lo-fi pop hip-hop ambient music",
}
headers = {"Authorization": "Bearer ", "Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print("Generation:", response.json())
if __name__ == "__main__":
main()
-
AI Playground

Test all API models in the sandbox environment before you integrate.
We provide more than 300 models to integrate into your app.


Product Detail
✨ Discover Lyria 2: Google's Advanced AI Music Generation Model
Google's Lyria 2 is a cutting-edge AI model specifically engineered for high-fidelity music generation. It excels at producing professional-grade, instrumental audio directly from descriptive text prompts, empowering creators to bring their musical visions to life with unprecedented control and quality.
⚙️ Technical Specifications & Performance Metrics
Performance Benchmarks
Lyria 2 is meticulously optimized for professional-grade, text-to-music audio generation, ensuring top-tier output for demanding applications.
- 🎧 Audio Output: Generates 30 seconds of pristine 48kHz stereo WAV audio per request.
- ⚡ Generation Speed: Expect audio clips to be typically generated within 10 to 20 seconds, facilitating rapid prototyping and iteration.
- 💰 API Pricing: Highly competitive at 0.105 $/generation.
Quality and User Feedback
Despite the absence of formal benchmarks, user feedback consistently praises Lyria 2 for its superior audio quality. Many users claim it surpasses existing competitors like Suno and Udio, particularly highlighting its granular creative controls as a crucial advantage for professional musicians and content creators.
▶️ See Lyria 2 in Action
Watch this video to understand how to create compelling music with Lyria 2:
🚀 Key Capabilities of Lyria 2
Lyria 2 empowers users with precise and controllable audio outputs, ideal for a wide array of creative and professional applications:
- 🎵 Text-to-Music Generation: Effortlessly create instrumental music tracks from descriptive text prompts. Specify genre, mood, instrumentation, and tempo to guide the AI.
-
🎛️ Advanced Creative Controls:
- Supports negative prompting to exclude unwanted elements, ensuring your output is clean and focused.
- Features seed-based generation for reproducible outputs, critical for iterative development.
- Offers advanced settings for tempo (BPM) and key signature, giving musicians granular control.
- 🌍 Genre Versatility: Lyria 2 covers an extensive range of musical styles, including classical, jazz, pop, electronic, orchestral, and various regional styles, making it incredibly adaptable.
💡 Optimal Use Cases for Lyria 2
Lyria 2 is designed to excel in various professional and creative scenarios:
- 🎬 Content Creation: Generate bespoke background music and unique scores for digital content, including YouTube Shorts, podcasts, and social media videos.
- 🎼 Musical Prototyping: Assist musicians in rapidly creating demos, exploring new musical ideas, and refining compositions with precise controls over tempo and key.
- 🌳 Soundscape Design: Craft immersive ambient audio and diverse sound effects for games, films, or interactive experiences from simple text descriptions.
💻 API Code Samples & Parameters
Integrating Lyria 2 into your applications is straightforward. Here’s a conceptual look at how you might interact with its API for music generation:
Music Generation (Conceptual)
// Example for generating audio.
// This snippet is conceptual and depends on the specific API client/SDK.
// Refer to official documentation for exact syntax.
// audio.createGeneration({
// model: "google/lyria2",
// prompt: "An upbeat jazz track with piano, bass, and drums, 120 bpm, in C major.",
// negative_prompt: "No trumpets or distorted guitars.",
// seed: 12345
// });
Get Generated Audio (Conceptual)
// Example for fetching generated audio.
// audio.fetchGeneration("generation_id_xyz123");
Key API Parameters
-
model:string- Specifies the AI model to use (e.g.,"google/lyria2"). -
prompt:string- The descriptive text prompt to guide audio generation. -
negative_prompt:string- A description of elements to exclude from the generated audio. -
seed:number- An optional seed for deterministic generation. Providing a seed helps reproduce the same audio output given identical prompts and parameters.
⚖️ Comparison with Other Google AI Models
- Lyria 2 vs. Google MusicFX/MusicLM: Lyria 2 represents a significant advancement over Google's previous models like MusicFX and MusicLM. It offers more sophisticated controls such as BPM and key signature adjustments, alongside capabilities for lyric-to-song generation.
- Lyria 2 vs. Lyria RealTime: It's important to distinguish between these two models. Lyria 2 is primarily designed for generating complete, high-quality audio clips from text prompts. In contrast, Lyria RealTime is a separate model specifically focused on interactive and real-time music creation and performance, offering different functionalities for live applications.
🔗 Seamless API Integration
Lyria 2 is easily accessible via the AI/ML API, enabling developers to integrate its powerful music generation capabilities into their own platforms and applications. For comprehensive details and implementation guidelines, refer to the official documentation:
Access Lyria 2 API Documentation Here
❓ Frequently Asked Questions (FAQ)
-
Q: What is Lyria 2 primarily used for?
A: Lyria 2 is ideal for generating professional-grade instrumental background music, scores, and sound effects for content creation, musical prototyping, and soundscape design from text prompts. -
Q: How does Lyria 2 compare to Google's earlier music AI models?
A: Lyria 2 offers significant improvements over models like MusicFX and MusicLM, providing more advanced controls such as BPM, key signature, and lyric-to-song generation capabilities. -
Q: Can I control specific musical elements like tempo or key with Lyria 2?
A: Yes, Lyria 2 features advanced controls including negative prompting, seed-based generation, and specific settings for tempo (BPM) and key signature, giving users granular creative control. -
Q: What is the typical generation speed and audio quality of Lyria 2?
A: Lyria 2 typically generates 30 seconds of high-fidelity 48kHz stereo WAV audio within 10 to 20 seconds. -
Q: Is Lyria 2 suitable for real-time music performance?
A: No, Lyria 2 is designed for generating complete audio clips. For interactive, real-time music creation and performance, Google offers Lyria RealTime, a separate model.
Learn how you can transformyour company with AICC APIs



Log in