Generate

一步到位:一句话 → 完整歌曲(扣 1 次)/ One-shot: text in, finished song out (1 credit)

服务端自动完成编译 → 生成 → 等待。最多等待 waitSeconds(默认 120 秒,上限 180):完成返回 200,超时仍在生成返回 202,之后用 GET /v1/generations/{id} 继续查。扣 1 次额度,返回 2 首候选。

Compiles, submits and waits in one call. Waits up to waitSeconds (default 120, max 180): 200 when finished, 202 if still running (keep polling GET /v1/generations/{id}). Costs 1 credit; returns 2 candidate tracks in generation.clips. A typical song takes 1–3 minutes.

post/v1/songs

Request

  • Base URL: https://api.musicsforyou.com
  • URL: https://api.musicsforyou.com/v1/songs
  • 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)

Request body

textstring required

一句话需求 / What the song is for

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

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

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

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

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

人声偏好 / Vocal preference

instrumentalboolean nullable
durationSecondsinteger nullable
waitSecondsinteger

最多等待多少秒再返回;0 表示立即返回 / How long to wait for the song before returning; 0 returns immediately

Example request

{
  "text": "A warm birthday song for my mom who loves singing in the kitchen"
}

Response

已完成 / Finished (generation.status = finished)

successtrue required

Example response

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

Changes

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