Compose

编译:一句需求 → 歌词与风格(免费)/ Compile a request into a spec (free)

把一句自然语言需求编译成可直接生成的 GenerationSpec:标题、英文风格标签、带段落标记的歌词、负面标签、时长。不扣额度。

Turns one sentence into a ready-to-generate spec (title, style tags, sectioned lyrics, negative tags, duration). Free. If spec.status is needs_input, ask the user spec.question.question and call again with clarificationAnswer. Guests: 5 calls/day per IP (cached 24 h). Signed-in or API key: 30 calls/hour.

post/v1/prompts/compile

Request

  • Base URL: https://api.musicsforyou.com
  • URL: https://api.musicsforyou.com/v1/prompts/compile
  • Auth: one of:
    • HTTP bearer
    • OAuth 2 (authorization code, authorization URL https://www.musicsforyou.com/oauth/authorize, token URL https://api.musicsforyou.com/oauth/token, scopes: music)
    • none

Request body

textstring required

一句话需求,任何语言 / What the song is for, in any language

uiLanguage'zh' | 'en' | 'ja'

界面/解释文字语言 / Language of explanations

sceneIdstring nullable

场景 id,见 GET /v1/presets / Scene id from list_presets

lyricLanguage'zh' | 'yue' | 'en' | 'ja'

歌词语言 / Lyric language (yue = Cantonese)

vocalPreference'm' | 'f' | 'duet' | 'choir'

人声偏好 / Vocal preference

instrumentalboolean nullable

纯音乐 / Instrumental only

durationSecondsinteger nullable

目标时长(秒)/ Target length in seconds

clarificationAnswerstring nullable

对上一次 status=needs_input 的 question 的回答 / Answer to a previous needs_input question

Example request

{
  "text": "给妈妈 60 岁生日写一首温暖的歌,她最爱在厨房唱歌"
}

Response

编译结果 / Compiled spec

successtrue required

Example response

{
  "spec": {
    "composition": {
      "sections": [
        {
          "label": "Verse 1"
        }
      ]
    }
  }
}

Changes

No recorded changes to this operation across all 1 revision of this API.