在 OpenClaw 中使用 Suno。
Suno 从文本提示词或精确歌词生成完整歌曲——人声、乐器和混音。v4 到 v5.5 各版本均可通过 RunAPI 使用,由于 Suno 没有官方公开 API,RunAPI 提供了 API 访问能力。OpenClaw agent 使用与聊天相同的 RUNAPI_API_KEY 调用它。
使用 RunAPI 通过 Suno 生成歌曲。
要求:
- 从 RUNAPI_API_KEY 读取 API 密钥。
- 调用 POST https://runapi.ai/api/v1/suno/text_to_music
- 将 model 设为 "suno-v5.5"。
- 将 vocal_mode 设为 "auto_lyrics",以根据提示词由 AI 生成歌词。
- 将 prompt 设为描述你想要的歌曲。
- 该任务为异步任务。轮询返回的 task_id 直到 status 为 "completed"。
- 完成后,从响应 output 中读取音频 URL。
curl -X POST https://runapi.ai/api/v1/suno/text_to_music \
-H "Authorization: Bearer $RUNAPI_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "suno-v5.5",
"vocal_mode": "auto_lyrics",
"prompt": "An upbeat indie pop track about coding late at night, warm synths and acoustic guitar",
"vocal_gender": "female"
}'
{
"task_id": "tsk_abc123",
"status": "pending",
"model": "suno-v5.5"
}
三步在 OpenClaw 中使用 Suno
Configure RunAPI
Set RUNAPI_API_KEY in your environment. If you already configured RunAPI in OpenClaw for chat, the same key works for Suno music generation — no extra provider setup needed.
export RUNAPI_API_KEY=runapi_xxx
Call text_to_music
Send a POST to the text_to_music endpoint with the model and vocal_mode. Use auto_lyrics with a prompt for AI-written lyrics, exact_lyrics with lyrics/style/title for your own words, or instrumental with style/title for no vocals.
POST /api/v1/suno/text_to_music
Poll for the result
The endpoint returns a task_id immediately. Song generation takes 30 seconds to several minutes depending on version. Poll the task status endpoint until the status is completed, then read the output audio URL.
GET /api/v1/suno/text_to_music/tsk_abc123
Suno text_to_music API 参数
| 参数 | 类型 | 说明 |
|---|---|---|
model |
string |
Required. suno-v4, suno-v4.5, suno-v4.5-all, suno-v4.5-plus, suno-v5, or suno-v5.5. |
vocal_mode |
string |
Required. auto_lyrics (AI writes lyrics from prompt), exact_lyrics (you provide lyrics/style/title), or instrumental (no vocals, requires style/title). |
prompt |
string |
Song brief for auto_lyrics mode. Describe genre, mood, tempo, and subject. Forbidden in exact_lyrics and instrumental modes. |
lyrics |
string |
Exact lyrics to sing. Required for exact_lyrics mode. Forbidden in auto_lyrics and instrumental modes. |
style |
string |
Music style description, e.g. lo-fi hip hop, 80s synthwave. Required for exact_lyrics and instrumental modes. |
title |
string |
Song title. Required for exact_lyrics and instrumental modes. |
vocal_gender |
string |
Optional. male or female. |
negative_tags |
string |
Optional. Styles to avoid, e.g. heavy metal, screaming. |
duration_seconds |
integer |
Optional. Target duration in seconds. |
persona_id |
string |
Optional. Persona ID for custom voice or style profiles. |
persona_type |
string |
Optional. style or voice. Selects the persona category. |
callback_url |
string |
Optional. Webhook URL that receives a POST when the task completes. |
OpenClaw 上的 Suno 是什么?
Suno 是一个文生音乐 AI,能从文本提示或歌词生成包含人声、乐器和混音的完整歌曲。OpenClaw agent 通过 RunAPI 调用它,因为 Suno 没有官方公开 API,通过 RunAPI 可以编程方式访问 v4 至 v5.5 版本。
Suno 使用场景
YouTube 与社交媒体背景音乐
通过描述情绪和曲风,为视频生成原创背景音乐。无授权费,无版权问题——曲目是为你的内容全新生成的。
将歌词变为完整歌曲
词作者可将歌词粘贴到 exact_lyrics 模式并加上风格描述,听到歌词被演唱为完整歌曲,在进录音棚前就能获得制作级小样。
播客片头与片尾
通过指定曲风、情绪和时长,创作与播客基调匹配的纯音乐片头和片尾。生成多个版本,挑选最合适的。
Suno + OpenClaw 常见问题
Be specific about genre, mood, tempo, and instrumentation in your prompt. For example, "upbeat 120 BPM indie pop with acoustic guitar and warm synths" works better than "happy song." Use negative_tags to exclude unwanted elements like "heavy metal" or "screaming." Meta tags in the prompt help Suno understand structure.
suno-v5.5 is the latest and produces the highest quality output with better vocal clarity and mixing. suno-v4 and suno-v4.5 are cheaper and faster for draft iterations. All versions use the same text_to_music endpoint and parameters.
Yes. Use the extend_music endpoint to continue a song from a specific timestamp. You can chain multiple extensions to build longer tracks. RunAPI also offers cover_audio to restyle existing tracks and create_mashup to combine elements from multiple songs.
Suno does not offer a public API. RunAPI provides programmatic access to Suno v4 through v5.5 through the same API key and task lifecycle used for all other RunAPI models. No Suno account or separate credentials needed.
Yes. Set vocal_gender to male or female. Use negative_tags to exclude unwanted styles. For finer control, create a persona through the generate_persona endpoint and pass the returned persona_id with persona_type set to voice or style.