← 返回 Skills 市场
scikkk

Music Generation

作者 scikkk · GitHub ↗ · v1.0.0 · MIT-0
cross-platform ✓ 安全检测通过
326
总下载
0
收藏
4
当前安装
1
版本数
在 OpenClaw 中安装
/install music-gen
功能描述
SenseAudio Music Generation API for creating AI-generated lyrics and songs. Supports lyrics generation, song generation with style/vocal control, and async t...
使用说明 (SKILL.md)

SenseAudio Music Generation

SenseAudio provides AI-powered music generation APIs for creating lyrics and full songs. The workflow is:

  1. Generate lyrics (sync or async)
  2. Generate a song using the lyrics (async, returns task_id)
  3. Poll for results

Base URL: https://api.senseaudio.cn Auth: Authorization: Bearer $SENSEAUDIO_API_KEY


1. Generate Lyrics

POST /v1/song/lyrics/create

Parameter Type Required Description
prompt string yes Description of the lyrics to generate
provider string yes Model provider, currently only sensesong

Response (sync):

{
  "data": [
    {
      "text": "[intro-medium] ; [verse] ... ; [chorus] ... ; [outro-medium]",
      "title": ""
    }
  ]
}

Response (async): Returns task_id — poll with lyrics pending endpoint.

curl -X POST https://api.senseaudio.cn/v1/song/lyrics/create \
  -H "Authorization: Bearer $SENSEAUDIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "一段慷慨激昂的歌词", "provider": "sensesong"}'

2. Poll Lyrics (Async)

GET /v1/song/lyrics/pending/:task_id

Response:

{
  "task_id": "bcee6b21-...",
  "status": "SUCCESS",
  "response": {
    "task_id": "bcee6b21-...",
    "data": [{"text": "...", "title": ""}]
  }
}

Status values: PENDING | SUCCESS | FAILED

curl https://api.senseaudio.cn/v1/song/lyrics/pending/{task_id} \
  -H "Authorization: Bearer $SENSEAUDIO_API_KEY"

3. Generate Song

POST /v1/song/music/create

Parameter Type Required Description
model string yes Currently only sensesong
lyrics string no Song lyrics (use format from lyrics API)
instrumental bool no true for instrumental (no vocals)
style string no Music style (e.g. "pop", "rock", "jazz")
style_weight string no Style weight 0–1
title string no Song title
vocal_gender string no f = female, m = male
negative_tags string no Style elements to exclude

Response:

{"task_id": "50f979f5-2b9e-4254-8653-c277644a31fa"}
curl -X POST https://api.senseaudio.cn/v1/song/music/create \
  -H "Authorization: Bearer $SENSEAUDIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "sensesong",
    "lyrics": "[verse] Your lyrics here...",
    "style": "pop",
    "vocal_gender": "f",
    "title": "My Song"
  }'

4. Poll Song (Async)

GET /v1/song/music/pending/:task_id

Response:

{
  "task_id": "50f979f5-...",
  "status": "SUCCESS",
  "response": {
    "task_id": "50f979f5-...",
    "data": [
      {
        "audio_url": "https://...",
        "lyrics": "...",
        "duration": 110
      }
    ]
  }
}

Status values: PENDING | SUCCESS | FAILED

curl https://api.senseaudio.cn/v1/song/music/pending/{task_id} \
  -H "Authorization: Bearer $SENSEAUDIO_API_KEY"

Python Example (Full Flow)

import requests
import time

API_KEY = "YOUR_API_KEY"
HEADERS = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}
BASE = "https://api.senseaudio.cn"

# Step 1: Generate lyrics
resp = requests.post(f"{BASE}/v1/song/lyrics/create",
    headers=HEADERS,
    json={"prompt": "一首关于夏天的流行歌曲", "provider": "sensesong"})
lyrics_data = resp.json()
lyrics_text = lyrics_data["data"][0]["text"]

# Step 2: Generate song
resp = requests.post(f"{BASE}/v1/song/music/create",
    headers=HEADERS,
    json={"model": "sensesong", "lyrics": lyrics_text, "style": "pop", "vocal_gender": "f"})
task_id = resp.json()["task_id"]

# Step 3: Poll for result
while True:
    resp = requests.get(f"{BASE}/v1/song/music/pending/{task_id}", headers=HEADERS)
    result = resp.json()
    if result["status"] == "SUCCESS":
        print("Audio URL:", result["response"]["data"][0]["audio_url"])
        break
    elif result["status"] == "FAILED":
        print("Failed")
        break
    time.sleep(5)


SenseAudio 音乐生成

SenseAudio 提供 AI 驱动的音乐生成 API,支持歌词生成和完整歌曲生成。标准工作流程:

  1. 生成歌词(同步或异步)
  2. 使用歌词生成歌曲(异步,返回 task_id
  3. 轮询获取结果

基础 URL: https://api.senseaudio.cn 鉴权: Authorization: Bearer $SENSEAUDIO_API_KEY


1. 音乐歌词生成请求

POST /v1/song/lyrics/create

  • 原始链接:https://senseaudio.cn/docs/song/lyrics_create
参数名 类型 必填 描述
prompt string 歌词生成提示词
provider string 模型,目前只支持 sensesong

同步响应示例:

{
  "data": [
    {
      "text": "[intro-medium] ; [verse] We stand upon the edge of dawn... ; [chorus] Rise up now...",
      "title": ""
    }
  ]
}

异步响应: 返回 task_id,需通过歌词轮询接口获取结果。


2. 音乐歌词轮询

GET /v1/song/lyrics/pending/:task_id

  • 原始链接:https://senseaudio.cn/docs/song/lyrics_pending

使用创建歌词任务得到的异步任务 ID 获取歌词数据。

响应示例:

{
  "task_id": "bcee6b21-dcf9-44d1-9b85-7bfef0e840db",
  "status": "SUCCESS",
  "response": {
    "task_id": "bcee6b21-dcf9-44d1-9b85-7bfef0e840db",
    "data": [{"text": "...", "title": ""}]
  }
}

任务状态:PENDING(处理中)| SUCCESS(成功)| FAILED(失败)


3. 音乐歌曲生成请求

POST /v1/song/music/create

  • 原始链接:https://senseaudio.cn/docs/song/music_create
参数名 类型 必填 描述
model string 模型,目前只能使用 sensesong
lyrics string 歌词内容
instrumental bool 是否为纯音乐(无人声)
style string 歌曲风格(如 "pop"、"rock")
style_weight string 风格权重,取值 0–1
title string 歌曲标题
vocal_gender string 人声性别:f 女性,m 男性
negative_tags string 排除的风格元素

响应示例:

{"task_id": "50f979f5-2b9e-4254-8653-c277644a31fa"}

4. 音乐歌曲轮询

GET /v1/song/music/pending/:task_id

  • 原始链接:https://senseaudio.cn/docs/song/music_pending

使用创建歌曲任务得到的异步任务 ID 获取歌曲数据。

响应示例:

{
  "task_id": "50f979f5-...",
  "status": "SUCCESS",
  "response": {
    "task_id": "50f979f5-...",
    "data": [
      {
        "audio_url": "https://...",
        "lyrics": "...",
        "duration": 110
      }
    ]
  }
}

任务状态:PENDING(处理中)| SUCCESS(成功)| FAILED(失败)


完整调用示例(Python)

import requests
import time

API_KEY = "YOUR_API_KEY"
HEADERS = {"Authorization": f"Bearer {API_KEY}", "Content-Type": "application/json"}
BASE = "https://api.senseaudio.cn"

# 第一步:生成歌词
resp = requests.post(f"{BASE}/v1/song/lyrics/create",
    headers=HEADERS,
    json={"prompt": "一首关于夏天的流行歌曲", "provider": "sensesong"})
lyrics_text = resp.json()["data"][0]["text"]

# 第二步:生成歌曲
resp = requests.post(f"{BASE}/v1/song/music/create",
    headers=HEADERS,
    json={"model": "sensesong", "lyrics": lyrics_text, "style": "pop", "vocal_gender": "f"})
task_id = resp.json()["task_id"]

# 第三步:轮询结果
while True:
    resp = requests.get(f"{BASE}/v1/song/music/pending/{task_id}", headers=HEADERS)
    result = resp.json()
    if result["status"] == "SUCCESS":
        print("音频地址:", result["response"]["data"][0]["audio_url"])
        break
    elif result["status"] == "FAILED":
        print("生成失败")
        break
    time.sleep(5)
安全使用建议
This skill simply documents how to call SenseAudio's API and needs your SenseAudio API key. Before installing: (1) confirm you trust https://senseaudio.cn and are comfortable sending prompts/content there (audio and lyrics will be transmitted to their servers); (2) use a key with minimal privileges and monitor/rotate it if possible; (3) review SenseAudio's terms/privacy to understand data retention and copyright implications for generated audio; and (4) avoid reusing high-value credentials (do not put other service keys into SENSEAUDIO_API_KEY). The skill is instruction-only (no code install), which reduces installation risk, but the agent will make network calls to the provider when invoked.
功能分析
Type: OpenClaw Skill Name: music-gen Version: 1.0.0 The skill bundle provides documentation and examples for integrating with the SenseAudio Music Generation API (api.senseaudio.cn). It requires a standard API key (SENSEAUDIO_API_KEY) and contains no evidence of malicious intent, data exfiltration, or unauthorized execution in SKILL.md or the provided Python examples.
能力评估
Purpose & Capability
Name/description match the runtime instructions: the SKILL.md documents SenseAudio endpoints for lyrics and song generation and the only required secret is SENSEAUDIO_API_KEY, which is appropriate for a third-party API integration.
Instruction Scope
Instructions are scoped to calling SenseAudio REST endpoints, polling async tasks, and example code (curl/Python). They do not instruct reading local files, other environment variables, or transmitting data to unrelated endpoints.
Install Mechanism
No install spec and no code files (instruction-only), so nothing is written to disk or fetched during install — lowest-risk install footprint.
Credentials
Only one credential is required (SENSEAUDIO_API_KEY) and it is the primary credential used by the documented API calls. There are no unrelated or excessive environment variables declared.
Persistence & Privilege
Skill does not request always: true and uses default model invocation behavior. It does not request modifying other skills or system configuration.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install music-gen
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /music-gen 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Major update: Music skill now provides SenseAudio's AI music and lyrics generation API. - Supports generating AI-powered song lyrics (sync and async). - Enables full song creation with style and vocal controls. - Uses async task polling for both lyrics and music generation. - Includes detailed REST API documentation and Python sample code. - Requires SENSEAUDIO_API_KEY for authentication.
元数据
Slug music-gen
版本 1.0.0
许可证 MIT-0
累计安装 4
当前安装数 4
历史版本数 1
常见问题

Music Generation 是什么?

SenseAudio Music Generation API for creating AI-generated lyrics and songs. Supports lyrics generation, song generation with style/vocal control, and async t... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 326 次。

如何安装 Music Generation?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install music-gen」即可一键安装,无需额外配置。

Music Generation 是免费的吗?

是的,Music Generation 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Music Generation 支持哪些平台?

Music Generation 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Music Generation?

由 scikkk(@scikkk)开发并维护,当前版本 v1.0.0。

💬 留言讨论