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

填写示例代码如下:

生成的代码如下:

<

相关推荐
Mirawork18 小时前
AI 低代码建站原理:从自然语言需求到在线应用,拆解 AI 生成网页的完整技术链路
人工智能·低代码·ai·ai编程
富贵儿99820 小时前
NL2SQL 实践手记 03:让模型决定下一步——把 Workflow 改造成 SQL Agent
数据库·python·sql·ai·自然语言处理·langchain
阿阿阿安1 天前
智能体通信协议(一) MCP 之架构与协议规范
人工智能·ai·agent·mcp
Smoothcloud润云1 天前
GPU服务器租用训练缓存小文件与inode耗尽排查实战
运维·服务器·人工智能·缓存·ai·gpu算力
喵了几个咪1 天前
GoWind Admin 拆解:智能问数——从一句自然语言到一张可信图表
ai·golang·llm·智能问数·gowind
人工智能研究所1 天前
开源 AI 手绘动画:一句话画出会走路、会“昼夜交替“的手绘风格动画
人工智能·ai·开源·手绘动画·线条动画·ai 动画
镜舟科技1 天前
一个底座承载四种负载:MirrorData 统一数据底座的存储与计算设计
sql·ai·负载·数据底座·mirrordata·mirrorlake·mirrorbase
Escalating_xu1 天前
【COZE实战】数据库(四):结构化记忆、用户隔离与问答缓存
数据库·人工智能·ai
李航19831 天前
Codex现代风格卧室设计案例1
人工智能·python·计算机视觉·设计模式·ai
极客先躯1 天前
智能体开发高级面试每日一题|2026-05-26|Agent 和 Workflow 的区别是什么?什么场景该用 Workflow,什么场景该用 Agent?
ai·面试·职场和发展·架构·每日一题·高级面试·智能体开发