Skip to content
Music to Prompt

Developer API

Reverse audio features into a structured prompt, generate lyrics, or enhance a prompt, from your own code or an AI agent. Create a key on your account page.

Authentication

Pass your key as a bearer token (or an x-api-key header). Requests count against your account's daily limits.

Authorization: Bearer mtp_live_xxxxxxxx

Endpoints

Audio extraction runs in the browser, so reverse takes the measured features and returns the structured prompt.

POST https://musictoprompt.org/api/v1/reverse
{
  "detected": {
    "bpm": 92, "key": "F#", "mode": "minor",
    "duration": 214, "energy": 0.42,
    "sections": [{ "label": "intro", "start": 0, "end": 18 }]
  }
}
-> { "detected": {...}, "inferred": {...}, "prompt_text": "..." }

POST https://musictoprompt.org/api/v1/lyrics
{ "theme": "a long drive home", "genre": "indie", "moods": ["nostalgic"] }
-> { "lyrics": "[Verse 1]...", "source": "live" }

POST https://musictoprompt.org/api/v1/enhance
{ "prompt": "chill lofi beat", "target": "suno" }
-> { "prompt": "...", "added": ["tempo","mood"], "source": "live" }
curl -X POST https://musictoprompt.org/api/v1/enhance \
  -H "Authorization: Bearer $MTP_KEY" \
  -H "content-type: application/json" \
  -d '{"prompt":"chill lofi beat","target":"suno"}'

MCP server (beta)

Connect an AI agent (e.g. Claude) to the same tools via the Model Context Protocol. Point your MCP client at the endpoint below and authenticate with your API key. Tools: reverse_prompt, generate_lyrics, enhance_prompt.

https://musictoprompt.org/api/mcp   (Authorization: Bearer mtp_live_xxxxxxxx)

Beta, verify against your MCP client; the transport is JSON over HTTP.