Trim and Loop Audio - Music From Text Generation
This API allows you to Generate stunning AI-driven music from text prompts — then intelligently detects and creates a seamless loop that syncs perfectly with your creative vision. Choose between:- 🎧 HD Quality →
sansaar_1
(Higher fidelity) - ⚡ Fast Mode →
sansaar_1_lite
(Quicker processing)
Core Parameters
🛈 The parameters below define the request body for this API.
Parameter | Type | Required? | Description |
---|---|---|---|
prompt | string | ✅ Required | Text description of the music. |
duration | int | ⚠️ Optional | Track length (15s , 30s , 60s , 180s ). |
model | string | ⚠️ Optional | "sansaar_1" (HQ) or "sansaar_1_lite" (Faster). |
loop | bool | ⚠️ Optional | Whether the music should loop. |
loopCount | int | ✅ Required | Number of times the trimmed part should loop. |
Request Example
Code Samples
Response
Sample Output
Possible Errors :
- If NSFW words are detected
- If Artist name is detected
- If Length of provided audio is too short.
- If Length of looped audio is more than 960.
Trim and Loop Audio - Prompt Based Generation
This API allows you to feed in your prompt, get AI-powered audio — then automatically trim and loop the most seamless segment, perfectly aligned with your creative vision.Core Parameters
The following parameters are required to send a valid request:Parameter | Type | Required? | Description |
---|---|---|---|
prompt | string | ✅ Required | Text description of the music. |
styleOfMusic | string | ✅ Required | Preferred style. Select one from supported styles listed below. |
audioUrl | string | ⚠️ Optional | URL to a reference audio file for influence. |
loopCount | int | ✅ Required | Number of times to loop the detected seamless segment. |
Request Example
Code Samples
Response
Sample Output
Possible Errors :
- If Rate Limits have been passed for User.
- If NSFW words are detected
- If Artist name is detected
- If Length of provided audio is too short.
- If Length of looped audio is more than 960.
Trim and Loop Audio - Lyrics Based Generation
This API allows you to feed in your lyrics, get AI-powered audio — then automatically trim and loop the most seamless segment, perfectly aligned with your creative vision.Core Parameters
The following parameters are required to send a valid request:Parameter | Type | Required? | Description |
---|---|---|---|
lyrics | string | ✅ Required | Lyrics to be converted into a song. |
styleOfMusic | string | ⚠️ Optional (Either styleOfMusic or audioUrl must be present) | Preferred style. Select one from supported styles listed above. |
audioUrl | string | ⚠️ Optional (Either styleOfMusic or audioUrl must be present) | URL to a reference audio file for influence. |
loopCount | int | ✅ Required | Number of times to loop the detected seamless segment. |
Request Example
Code Samples
Response
Sample Output
Possible Errors :
- If Rate Limits have been passed for User.
- If NSFW words are detected
- If Artist name is detected
- If Length of provided audio is too short.
- If Length of looped audio is more than 960.