音乐生成
Generate custom music tracks (vocal or instrumental) via OhYesAI asynchronously.
MIT-0 · Free to use, modify, and redistribute. No attribution required.
⭐ 0 · 31 · 0 current installs · 0 all-time installs
MIT-0
Security Scan
OpenClaw
Benign
high confidencePurpose & Capability
Name/description match the required environment variable (OHEYSAI_API_KEY) and required binaries (curl, grep, sleep). Nothing requested is unrelated to calling an external music-generation API and downloading results.
Instruction Scope
SKILL.md only instructs submitting an async job, polling status, extracting MP3 URLs from the response, downloading the file, and delivering it to the user. It does not ask for unrelated system files or extra credentials. (Note: it instructs saving and publishing local files, so callers should validate returned URLs and be prepared for file I/O.)
Install Mechanism
Instruction-only skill with no install steps or archive downloads—no code is written to disk by an installer, which minimizes install-time risk.
Credentials
Only a single service API key (OHEYSAI_API_KEY) is required — this is proportional to the described functionality. No other secrets or unrelated env vars are requested.
Persistence & Privilege
Skill is not forced-always, does not request persistent privileges, and does not modify other skills or system-wide configs in its instructions.
Assessment
This skill appears to do what it says: call OhYesAI, poll for completion, download MP3(s), and deliver them. Before installing: 1) Only provide an OHEYSAI_API_KEY you trust — prefer a scoped key or an account you can revoke. 2) Confirm you trust dev.ohyesai.com and any storage domains returned by the API before downloading files; validate that MP3 URLs are from expected domains to avoid unintended downloads. 3) Be aware the skill saves files to the agent's current working directory and instructs the agent to send local file links or push files — ensure the runtime environment is sandboxed and that you’re comfortable with file writes/attachments. 4) Check licensing/privacy for generated audio if you’ll publish or distribute it. Installing this skill is coherent with its purpose, but follow standard secrets hygiene and URL validation practices.Like a lobster shell, security has layers — review code before you run it.
Current versionv1.0.1
Download ziplatest
License
MIT-0
Free to use, modify, and redistribute. No attribution required.
Runtime requirements
🎵 Clawdis
Binscurl, grep, sleep
EnvOHEYSAI_API_KEY
SKILL.md
Music Skill
通过调用 OhYesAI API,直接在 Clawdbot 中生成自定义风格的歌曲(支持纯音乐或带人声)。 注意:音乐生成耗时较长,本技能采用“提交任务 -> 轮询查询状态 -> 下载文件”的异步工作流。
Setup
- 首次安装/使用时,请前往获取 API Key: https://dev.ohyesai.com
- 设置你的环境变量:
export OHEYSAI_API_KEY="your-api-key"
Usage
使用此技能生成音乐时,必须与用户进行多轮对话以收集必要参数。完成生成、下载后,必须将真实音频文件交付给用户。
参数说明
在调用 API 前,请确认以下参数:
prompt(必填):用户提示词/歌曲的画面与情感描述,需与用户沟通获取。styles(必填):歌曲风格(如“流行”、“动漫”、“摇滚”等),需与用户沟通获取。instrumental(必填):布尔值。true代表纯音乐(无歌词/无人声),false代表有歌词的音乐,需与用户沟通获取。title:歌曲标题。无需向用户询问,请根据其他参数自动推理生成一个合适的歌名。
1. 提交任务 (Submit Task)
收集完参数后,使用 curl 调用 submit 接口提交任务:
curl -s --location --request POST "https://dev.ohyesai.com/ohyesai-next/api/vio/skill/music-submit?apikey=$OHEYSAI_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"title": "晚安",
"prompt": "晚安风格的宁静歌曲",
"styles": "动漫",
"instrumental": true
}'
返回值:该接口会返回一个 taskId(任务ID),请务必将其提取并保存,用于后续查询。
2. 查询任务状态 (Query Status)
使用获取到的 taskId 通过 GET 请求不断轮询查询任务状态:
curl -s --location --request GET "https://dev.ohyesai.com/ohyesai-next/api/vio/skill/music-query?apikey=$OHEYSAI_API_KEY&taskId=你的taskId"
接口返回值有以下 3 种状态:
**音乐生成状态**: 进行中-> 任务还在排队或生成中,你需要 sleep 一段时间(如 10 秒)后继续重试。**音乐生成状态**: 已完成-> 任务完成,状态文本后会附加包含 MP3 音频链接的 Markdown 文本。**任务不存在**-> 任务生成失败或 ID 错误,应终止轮询并告知用户。
3. 下载与交付 (Download and Deliver)
当状态变为已完成时,返回值示例:
**音乐生成状态**: 已完成
[晚安_1](https://ohyesainext-test.tos-cn-beijing.volces.com/mv%2F202603%2F66d82e777e2544a89a6c3aedc9f60c93.mp3?...)
[晚安_2](https://ohyesainext-test.tos-cn-beijing.volces.com/mv%2F202603%2F66d82e777e2544a89a6c3ae706362o75.mp3?...)
必须严格执行以下交付操作:
- 从上述返回值中提取出
.mp3文件的 URL。 - 使用
curl -o "文件名.mp3" "音频URL"命令将音频文件下载到当前工作目录。 - ⚠️ 致命注意(推送文件): 下载完成后,绝对不能仅仅回复纯文本! 你必须输出可供用户点击的本地文件链接,例如
[点击下载 晚安_1.mp3](./晚安_1.mp3)或者调用系统内置的发文件工具将本地 MP3 推送给用户。
Examples
这里提供了一个标准的 Bash 自动化脚本,它整合了提交、轮询、提取、下载的全流程,你(大语言模型)可以直接修改参数并执行此脚本来完成整个任务:
# 1. 提交任务并获取 Task ID
TASK_ID=$(curl -s --location --request POST "https://dev.ohyesai.com/ohyesai-next/api/vio/skill/music-submit?apikey=$OHEYSAI_API_KEY" \
--header 'Content-Type: application/json' \
--data-raw '{
"title": "安眠曲",
"prompt": "安静助眠的轻音乐",
"styles": "动漫",
"instrumental": true
}')
# 简单清理可能存在的引号或换行符
TASK_ID=$(echo "$TASK_ID" | tr -d '"' | tr -d '\n' | tr -d '\r')
echo "Task Submitted! Task ID: $TASK_ID"
echo "开始轮询等待音乐生成..."
# 2. 轮询状态
while true; do
RESULT=$(curl -s --location --request GET "https://dev.ohyesai.com/ohyesai-next/api/vio/skill/music-query?apikey=$OHEYSAI_API_KEY&taskId=$TASK_ID")
if echo "$RESULT" | grep -q "已完成"; then
echo "音乐生成已完成!"
# 3. 提取 MP3 URL(正则提取 http...mp3... 括号内的内容)
MP3_URL=$(echo "$RESULT" | grep -o 'http[^)]*' | head -n 1)
if [ -n "$MP3_URL" ]; then
echo "正在下载音频..."
curl -s -o "安眠曲_1.mp3" "$MP3_URL"
echo "下载成功!文件已保存为 ./安眠曲_1.mp3"
else
echo "未能提取到有效的音频 URL"
fi
break
elif echo "$RESULT" | grep -q "任务不存在"; then
echo "查询失败:任务不存在或已失效。"
break
else
echo "生成中,等待 20 秒后重试..."
sleep 20
fi
done
完整工作流说明
- 询问用户获取
prompt,styles,instrumental。 - 自动生成
title,代入上述示例脚本并执行。 - 脚本执行完毕并显示“下载成功”后,向用户回复:"您的音乐已生成完毕,请点击此处收听/下载:安眠曲_1.mp3" (或者调用系统发文件的内置能力)。
Files
1 totalSelect a file
Select a file to preview.
Comments
Loading comments…
