Content Studio

Music Generation

Generate an original song from lyrics or a short description.

music.generate composes a full track with vocals from your lyrics, or writes the lyrics for you from a short description. No upload is needed.

OperationInputCreditsResult files
music.generateNone80 credits per trackaudio, lyrics

Input

lyricsstringoptional

Song lyrics, up to 3000 characters. Either lyrics or text is required.

textstringoptional

A description to write lyrics from, up to 3000 characters.

stylestringoptional

Genre or style, for example Lo-fi or Cinematic.

durationstringoptionaldefault: 30 seconds

Target length, for example 60 seconds.

vocaliststringoptionaldefault: solo

Vocal arrangement.

genderstringoptionaldefault: male

Voice gender.

deliverystringoptionaldefault: singing

Vocal delivery.

customInstructionsstringoptional

Extra direction, up to 3000 characters.

Code Example

curl -X POST https://api.transpera.io/v1/jobs \
  -H "authorization: Bearer tp_test_..." \
  -H "content-type: application/json" \
  -H "idempotency-key: $(uuidgen)" \
  -d '{
    "operation": "music.generate",
    "input": {"text": "A song about the monsoon", "style": "Lo-fi", "duration": "60 seconds"}
  }'

Result

Result of a finished music.generate job
{
  "job": {
    "id": "JOB_ID",
    "operation": "music.generate",
    "status": "succeeded",
    "chargedCredits": 80,
    "result": {
      "type": "files",
      "text": null,
      "files": [
        {
          "role": "audio",
          "fileName": "music.mp3",
          "url": "https://...",
          "expiresAt": "..."
        },
        {
          "role": "lyrics",
          "fileName": "lyrics.txt",
          "url": "https://...",
          "expiresAt": "..."
        }
      ]
    }
  }
}