ModelsLab/Music Generator
music_genThe Music Generation API allows you to generate music based on textual prompts and optional conditioning melodies.
API Endpoint URL
Base URL for all API requests to this endpoint.
https://modelslab.com/api/v6/voice/music_gen
API Authentication
Authentication requires a valid API key included in the request. Generate and manage your API keys from your developer dashboard. Include the key in the key parameter for all API requests.
Integration Examples
Production-ready code samples for API integration
{"prompt": "marimba, percussion, bass, tropical house, melodic riff, G# minor, 96 bpm","init_audio": "https://pub-3626123a908346a7a8be8d9295f44e26.r2.dev/livewire-tmp/IxizU51vL2IwiEjy6XtvbDECa9f16E-metaU2hhcGUgb2YgeW91IFJpbmd0b25lIO+9nO+9nCBJbnN0cnVtZW50YWwgQkdNIO+9nO+9nCBMSUdIVCBHT0pPLndhdg==-.wav","sampling_rate ": "32000","base64": "false","webhook": null,"track_id": null,"key": "YOUR_API_KEY"}
SDKs
Official SDKs
Production-ready SDKs and client libraries for all major programming languages
API Parameters
Technical specifications for API request parameters.
| Field Name | Parameter | Technical Description |
|---|---|---|
| Prompt | prompt | Prompt |
| Init Audio (optional) | init_audio | init_audio |
| sampling_rate | sampling_rate | Sampling rate of the generated music. Default: 32000, Minimum: 10000. |
| base64 | base64 | Whether the input sound clip is in base64 format. Default: false. |
| webhook | webhook | URL to receive POST callback upon completion |
| track_id | track_id | Unique ID for identifying webhook responses |