Suno歌曲生成API集成指南

随着AI的广泛应用,各种AI程序逐渐变得流行。AI逐渐渗透到人们工作和生活的各个方面,涉及的行业也在不断增加,从最初的写作、医疗教育,到现在的音乐创作。

Suno是一个专业的高质量AI歌曲和音乐创作平台。用户只需输入简单的文本提示,就能根据流派风格和歌词生成带有人声的歌曲。该AI音乐生成器由来自Meta、TikTok和Kensho等知名科技公司的团队成员开发,旨在让每个人都能在没有乐器的情况下创作美妙的音乐。

版本更新进展

版本 模型 发布日期 提示限制 风格限制 最大歌曲时长
v5.5 chirp-v5-5 2026.03.27 5000 1000 8分钟
v5 chirp-v5 2025.09.23 5000 1000 8分钟
v4.5+ chirp-v4-5-plus 2025.07.17 5000 1000 8分钟
v4.5 chirp-v4-5 2025.05.03 5000 1000 4分钟
v4 chirp-v4 2024.12.17 3000 200 150秒
v3.5 chirp-v3-5 --- 3000 200 120秒

Suno目前支持最新的chirp-v5-5模型。要使用最新版本,请将model参数设置为chirp-v5-5chirp-v5及之前的版本仍然可用。

然而,Suno并未官方提供API。AceDataCloud提供了一组Suno API,模拟了官方的集成,方便快捷地生成所需的音乐。

环境准备/前置条件

在开始之前,请确保您已注册AceDataCloud并获取API访问凭证。可以访问AceDataCloud官方网站注册和申请API密钥。

详细步骤

1. 申请API凭证

首先访问Suno Audios生成API页面,单击"获取"按钮以获取请求所需的凭证:

如果您未登录或注册,系统将自动重定向到登录页面。登录或注册后,您将自动返回当前页面。

首次申请时,将有免费配额可供使用。

2. 基本用法

如果您想生成一首歌曲,可以输入任何文本。例如,如果我想生成一首关于圣诞节的歌曲,可以输入a song for Christmas,如下图所示:

在请求头中,我们设置了以下内容:

  • accept: 请求的响应格式,这里填写为application/json,表示接收JSON格式。
  • authorization: 调用API的密钥,可以在申请后直接选择。

同时,我们设置了请求体,包括:

  • action: 音乐生成任务的操作,默认是generate,主要包括:extendupload_extendcoverupload_coverreplace_sectionconcatstemsall_stemsremaster
  • prompt: 来自Suno的灵感模式提示。
  • model: 本次音乐生成任务的模型,默认是chirp-v4,主要包括:chirp-v3chirp-v4chirp-v3-5chirp-v4-5chirp-v4-5-pluschirp-v5chirp-v5-5
  • lyric: 自定义模式的歌词内容。
  • custom: 是否使用自定义模式,默认是:false
  • instrumental: 纯音乐选项。
  • title: 自定义模式的歌曲标题。
  • style: 自定义模式的音乐风格。
  • 其他参数如audio_weightpersona_id等。

生成的代码如下:

可以点击"试试"按钮直接测试API,等待1-2分钟后,结果如下:

json 复制代码
{
  "success": true,
  "task_id": "e72fb249-bd5b-4e2a-b20c-8a06fea5ac14",
  "trace_id": "7dbc5b6a-b2c0-4d85-9d39-fa8a8a785ccf",
  "data": [
    {
      "id": "b481b17a-bf50-4e10-8adc-4d5635050893",
      "title": "Under the Mistletoe",
      "image_url": "https://cdn2.suno.ai/image_b481b17a-bf50-4e10-8adc-4d5635050893.jpeg",
      "lyric": "[Verse]\nSnowflakes falling on the ground\nTwinkling lights all around\nThe scent of pine fills the air\nChristmas magic everywhere\n[Chorus]\nUnder the mistletoe tonight\nHearts aglow in the soft moonlight\nLaughter echoes\nSpirits bright\nIt's Christmas time\nIt feels so right\n[Verse 2]\nStockings hung by the fire's glow\nWarmth inside while the cold winds blow\nCookies baking\nSweet delight\nA season of joy shining bright\n[Chorus]\nUnder the mistletoe tonight\nHearts aglow in the soft moonlight\nLaughter echoes\nSpirits bright\nIt's Christmas time\nIt feels so right\n[Bridge]\nCarols sung by candlelight\nStars above make the world feel tight\nPeace and love\nA season's creed\nFilling hearts with all we need\n[Chorus]\nUnder the mistletoe tonight\nHearts aglow in the soft moonlight\nLaughter echoes\nSpirits bright\nIt's Christmas time\nIt feels so right",
      "audio_url": "https://cdn1.suno.ai/b481b17a-bf50-4e10-8adc-4d5635050893.mp3",
      "video_url": "",
      "created_at": "2025-06-17T15:59:32.468Z",
      "model": "chirp-auk",
      "state": "succeeded",
      "prompt": "A song for Christmas",
      "style": "holiday, cheerful, male vocals",
      "duration": 154.92
    }
  ]
}

可以看到,我们获得了两首歌曲的内容,包括标题、预览图、歌词、音频等。

3. 自定义生成

如果您想自定义歌词的生成,可以输入歌词:

在此时,lyric字段可以接受如下内容:

复制代码
[Verse]\nSnowflakes falling all around\nGlistening white\nCovering the ground\nChildren laughing\nFull of delight\nIn this winter wonderland tonight\nSanta's sleigh\nUp in the sky\nRudolph's nose shining bright\nOh my\nHear the jingle bells\nRinging so clear\nBringing joy and holiday cheer\n[Verse 2]\nRoasting chestnuts by the fire's glow\nChristmas lights\nThey twinkle and show\nFamilies gathering with love and cheer\nSpreading warmth to everyone near

请注意,歌词中的\n是换行符。如果您不知道如何生成歌词,可以使用AceDataCloud提供的歌词生成API通过提示生成歌词。API地址为Suno Lyrics Generation API

接下来,我们需要根据歌词、标题和风格自定义生成歌曲,可以指定如下内容:

  • lyric: 歌词文本
  • custom: 填写为true,表示自定义生成;该参数默认为false,表示使用prompt生成。
  • title: 歌曲标题。
  • style: 歌曲风格,选填。

填写示例代码如下:

生成的代码如下:

<

相关推荐
jiayong233 小时前
harness 与 hermes-agent 运行原理和核心流程
人工智能·ai·智能体·harness·hermes-agent
YueJoy.AI3 小时前
创业团队如何建立技术品牌
人工智能·ai·语言模型
星辰AI3 小时前
AIOps 实战:智能运维在 AI 应用中的实践
人工智能·ai·语言模型
m0_380167143 小时前
CoinGlass API、Tardis、Coinalyze:加密衍生品数据 API 怎么选?
人工智能·ai·区块链
m0_380167144 小时前
最适合交易机器人的加密数据 API:CoinGlass API 指南
人工智能·ai·区块链
jiayong234 小时前
RAG系列(三):实践案例与高级优化
ai·架构·rag·智能体
踏着七彩祥云的小丑4 小时前
AI学习——LangChain + Agent
人工智能·学习·ai
Zeeland4 小时前
我做了一个 Agent Team 协作平台——Rudder:让 Agent Team 在实践中成长
人工智能·ai·agent
AndrewHZ4 小时前
【大模型技术博客】什么是大语言模型(LLM)?从零认识AI新范式
人工智能·深度学习·ai·语言模型·大模型·llm·transformer