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: 歌曲风格,选填。

填写示例代码如下:

生成的代码如下:

<

相关推荐
AI办公探索者3 小时前
多智能体协作架构:从单Agent到多Agent协同的技术演进
人工智能·ai·架构
fthux4 小时前
装闭 RenoPit 源码解析(14):Demo模式、健康检查与Docker部署
人工智能·ai·开源·github·open source·renopit
蜘蛛小助理5 小时前
生鲜冷链批次效期与多仓调拨损耗管控|低代码搭建生鲜供应链台账
人工智能·低代码·ai·erp·多维表格·蜘蛛表格·生鲜
DS随心转APP5 小时前
AI生成的word怎么下载?AI导出鸭技术架构深度测评
人工智能·ai·架构·word·deepseek·ai导出鸭
Code额7 小时前
Python 连接 DeepSeek API,OpenAI
开发语言·python·ai·ai编程
特立独行的猫a7 小时前
AI 智能硬件:下一个风口的底层逻辑与产品机会
人工智能·ai·智能硬件·趋势·风口·机会
TechEdu2026068 小时前
[人工智能]SciPy在工程计算中的作用与实践
人工智能·ai·scipy
小七-七牛开发者9 小时前
Agent 小知识|Agent 环境工程:部分可观测性、状态转移与执行隔离
ai·大模型·agent·claude·token·工作流·skill·claudecode·ai coding
Bruce_Liuxiaowei11 小时前
安全意识培训——大模型在安全培训中的创新应用
人工智能·安全·ai·智能体
Java小白笔记12 小时前
Windows系统免软件命令激活
java·网络·人工智能·windows·ai·ai编程