Code examples for integrating the free FreeMusicLab.ai music API into your apps.
- Free forever — no auth required for read endpoints
- 2,000+ AI-generated tracks — royalty-free, no Content ID claims
- Generation source: Google Lyria (Vertex AI / Gemini API). Commercial use permitted under Google's Generative AI Terms.
- Full docs: https://freemusiclab.ai/docs
- License: https://freemusiclab.ai/license
react-player/— React hooks + audio playerpython/— Python requests examplesnode/— Node.js fetch examplescurl/— plain HTTP examples
curl "https://freemusiclab.ai/api/tracks?genre=lofi&limit=10"fetch('https://freemusiclab.ai/api/tracks?genre=lofi')
.then(r => r.json())
.then(({ tracks }) => console.log(tracks));import requests
tracks = requests.get('https://freemusiclab.ai/api/tracks', params={'genre': 'lofi'}).json()
print(tracks)- AI disclosure: when using tracks in monetized YouTube/TikTok/Meta content, enable the AI-generated content label on your platform.
- SynthID: every first-party track carries an inaudible watermark identifying it as AI-generated.
- Commercial use: permitted via Google's Generative AI Terms. See license for full details.
Most music APIs charge $50-500/month and restrict commercial use. FreeMusicLab.ai uses Google Lyria (a licensed model with commercial-use output rights) to provide indie devs and creators a free alternative on solid legal footing.
PRs welcome! If you build something cool with the API, add an example to this repo.
MIT.
Built by @Dogfather1 · Part of FreeMusicLab.ai