ACE-Step Music Generation Skill
Use ACE-Step V1.5 API for music generation. Always use scripts/acestep.sh script — do NOT call API endpoints directly.
Quick Start
CODEBLOCK0
Workflow
For user requests requiring vocals:
- 1. Use the acestep-songwriting skill for lyrics writing, caption creation, duration/BPM/key selection
- Write complete, well-structured lyrics yourself based on the songwriting guide
- Generate using Caption mode with
-c and -l parameters
Only use Simple/Random mode (-d or random) for quick inspiration or instrumental exploration.
If the user needs a simple music video, use the acestep-simplemv skill to render one with waveform visualization and synced lyrics.
MV Production Requirements: Making a simple MV requires three additional skills to be installed:
- - acestep-songwriting — for writing lyrics and planning song structure
- acestep-lyrics-transcription — for transcribing audio to timestamped lyrics (LRC)
- acestep-simplemv — for rendering the final music video
Script Commands
CRITICAL - Complete Lyrics Input: When providing lyrics via the -l parameter, you MUST pass ALL lyrics content WITHOUT any omission:
- - If user provides lyrics, pass the ENTIRE text they give you
- If you generate lyrics yourself, pass the COMPLETE lyrics you created
- NEVER truncate, shorten, or pass only partial lyrics
- Missing lyrics will result in incomplete or incoherent songs
Music Parameters: Use the acestep-songwriting skill for guidance on duration, BPM, key scale, and time signature.
CODEBLOCK1
Output Files
After generation, the script automatically saves results to the acestep_output folder in the project root (same level as .claude):
CODEBLOCK2
JSON Result Structure
Important: When LM enhancement is enabled (use_format=true), the final synthesized content may differ from your input. Check the JSON file for actual values:
| Field | Description |
|---|
| INLINECODE9 | Actual caption used for synthesis (may be LM-enhanced) |
| INLINECODE10 |
Actual lyrics used for synthesis (may be LM-enhanced) |
|
metas.prompt | Original input caption |
|
metas.lyrics | Original input lyrics |
|
metas.bpm | BPM used |
|
metas.keyscale | Key scale used |
|
metas.duration | Duration in seconds |
|
generation_info | Detailed timing and model info |
|
seed_value | Seeds used (for reproducibility) |
|
lm_model | LM model name |
|
dit_model | DiT model name |
To get the actual synthesized lyrics, parse the JSON and read the top-level lyrics field, not metas.lyrics.
Configuration
Important: Configuration follows this priority (high to low):
- 1. Command line arguments > config.json defaults
- User-specified parameters temporarily override defaults but do not modify config.json
- Only
config --set command permanently modifies config.json
Default Config File (scripts/config.json)
CODEBLOCK3
| Option | Default | Description |
|---|
| INLINECODE24 | INLINECODE25 | API server address |
| INLINECODE26 |
"" | API authentication key (optional) |
|
api_mode |
completion | API mode:
completion (OpenRouter, default) or
native (polling) |
|
generation.thinking |
true | Enable 5Hz LM (higher quality, slower) |
|
generation.audio_format |
mp3 | Output format (mp3/wav/flac) |
|
generation.vocal_language |
en | Vocal language |
Prerequisites - ACE-Step API Service
IMPORTANT: This skill requires the ACE-Step API server to be running.
Required Dependencies
The scripts/acestep.sh script requires: curl and jq.
CODEBLOCK4
If jq is not installed, the script will attempt to install it automatically. If automatic installation fails:
- - Windows:
choco install jq or download from https://jqlang.github.io/jq/download/ - macOS: INLINECODE40
- Linux:
sudo apt-get install jq (Debian/Ubuntu) or sudo dnf install jq (Fedora)
Before First Use
You MUST check the API key and URL status before proceeding. Run:
CODEBLOCK5
Case 1: Using Official Cloud API (https://api.acemusic.ai) without API key
If api_url is https://api.acemusic.ai and api_key is empty, you MUST stop and guide the user to configure their key:
- 1. Tell the user: "You're using the ACE-Step official cloud API, but no API key is configured. An API key is required to use this service."
- Explain how to get a key: API keys are currently available through acemusic.ai for free.
- Use
AskUserQuestion to ask the user to provide their API key. - Once provided, configure it:
cd "{project_root}/{.claude or .codex}/skills/acestep/" && bash ./scripts/acestep.sh config --set api_key <KEY>
- 5. Additionally, inform the user: "If you also want to render music videos (MV), it's recommended to configure a lyrics transcription API key as well (OpenAI Whisper or ElevenLabs Scribe), so that lyrics can be automatically transcribed with accurate timestamps. You can configure it later via the
acestep-lyrics-transcription skill."
Case 2: API key is configured
Verify the API endpoint: ./scripts/acestep.sh health and proceed with music generation.
Case 3: Using local/custom API without key
Local services (http://127.0.0.1:*) typically don't require a key. Verify with ./scripts/acestep.sh health and proceed.
If health check fails:
- - Ask: "Do you have ACE-Step installed?"
- If installed but not running: Use the acestep-docs skill to help them start the service
- If not installed: Use acestep-docs skill to guide through installation
Service Configuration
Official Cloud API: ACE-Step provides an official API endpoint at https://api.acemusic.ai. To use it:
./scripts/acestep.sh config --set api_url "https://api.acemusic.ai"
./scripts/acestep.sh config --set api_key "your-key"
./scripts/acestep.sh config --set api_mode completion
API keys are currently available through
acemusic.ai for free.
Local Service (Default): No configuration needed — connects to http://127.0.0.1:8001.
Custom Remote Service: Update scripts/config.json or use:
CODEBLOCK8
API Key Handling: When checking whether an API key is configured, use config --check-key which only reports configured or empty without printing the actual key. NEVER use config --get api_key or read config.json directly — these would expose the user's API key. The config --list command is safe — it automatically masks API keys as *** in output.
API Mode
The skill supports two API modes. Switch via api_mode in scripts/config.json:
| Mode | Endpoint | Description |
|---|
| INLINECODE65 (default) | INLINECODE66 | OpenRouter-compatible, sync request, audio returned as base64 |
| INLINECODE67 |
/release_task +
/query_result | Async polling mode, supports all parameters |
Switch mode:
CODEBLOCK9
Completion mode notes:
- - No polling needed — single request returns result directly
- Audio is base64-encoded inline in the response (auto-decoded and saved)
- INLINECODE70 ,
infer_method, shift are not configurable (server defaults) - INLINECODE73 and
status commands are not applicable in completion mode - Requires
model field — auto-detected from /v1/models if not specified
Using acestep-docs Skill for Setup Help
IMPORTANT: For installation and startup, always use the acestep-docs skill to get complete and accurate guidance.
DO NOT provide simplified startup commands - each user's environment may be different. Always guide them to use acestep-docs for proper setup.
For API debugging, see
API Reference.
ACE-Step 音乐生成技能
使用 ACE-Step V1.5 API 进行音乐生成。始终使用 scripts/acestep.sh 脚本 — 不要直接调用 API 端点。
快速开始
bash
1. 切换到该技能目录
cd {项目根目录}/{.claude 或 .codex}/skills/acestep/
2. 检查 API 服务健康状态
./scripts/acestep.sh health
3. 带歌词生成(推荐)
./scripts/acestep.sh generate -c 流行、女声、钢琴 -l [主歌] 你的歌词在此... --duration 120 --language zh
4. 输出保存至:{项目根目录}/acestep_output/
工作流程
对于需要人声的用户请求:
- 1. 使用 acestep-songwriting 技能进行歌词创作、描述生成、时长/BPM/调性选择
- 根据创作指南自行编写完整、结构良好的歌词
- 使用带 -c 和 -l 参数的描述模式生成
仅在快速灵感或器乐探索时使用简单/随机模式(-d 或 random)。
如果用户需要简单的音乐视频,使用 acestep-simplemv 技能渲染带有波形可视化和同步歌词的视频。
MV 制作要求:制作简单 MV 需要额外安装三个技能:
- - acestep-songwriting — 用于编写歌词和规划歌曲结构
- acestep-lyrics-transcription — 用于将音频转录为带时间戳的歌词(LRC)
- acestep-simplemv — 用于渲染最终音乐视频
脚本命令
关键 - 完整歌词输入:通过 -l 参数提供歌词时,必须传递所有歌词内容,不得有任何遗漏:
- - 如果用户提供歌词,传递他们给你的全部文本
- 如果你自己生成歌词,传递你创作的完整歌词
- 切勿截断、缩短或只传递部分歌词
- 缺少歌词将导致歌曲不完整或不连贯
音乐参数:使用 acestep-songwriting 技能获取关于时长、BPM、调性和拍号的指导。
bash
需要先切换到该技能目录
cd {项目根目录}/{.claude 或 .codex}/skills/acestep/
描述模式 - 推荐:先写歌词,再生成
./scripts/acestep.sh generate -c 电子流行、充满活力的合成器 -l [主歌] 你的完整歌词
[副歌] 完整副歌在此... --duration 120 --bpm 128
仅器乐
./scripts/acestep.sh generate 带萨克斯的爵士乐
快速探索(简单/随机模式)
./scripts/acestep.sh generate -d 一首关于春天的欢快歌曲
./scripts/acestep.sh random
选项
./scripts/acestep.sh generate 摇滚 --duration 60 --batch 2
./scripts/acestep.sh generate EDM --no-thinking # 更快
其他命令
./scripts/acestep.sh status <任务ID>
./scripts/acestep.sh health
./scripts/acestep.sh models
输出文件
生成后,脚本自动将结果保存到项目根目录下的 acestep_output 文件夹(与 .claude 同级):
项目根目录/
├── .claude/
│ └── skills/acestep/...
├── acestep_output/ # 输出目录
│ ├── <任务ID>.json # 完整任务结果(JSON)
│ ├── <任务ID>_1.mp3 # 第一个音频文件
│ ├── <任务ID>2.mp3 # 第二个音频文件(如果 batchsize > 1)
│ └── ...
└── ...
JSON 结果结构
重要:当启用 LM 增强时(use_format=true),最终合成内容可能与你的输入不同。检查 JSON 文件以获取实际值:
| 字段 | 描述 |
|---|
| prompt | 用于合成的实际描述(可能经过 LM 增强) |
| lyrics |
用于合成的
实际歌词(可能经过 LM 增强) |
| metas.prompt | 原始输入描述 |
| metas.lyrics | 原始输入歌词 |
| metas.bpm | 使用的 BPM |
| metas.keyscale | 使用的调性 |
| metas.duration | 时长(秒) |
| generation_info | 详细时间和模型信息 |
| seed_value | 使用的种子(用于可复现性) |
| lm_model | LM 模型名称 |
| dit_model | DiT 模型名称 |
要获取实际合成的歌词,解析 JSON 并读取顶层 lyrics 字段,而不是 metas.lyrics。
配置
重要:配置按以下优先级(从高到低):
- 1. 命令行参数 > config.json 默认值
- 用户指定的参数临时覆盖默认值,但不修改 config.json
- 只有 config --set 命令永久修改 config.json
默认配置文件(scripts/config.json)
json
{
api_url: http://127.0.0.1:8001,
api_key: ,
api_mode: completion,
generation: {
thinking: true,
use_format: false,
usecotcaption: true,
usecotlanguage: false,
batch_size: 1,
audio_format: mp3,
vocal_language: en
}
}
| 选项 | 默认值 | 描述 |
|---|
| apiurl | http://127.0.0.1:8001 | API 服务器地址 |
| apikey |
| API 认证密钥(可选) |
| api_mode | completion | API 模式:completion(OpenRouter,默认)或 native(轮询) |
| generation.thinking | true | 启用 5Hz LM(更高质量,更慢) |
| generation.audio_format | mp3 | 输出格式(mp3/wav/flac) |
| generation.vocal_language | en | 人声语言 |
先决条件 - ACE-Step API 服务
重要:此技能需要 ACE-Step API 服务器正在运行。
所需依赖
scripts/acestep.sh 脚本需要:curl 和 jq。
bash
检查依赖
curl --version
jq --version
如果未安装 jq,脚本将尝试自动安装。如果自动安装失败:
- - Windows:choco install jq 或从 https://jqlang.github.io/jq/download/ 下载
- macOS:brew install jq
- Linux:sudo apt-get install jq(Debian/Ubuntu)或 sudo dnf install jq(Fedora)
首次使用前
在继续之前,必须检查 API 密钥和 URL 状态。 运行:
bash
cd {项目根目录}/{.claude 或 .codex}/skills/acestep/ && bash ./scripts/acestep.sh config --check-key
cd {项目根目录}/{.claude 或 .codex}/skills/acestep/ && bash ./scripts/acestep.sh config --get api_url
情况 1:使用官方云 API(https://api.acemusic.ai)且无 API 密钥
如果 apiurl 是 https://api.acemusic.ai 且 apikey 为 空,必须停止并引导用户配置密钥:
- 1. 告知用户:你正在使用 ACE-Step 官方云 API,但未配置 API 密钥。使用此服务需要 API 密钥。
- 解释如何获取密钥:API 密钥目前可通过 acemusic.ai 免费获取。
- 使用 AskUserQuestion 询问用户提供其 API 密钥。
- 提供后,进行配置:
bash
cd {项目根目录}/{.claude 或 .codex}/skills/acestep/ && bash ./scripts/acestep.sh config --set api_key <密钥>
- 5. 此外,告知用户:如果你还想渲染音乐视频(MV),建议同时配置歌词转录 API 密钥(OpenAI Whisper 或 ElevenLabs Scribe),以便自动转录带有准确时间戳的歌词。你可以稍后通过 acestep-lyrics-transcription 技能进行配置。
情况 2:已配置 API 密钥
验证 API 端点:./scripts/acestep.sh