Docs
audio
Text To Music

Text To music

The Text to music Generation API provides a simple yet powerful interface for converting text into music.

Endpoint

POST /audio/v1/text-to-music

Body

  • prompt (string, required): The text input to be converted into music.

  • duration (number, optional): Specifies the length of the generated music file in seconds

    duration default value 8

Example

Request

POST /audio/v1/text-to-speech
Content-Type: application/json
x-access-key: YOUR_ACCESS_KEY
{
    "prompt": "<Input text>",
    "duration": "<Input number>"
}

Response

Success
HTTP/1.1 200 OK
Content-Type: application/json
 
{
    "success": true,
    "data": url,
    "message": "<process success message>"
 
     }
Error
HTTP/1.1 400 Bad Request
Content-Type: application/json
{
    "success": false,
    "message": "<An error message containg the details>"
}