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-5;chirp-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,主要包括:extend、upload_extend、cover、upload_cover、replace_section、concat、stems、all_stems、remaster。
  • prompt: 来自Suno的灵感模式提示。
  • model: 本次音乐生成任务的模型,默认是chirp-v4,主要包括:chirp-v3、chirp-v4、chirp-v3-5、chirp-v4-5、chirp-v4-5-plus、chirp-v5、chirp-v5-5。
  • lyric: 自定义模式的歌词内容。
  • custom: 是否使用自定义模式,默认是:false。
  • instrumental: 纯音乐选项。
  • title: 自定义模式的歌曲标题。
  • style: 自定义模式的音乐风格。
  • 其他参数如audio_weight、persona_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: 歌曲风格,选填。

填写示例代码如下:

生成的代码如下:

<

相关推荐
爱学习的程序媛18 小时前
Python常用框架梳理
开发语言·后端·python·ai·web·后端框架·python框架
GISer_Jing18 小时前
Agent核心内容
后端·ai·langchain
一个天蝎座 白勺 程序猿20 小时前
别让收藏夹替你学习:我搭AI知识体系的完整方法,脚本直接拿去用
人工智能·学习·ai·ai学习
Mininglamp_271820 小时前
Mano-P 低配部署:多模型并行的实际配置清单
ai·本地部署·mano-p
Martina_03211 天前
AI生成的3D白模单帧没问题,镜头一移动就被挡?用6步检查遮挡与构图
图像处理·人工智能·数学建模·3d·ai·自然语言处理·游戏策划
七夜zippoe1 天前
Token 账单翻了 10 倍:Agent 成本失控的排查过程与优化实录
ai·agent·token·成本失控
民乐团扒谱机1 天前
Agent-Skills 新手入门与实战部署指南
人工智能·ai·agent·skill
深圳雨林凯AI1 天前
商品详情长图的自动生成:版块模板、要素抽取与版式约束的实现思路
人工智能·ai
Miya_Ye2 天前
AI工具 Phoenix
ai·工具
吴名氏.2 天前
Java转AI Agent教程(第十三周)混合检索与重排
java·数据库·人工智能·ai·ai agent