Generate
提交生成(扣 1 次)/ Submit a generation (1 credit)
spec(推荐)、rendered、prompt 三选一。立即返回 202 与 generation id,然后轮询 GET /v1/generations/{id} 或订阅 SSE,直到 status 为 finished(clips[] 有两首候选的 audioUrl)或 failed(自动退回额度)。
Provide one of spec (recommended), rendered or prompt. Returns 202 immediately; poll until finished (two clips with audioUrl) or failed (credit refunded). Use idempotencyKey to make retries safe. Rate limit: 5 submissions per minute per IP.
post/v1/generations
Request
- Base URL: https://api.musicsforyou.com
- URL: https://api.musicsforyou.com/v1/generations
- 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
Example request
{
"spec": {
"composition": {
"sections": [
{
"label": "Verse 1"
}
]
}
}
}Response
已受理 / Accepted
Example response
{
"generation": {
"spec": {
"composition": {
"sections": [
{
"label": "Verse 1"
}
]
}
}
}
}Changes
No recorded changes to this operation across all 1 revision of this API.