API 接口

MiniMax 提供商

POST/v2/minimax/generate

MiniMax 提供商生成 API

通过集成的 MiniMax 提供程序生成音乐。

POSThttps://udioapi.pro/api/v2/minimax/generate

tips

MiniMax 提供商:仅在你明确需要接入 MiniMax 时使用此 endpoint。默认音乐生成流程仍是 /v2/generate

Provider 任务:此路由会创建异步 MiniMax 任务并返回 task_id

积分消耗:每次生成请求 30 credits。

轮询:每 5-10 秒调用 /v2/minimax/feed?workId=...,直到任务为 SUCCESSFAILED

回调:传入 callback_url,任务到达 SUCCESSFAILED 时会收到 POST 通知。

requestHeaders

namerequireddescription
nameAuthorizationrequiredyesdescription用于身份验证的承载令牌
nameContent-Typerequiredyesdescriptionapplication/json

requestBody

MiniMax 生成请求

commonParams

paramNameparamTyperequireddescriptionexample
paramNamepromptparamTypestringrequiredyesdescription音乐生成提示exampleCinematic orchestral pop, emotional female vocal, warm piano, strings, gradual build, polished studio mix.
paramNamelyricsparamTypestringrequirednodescription可选歌词exampleVerse 1: The city lights are fading\nChorus: We rise into the morning glow
paramNamebitrateparamTypenumberrequirednodescription音频比特率example256000
paramNamesample_rateparamTypenumberrequirednodescription音频采样率example44100
paramNamecallback_urlparamTypestringrequirednodescription可选回调 URLexamplehttps://api.example.com/webhooks/minimax
paramNamepublicparamTypebooleanrequirednodescription任务是否可以公开examplefalse

响应字段

生成响应

fieldparamTypedescriptionexample
fieldcodeparamTypenumberdescription响应码。200 表示任务创建成功。example200
fieldmessageparamTypestringdescription人类可读的响应消息。examplesuccess
fielddata.task_idparamTypestringdescriptionMiniMax 生成任务 ID。轮询 feed 端点时将其用作 workId。examplen74abc123music
fielddata.statusparamTypestringdescription任务初始状态。exampleIN_PROGRESS

responses

json
{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "n74abc123music",
    "status": "IN_PROGRESS",
    "type": "text2music"
  }
}
json
{
  "code": 400,
  "message": "Bad Request: 'prompt' is required.",
  "data": null
}
json
{
  "code": 401,
  "message": "No API key provided in Authorization header",
  "data": null
}

codeExamples

curl
curl -X POST "https://udioapi.pro/api/v2/minimax/generate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "Cinematic orchestral pop, emotional female vocal, warm piano, strings, gradual build, polished studio mix.",
    "lyrics": "Verse 1: The city lights are fading\nChorus: We rise into the morning glow",
    "bitrate": 256000,
    "sample_rate": 44100,
    "callback_url": "https://api.example.com/webhooks/minimax"
  }'
javascript
const response = await fetch('https://udioapi.pro/api/v2/minimax/generate', {
  method: 'POST',
  headers: {
    Authorization: 'Bearer YOUR_API_KEY',
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    prompt: 'Cinematic orchestral pop, emotional female vocal, warm piano, strings, gradual build, polished studio mix.',
    lyrics: 'Verse 1: The city lights are fading\nChorus: We rise into the morning glow',
    bitrate: 256000,
    sample_rate: 44100,
    callback_url: 'https://api.example.com/webhooks/minimax'
  })
});

const data = await response.json();
console.log(data.data.task_id);
GET/v2/minimax/feed?workId=xxx

MiniMax 提供程序任务状态 API

获取 MiniMax 任务的状态和结果 URL。

GEThttps://udioapi.pro/api/v2/minimax/feed?workId=xxx

tips

使用生成端点中的task_id作为workId

当状态变为SUCCESS时,响应包含音频URL。

requestParams

paramNameparamTyperequireddescription
paramNameworkIdparamTypestringrequiredyesdescription从生成端点返回的 MiniMax 任务 ID

responses

json
{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "n74abc123music",
    "status": "IN_PROGRESS",
    "consumed_credits": 30,
    "error_message": null,
    "created_at": "2026-06-13 12:00:00",
    "type": "text2music",
    "request": {
      "prompt": "Cinematic orchestral pop...",
      "bitrate": 256000,
      "sample_rate": 44100
    },
    "response": null
  }
}
json
{
  "code": 200,
  "message": "success",
  "data": {
    "task_id": "n74abc123music",
    "status": "SUCCESS",
    "consumed_credits": 30,
    "error_message": null,
    "created_at": "2026-06-13 12:00:00",
    "type": "text2music",
    "request": {
      "prompt": "Cinematic orchestral pop...",
      "bitrate": 256000,
      "sample_rate": 44100
    },
    "response": [
      "https://example-cdn.com/generated-minimax-track.mp3"
    ]
  }
}
json
{
  "code": 404,
  "message": "Task not found",
  "data": null
}

codeExamples

curl
curl -X GET "https://udioapi.pro/api/v2/minimax/feed?workId=n74abc123music"
javascript
const response = await fetch('https://udioapi.pro/api/v2/minimax/feed?workId=n74abc123music');
const data = await response.json();

if (data.data.status === 'SUCCESS') {
  console.log('Audio URLs:', data.data.response);
}