KIE.AI
Chinese
  • English
  • Chinese
Chinese
  • English
  • Chinese
Support
Chinese
  • English
  • Chinese
MarketVeo3.1 APISuno API
4o Image APIFlux Kontext APIRunway APILuma APIFile Upload APICommon API
MarketVeo3.1 APISuno API
4o Image APIFlux Kontext APIRunway APILuma APIFile Upload APICommon API
  1. Music Generation
  • Suno API 快速开始
  • Music Generation
    • 生成音乐回调
    • 音乐扩展回调
    • 音频上传和翻唱回调
    • 音频上传和扩展回调
    • 添加伴奏回调
    • 添加人声回调
    • 音乐封面生成回调
    • 替换音乐分区回调
    • 生成音乐
      POST
    • 延长音乐
      POST
    • 上传并翻唱音乐
      POST
    • 上传并扩展音乐
      POST
    • 添加伴奏生成音乐
      POST
    • 添加人声生成音乐
      POST
    • 获取音乐任务详情
      GET
    • 获取带时间戳的歌词
      POST
    • 提升音乐风格
      POST
    • 替换音乐分区
      POST
    • 生成音乐封面
      POST
    • 获取音乐封面生成详情
      GET
    • 生成 Persona
      POST
  • Lyrics Generation
    • 生成歌词回调
    • 生成歌词
      POST
    • 获取歌词任务详情
      GET
  • WAV Conversion
    • 转换为WAV格式回调
    • 转换为WAV格式
      POST
    • 获取WAV转换详情
      GET
  • Vocal Removal
    • 音频分离回调
    • MIDI 生成回调
    • 从音频生成 MIDI
    • 获取 MIDI 生成详情
    • 人声和乐器分离
    • 获取人声和乐器分离详情
  • Music Video Generation
    • MP4生成完成回调
    • 创建音乐视频
    • 获取音乐视频详情
Chinese
  • English
  • Chinese
Support
Chinese
  • English
  • Chinese
MarketVeo3.1 APISuno API
4o Image APIFlux Kontext APIRunway APILuma APIFile Upload APICommon API
MarketVeo3.1 APISuno API
4o Image APIFlux Kontext APIRunway APILuma APIFile Upload APICommon API
  1. Music Generation

生成音乐

POST
/api/v1/generate
使用AI模型生成带或不带歌词的音乐。

使用指南#

此接口根据您的文本提示创建音乐
每个请求会生成多个变体
您可以通过自定义模式和纯音乐设置来控制细节级别

参数详情#

自定义模式下(customMode: true):
如果 instrumental: true:需提供 style 和 title
如果 instrumental: false:需提供 style、prompt 和 title
不同模型的字符限制:
V4:prompt 3000字符,style 200字符
V4_5 和 V4_5PLUS:prompt 5000字符,style 1000字符
V4_5ALL:prompt 5000字符,style 1000字符
V5:prompt 5000字符,style 1000字符
title 长度限制:80字符(所有模型)
非自定义模式下(customMode: false):
无论 instrumental 设置如何,仅需提供 prompt
prompt 长度限制:500字符
其他参数应留空

开发者注意事项#

新用户建议:以 customMode: false 开始使用,更简单
生成的文件将保留14天
回调过程分三个阶段:text(文本生成)、first(第一首完成)、complete(全部完成)

可选参数#

vocalGender(string): 人声性别偏好。m 男声,f 女声。注意:此参数仅在 customMode 为 true 时生效。根据实践,此参数只能加强概率,但不能保证一定遵循男女声的指令。
styleWeight(number): 对风格的遵循强度。范围 0–1,保留两位小数。示例:0.65。
weirdnessConstraint(number): 创意/离散程度。范围 0–1,保留两位小数。示例:0.65。
audioWeight(number): 音频要素权重。范围 0–1,保留两位小数。示例:0.65。
personaId(string): 应用到生成音乐的personaId。仅在开启自定义模式时可用。使用此参数为音乐生成应用特定的人格风格。要生成personaId,请访问 生成 Persona 接口。

Callbacks

audioGenerated

Request

Authorization
Bearer Token
Provide your bearer token in the
Authorization
header when making requests to protected resources.
Example:
Authorization: Bearer ********************
or
Body Params application/jsonRequired

Examples

Responses

🟢200
application/json
请求成功
Body

🔴500Error
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://api.kie.ai/api/v1/generate' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "prompt": "A calm and relaxing piano track with soft melodies",
    "style": "Classical",
    "title": "Peaceful Piano Meditation",
    "customMode": true,
    "instrumental": true,
    "model": "V4",
    "callBackUrl": "https://api.example.com/callback",
    "negativeTags": "重金属, 快节奏鼓点",
    "vocalGender": "m",
    "styleWeight": 0.65,
    "weirdnessConstraint": 0.65,
    "audioWeight": 0.65,
    "personaId": "persona_123"
}'
Response Response Example
200 - Example 1
{
    "code": 200,
    "msg": "success",
    "data": {
        "taskId": "5c79****be8e"
    }
}
Previous
替换音乐分区回调
Next
延长音乐
Built with