Create an AI-generated lyrics based on your prompt

December 2, 2024

Table of contents

  1. Request Headers
  2. Request Body
  3. Responses
  4. Model
  5. Examples
  6. Try It

https://api.useapi.net/v1/mureka/music/lyrics-generate

Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
# Alternatively you can use multipart/form-data
# Content-Type: multipart/form-data
Request Body
{
    "account": "Optional Mureka API account",
    "prompt": "Optional text prompt"
}
  • account is optional when only one account configured. However, if you have multiple music configured, this parameter becomes required.

  • prompt is optional. Use it to guide AI to generate desired lyrics. If omitted AI will generate some random lyrics.

Responses
  • 200 OK

    {
        "lyrics": "<lyrics generated by AI based on your optional prompt>"
    }
    
  • 400 Bad Request

    {
      "error": "<Error message>",
      "code": 400
    }
    
  • 401 Unauthorized

    {
      "error": "Wrong username/password combination.",
      "code": 401
    }
    
Model
{ // TypeScript, all fields are optional
    lyrics: string
}
Examples
  • curl -H "Accept: application/json" \
         -H "Content-Type: application/json" \
         -H "Authorization: Bearer …" \
         -X POST https://api.useapi.net/v1/mureka/music/lyrics-generate \
         -d '{"account": "…", "prompt": "…"}'
    
  • const account = "Mureka account";      
    const prompt = "Silly song about Santa";      
    const apiUrl = `https://api.useapi.net/v1/mureka/music/lyrics-generate`; 
    const api_token = "API token";
    const data = { 
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${api_token}`,
        'Content-Type': 'application/json' }
    };
    data.body = JSON.stringify({ 
      account, prompt
    });
    const response = await fetch(apiUrl, data);
    const result = await response.json();
    console.log("response", {response, result});
    
  • import requests
    account = "Mureka account"
    prompt = "Silly song about Santa"
    apiUrl = f"https://api.useapi.net/v1/mureka/music/lyrics-generate" 
    api_token = "API token"
    headers = {
        "Content-Type": "application/json", 
        "Authorization" : f"Bearer {api_token}"
    }
    body = {
        "account": f"{account}",
        "prompt": f"{prompt}"
    }
    response = requests.post(apiUrl, headers=headers, json=body)
    print(response, response.json())
    
Try It