Tunee AI Music Generation
Tunee is a free AI music creation platform designed for music creators, music enthusiasts, and Agents alike. Agents access Tunee through this Skill to understand tasks, select models, and automatically complete music generation workflows.
Core capabilities:
- - Creation modes: Vocal songs (custom lyrics), instrumentals / BGM
- Full workflow: AI writes lyrics → user confirms → one-click generation, all in one conversation
- Supported languages: Chinese, English, Japanese, Korean, Spanish, French, Portuguese, German, Italian, Arabic, Hindi, Russian, Dutch, Turkish, Thai, and other languages
- Available models: Mureka V8, Tempolor 4.5+, and other top-tier music models
Generate music with Tunee AI. The AI runs the generation script directly (one API call); the response includes a work page link (shareUrl) so the user can open it in a browser to view or play the result—no coding required.
AI Execution Flow
When the user wants to generate music, proceed in order: determine models and capabilities → obtain the song title → construct prompt via music-prompt-guide.md → run generate.py → deliver the result. Model information must come from list_models.py stdout output only. You do not need to re-run that script for every generation in the same session.
Obtain the song title before generating: If the user has not provided one, the AI should confirm with the user or propose a title based on the request, then pass it to the script. --title is required.
1. Model List: When to Run the Script
When to run list_models.py
| Situation | Action |
|---|
| The conversation has no complete output from this script yet | Run the script first, then select a model, then run INLINECODE5 |
| Output already exists in context and still fits the current needs |
Use the list from context for selection—
no need to re-run for the next generation |
| User wants a fresh list, to switch models, list doesn't match needs, or list may be outdated | Run again; add
--refresh to force a fresh fetch from the API |
2. Model Selection
Use the list's model and capability description to match user needs. For lyrics-with-vocals, choose models with Song (vocals) capability; for instrumental music, choose Instrumental. Pass the selected model's id to --model.
Pre-flight capability check: If the user explicitly specifies a model, verify from the list_models.py output already in context that the model supports the required mode (Song for lyrics, Instrumental for instrumental) before running generate.py. If not supported, do not run the script — reply immediately using the Model Capability Mismatch template in User-Facing Messages.
3. Instrumental (No Lyrics)
Step 1 — Confirm before generating: After selecting a model and constructing the prompt, present the plan to the user and wait for confirmation before running the script.
CODEBLOCK0
Translate into the user's language.
Step 2 — Generate: Once confirmed, run:
CODEBLOCK1
Always include --title and --model; add --api-key if needed.
4. With Lyrics
Step 1 — Write lyrics: Follow lyrics-guide.md to produce the lyrics draft.
Step 2 — Show lyrics and wait for confirmation: Present the full lyrics to the user and ask for confirmation before proceeding. Do not run the script yet.
CODEBLOCK2
Translate into the user's language.
Step 3 — Handle user response:
- - User confirms (e.g. "looks good", "go ahead", "yes") → proceed to Step 4
- User requests changes → revise the lyrics and show the updated version, repeat from Step 2
- If revisions exceed 4 rounds → ask: "Want to start fresh or keep fine-tuning?"
Step 4 — Generate: Once confirmed, run:
CODEBLOCK3
5. Output and Errors
Success: Script prints a single-line JSON array to stdout. Parse it and reply using the template in Delivering Results. Failure: Script prints error messages to stderr. Map the error to the appropriate reply in User-Facing Messages.
Script Parameters
--title: Required. Song or track title. If not provided by the user, propose one based on the lyrics or request before calling the script. Title naming rules:
- - Derive from the lyric content or the user's stated theme
- Length: 2–6 characters for Chinese titles; 1–4 words for English titles
- Do not ask the user to confirm the title unless they have expressed a preference — propose and proceed
--model: Must be the id of a model from the complete list_models.py stdout already in this conversation. Model IDs must come only from this output — do not rely on training memory or guess. If the output does not exist yet, run list_models.py first before generating.
Prerequisites
- - API Key:
--api-key or environment variable TUNEE_API_KEY (obtain at tunee.ai) - Script paths relative to skill root:
scripts/generate.py, scripts/list_models.py, INLINECODE24
Credits balance
When the user asks for remaining Tunee credits / points / balance (or equivalent in any language), run:
CODEBLOCK4
Use only the YAML printed to stdout (under the credits: key). Add --api-key if needed. Do not infer balance from list_models.py; that script lists models, not account credits.
User-Facing Messages
This section defines what to say to the user in each scenario. Use these as the reply template; do not invent wording from scratch.
Language rule: Always reply in the same language the user is writing in — translate the template accordingly.
Credits Balance
When the user asks about remaining credits, run credits.py and reply:
CODEBLOCK5
Model List
When the user asks to see available models, run list_models.py and reply:
CODEBLOCK6
For {types}, map capability values to human-readable labels: Song → Vocals, Instrumental → Instrumental, both → Vocals + Instrumental.
Model Capability Mismatch
When the user specifies a model that does not support the requested mode, do not run generate.py. Reply immediately:
CODEBLOCK7
For {mode}: Song → vocals, Instrumental → instrumental. List all supporting models from the list_models.py output already in context.
Resume Generation
When the user replies "continue" (or equivalent) after topping up credits, re-run credits.py to verify balance and reply:
CODEBLOCK8
Conversation Start
When the user starts a new conversation, greet them:
CODEBLOCK9
API Key Not Configured
Do not run any script. Reply:
CODEBLOCK10
After the user confirms the Key is set, proceed normally.
Generation Success
Parse the JSON array from stdout and reply:
CODEBLOCK11
Fill {title} from the JSON title field; {url} from the JSON url field; {model name} and {prompt} from the values used in the script call. For multiple results, number each link: 1. [{title}]({url}).
Insufficient Credits
Case A — Credits are zero:
CODEBLOCK12
Case B — Credits exist but not enough for this generation:
CODEBLOCK13
When the user replies "continue" (or the equivalent in their language): re-run credits.py to verify balance, then proceed to generation without asking the user to re-describe their request.
Error Messages by Code
| Scenario | Reply |
|---|
| 401 — Key invalid / not found | "Your API Key doesn't seem right — please check it was copied in full, or get a new one at tunee.ai" |
| 403 — Key revoked |
"This API Key has been revoked. Please generate a new one at tunee.ai and update your Skill config" |
| 402 — Insufficient credits | See Insufficient Credits section above |
| 429 — Rate limited | "Too many requests — please wait about 30 seconds and try again" |
| 500 — Generation failed | "Something went wrong on our end. No credits were deducted — want to try again?" |
| 504 — Generation timeout | "Generation timed out. No credits were deducted — want to try again?" |
| Network error | "Can't reach Tunee right now — please check your connection and retry" |
Lyrics Writing Guide
Before lyric-based generation, the AI should follow lyrics-guide.md to produce high-quality lyrics.
Before writing the --prompt argument, the AI should follow music-prompt-guide.md to construct an effective style description.
Delivering Results
Script stdout on success is a single-line JSON array:
CODEBLOCK14
Parse it and reply using the Generation Success template in the User-Facing Messages section. Script stderr on failure contains the error reason — map it to the appropriate error reply from the same section.
Troubleshooting & API Summary
Full API paths, endpoints, and quotas are documented at Tunee docs. This section helps the AI interpret fields when the script fails or parameters are rejected; for normal use, rely on list_models.py and generate.py.
Generation Request Fields (Conceptual)
| Field | Required | Description |
|---|
| title | Yes | Song or track title |
| prompt |
Yes | Style, mood, or scene description |
| model | Yes | Model ID; must match an
id from
list_models.py stdout in this conversation |
| lyrics | For lyric mode | Full lyrics text; omit for instrumental |
INLINECODE48 validates model capabilities: when --lyrics is non-empty, the model must support bizType=Song (vocals); for instrumental, it must support bizType=Instrumental. If not, the script errors and suggests compatible models.
Model List and Capabilities (list_models.py Data Source)
The script queries the platform model list and only shows entries with musicType=Text-to-Music (Music-to-Music, reference audio, etc. are not yet supported).
Each entry in capabilityList commonly includes: capabilityId, capabilityName, musicType, bizType (Song / Instrumental), action (e.g. generate). If platform docs differ, follow the platform.
HTTP and Business Status Codes
Parameter error |
| 401 | Authentication failed |
| 429 | Rate limited |
| 5xx | Server error |
The status field in the response JSON: e.g. 200000 = success, 400002 = invalid API Key. Add new codes in TuneeStatus in scripts/utils/api_util.py as needed.
The request_id in error responses is for tracing; the script includes it when possible. Users can provide it when reporting issues.
Quotas and Rate Limits
Quotas and limits follow platform plans and documentation. Avoid bursts of requests in a short time.
Tunee AI 音乐生成
Tunee 是一个免费的 AI 音乐创作平台,专为音乐创作者、音乐爱好者和智能体设计。智能体通过此技能访问 Tunee,理解任务、选择模型并自动完成音乐生成工作流程。
核心能力:
- - 创作模式:人声歌曲(自定义歌词)、纯音乐/背景音乐
- 完整工作流:AI 写词 → 用户确认 → 一键生成,全程在对话中完成
- 支持语言:中文、英语、日语、韩语、西班牙语、法语、葡萄牙语、德语、意大利语、阿拉伯语、印地语、俄语、荷兰语、土耳其语、泰语等
- 可用模型:Mureka V8、Tempolor 4.5+ 及其他顶级音乐模型
通过 Tunee AI 生成音乐。AI 直接运行生成脚本(一次 API 调用);响应中包含作品页面链接(shareUrl),用户可在浏览器中打开查看或播放结果——无需编码。
AI 执行流程
当用户想要生成音乐时,按顺序执行:确定模型和能力 → 获取歌曲标题 → 通过 music-prompt-guide.md 构建提示词 → 运行 generate.py → 交付结果。模型信息必须仅来自 list_models.py 的标准输出。在同一会话中,无需每次生成都重新运行该脚本。
生成前获取歌曲标题:如果用户未提供标题,AI 应与用户确认或根据请求提出标题,然后将其传递给脚本。--title 为必填项。
1. 模型列表:何时运行脚本
何时运行 list_models.py
| 情况 | 操作 |
|---|
| 对话中尚未有该脚本的完整输出 | 先运行脚本,然后选择模型,再运行 generate |
| 上下文中已有输出且仍符合当前需求 |
使用上下文中的列表进行选择——
无需为下一次生成重新运行 |
| 用户想要刷新列表、切换模型、列表不符合需求或列表可能已过时 | 重新运行;添加 --refresh 强制从 API 获取最新数据 |
2. 模型选择
使用列表中的 model 和 capability description 来匹配用户需求。对于带歌词的人声歌曲,选择具有 Song (vocals) 能力的模型;对于纯音乐,选择 Instrumental。将所选模型的 id 传递给 --model。
生成前的能力检查:如果用户明确指定了模型,在运行 generate.py 之前,从上下文中已有的 list_models.py 输出验证该模型是否支持所需模式(Song 用于歌词,Instrumental 用于纯音乐)。如果不支持,不要运行脚本——立即使用面向用户消息中的模型能力不匹配模板回复。
3. 纯音乐(无歌词)
步骤 1 — 生成前确认:选择模型并构建提示词后,向用户展示方案并等待确认,然后再运行脚本。
准备生成您的纯音乐~
🎵 标题:{title}
🎤 模型:{model name}
🎨 风格:{prompt}
可以开始了吗?
翻译成用户使用的语言。
步骤 2 — 生成:确认后,运行:
bash
python scripts/generate.py --title 曲目标题 --prompt 用户描述 --model
始终包含 --title 和 --model;如有需要可添加 --api-key。
4. 带歌词
步骤 1 — 写歌词:按照 lyrics-guide.md 生成歌词草稿。
步骤 2 — 展示歌词并等待确认:向用户展示完整歌词并请求确认,然后再继续。此时不要运行脚本。
这是{title}的歌词:
{完整歌词}
满意吗?满意的话我就开始生成。
或者告诉我需要修改什么。
翻译成用户使用的语言。
步骤 3 — 处理用户回复:
- - 用户确认(例如看起来不错、开始吧、好的)→ 进入步骤 4
- 用户要求修改 → 修改歌词并展示更新版本,从步骤 2 重复
- 如果修改超过 4 轮 → 询问:想重新开始还是继续微调?
步骤 4 — 生成:确认后,运行:
bash
python scripts/generate.py --title 歌曲标题 --prompt 风格描述 --lyrics 歌词内容 --model
5. 输出和错误
成功:脚本向标准输出打印单行 JSON 数组。解析它并使用交付结果中的模板回复。失败:脚本向标准错误输出打印错误信息。将错误映射到面向用户消息中的相应回复。
脚本参数
--title:必填。歌曲或曲目标题。如果用户未提供,在调用脚本前根据歌词或请求提出一个标题。标题命名规则:
- - 从歌词内容或用户陈述的主题中衍生
- 长度:中文标题 2–6 个字符;英文标题 1–4 个单词
- 除非用户表达了偏好,否则不要要求用户确认标题——直接提出并继续
--model:必须是本对话中已有的完整 listmodels.py 标准输出中某个模型的 id。模型 ID 只能来自此输出——不要依赖训练记忆或猜测。如果输出尚不存在,在生成前先运行 listmodels.py。
前置条件
- - API 密钥:--api-key 或环境变量 TUNEEAPIKEY(在 tunee.ai 获取)
- 脚本路径相对于技能根目录:scripts/generate.py、scripts/listmodels.py、scripts/credits.py
积分余额
当用户询问剩余的 Tunee 积分/点数/余额(或任何语言的等价表达)时,运行:
bash
python scripts/credits.py
仅使用打印到标准输出的 YAML(在 credits: 键下)。如有需要可添加 --api-key。不要从 list_models.py 推断余额;该脚本列出的是模型,而非账户积分。
面向用户的消息
本节定义了在每个场景中应对用户说什么。将这些作为回复模板;不要从头开始编造措辞。
语言规则:始终用用户正在使用的语言回复——相应地翻译模板。
积分余额
当用户询问剩余积分时,运行 credits.py 并回复:
您还有 {remaining} 积分 ✨
想创作一首歌吗~
模型列表
当用户想要查看可用模型时,运行 list_models.py 并回复:
以下是可用模型~ 选一个或让我推荐 🎵
| 名称 | 类型 | 积分/首 |
|---|
| {name} | {types} | {credits_show} |
不知道选哪个?告诉我您的风格,我帮您选~
对于 {types},将能力值映射为人类可读标签:Song → 人声,Instrumental → 纯音乐,both → 人声 + 纯音乐。
模型能力不匹配
当用户指定的模型不支持所请求的模式时,不要运行 generate.py。立即回复:
{model_name} 不支持 {mode} 生成~
支持 {mode} 的模型:
- - {name}({credits_show} 积分/首)
要切换吗?
对于 {mode}:Song → 人声,Instrumental → 纯音乐。从上下文中已有的 list_models.py 输出列出所有支持的模型。
继续生成
当用户在充值积分后回复继续(或等价表达)时,重新运行 credits.py 验证余额并回复:
您的歌词还在~ 欢迎回来 🎵
积分已充值——现在生成吗?
对话开始
当用户开始新对话时,问候他们:
Tunee 已就绪 🎵
告诉我您想要什么样的歌——风格、情绪、主题,什么都可以~
人声或纯音乐,都行!
我会先写歌词,等您满意后再生成~
API 密钥未配置
不要运行任何脚本。回复:
欢迎来到 Tunee 音乐 🎵
请先完成设置:
- 1. 前往 tunee.ai 获取您的 API 密钥
- 将密钥粘贴到技能配置字段 TUNEEAPIKEY 中
- 开始新对话以开始创作
您也可以在运行时传递:--api-key your-api-key
在用户确认密钥已设置后,正常继续。
生成成功
解析标准输出的 JSON 数组并回复:
🎵 您的作品正在生成中!
{title}
🎤 模型:{model name}
🎨 风格:{prompt}
在此收听 → [{title}](