Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
bytedance avatar

Byted Music Generate

  • 85 installs
  • 411 repo stars
  • Updated August 4, 2026
  • bytedance/agentkit-samples

byted-music-generate is a skill that generates music, background music, and lyrics through the Volcengine Music Generation API.

About

byted-music-generate calls the Volcengine Music Generation API to create vocal songs, instrumental background music, and AI-written lyrics. A developer runs it when an agent needs to produce a song from a theme prompt or supplied lyrics, generate BGM from a natural-language description, or write lyrics first and feed them into song mode. It polls the API internally and returns an audio_url or lyrics as a single JSON line.

  • Generates vocal songs, instrumental BGM, and AI lyrics from a text prompt or supplied lyrics
  • Wraps the Volcengine Music Generation API with three modes: song, bgm, lyrics
  • Polls the API internally and returns an audio_url or lyrics as JSON

Byted Music Generate by the numbers

  • 85 all-time installs (skills.sh)
  • Ranked #808 of 1,335 Generative Media skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
At a glance

byted-music-generate capabilities & compatibility

Requires a Volcengine API gateway key or AccessKey/SecretKey; billing is prepaid or postpaid via Volcengine.

Capabilities
music generation · lyrics generation · audio generation
Use cases
video generation
Pricing
Bring your own API key
From the docs

What byted-music-generate says it does

Generate music using the [Volcengine Music Generation API](https://www.volcengine.com/docs/84992). Supports vocal songs, instrumental BGM, and AI lyrics generation.
SKILL.md
The script polls the API internally and may take **several minutes** to complete (typically 1–5 minutes for song/bgm).
SKILL.md
Once completed, return the `audio_url` or `lyrics` from the JSON output to the user.
SKILL.md
npx skills add https://github.com/bytedance/agentkit-samples --skill byted-music-generate

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs85
repo stars411
Last updatedAugust 4, 2026
Repositorybytedance/agentkit-samples

What it does

Generate a vocal song, instrumental BGM track, or AI lyrics from a text prompt or supplied lyrics.

Who is it for?

Agents that need to produce songs, background music, or lyrics from a prompt or lyrics text.

Skip if: Editing or mixing existing audio files, since it only generates new audio via the API.

When should I use this skill?

The user wants to create a song, background music, a soundtrack, or AI-generated lyrics.

What you get

Returns an audio_url for the generated song or BGM, or the generated lyrics, as JSON.

  • A generated song or BGM audio URL
  • AI-generated lyrics text

By the numbers

  • 3 modes (song, bgm, lyrics)
  • song duration range 30-240 seconds

Files

SKILL.mdMarkdownGitHub ↗

Music Generate Skill

Generate music using the Volcengine Music Generation API. Supports vocal songs, instrumental BGM, and AI lyrics generation.

Trigger Conditions

1. User wants to generate a song (with lyrics or a text prompt) 2. User needs background music, instrumental tracks, or soundtracks 3. User wants AI-generated lyrics 4. User mentions "write a song", "music generation", "BGM", "background music", "lyrics"

Environment Variables

Two authentication methods are supported (gateway takes priority):

Option 1: API Gateway (recommended)

  • ARK_SKILL_API_BASE — API gateway base URL
  • ARK_SKILL_API_KEY — API gateway authentication key

Option 2: Direct AK/SK

  • VOLCENGINE_ACCESS_KEY — AccessKey ID
  • VOLCENGINE_SECRET_KEY — AccessKey Secret
  • How to obtain: Volcengine Console → Account → Key Management → Create Key

Usage

1. Determine user intent and select the mode (song / bgm / lyrics). 2. cd to the skill directory: skills/byted-music-generate. 3. Run the script. The script polls the API internally and may take several minutes to complete (typically 1–5 minutes for song/bgm). 4. Monitor execution: If the runtime environment moves the command to background, you MUST periodically (every 10 seconds) read the terminal output to check whether the script has finished. The script prints polling progress to stderr and outputs a single JSON line to stdout upon completion. 5. Once completed, return the audio_url or lyrics from the JSON output to the user.

Three Modes

1. song — Vocal Song

User provides lyrics (Lyrics) or a text prompt (Prompt) to generate a vocal song.

# With text prompt
python scripts/music_generate.py song --prompt "A song about summer at the beach" --genre Pop --gender Female

# With lyrics
python scripts/music_generate.py song --lyrics "[verse]\nMoonlight on the windowsill\nMemories flowing like water\n[chorus]\nYou are my moonlight" --genre Folk --mood "Sentimental/Melancholic/Lonely"

Note: --lyrics and --prompt are mutually exclusive; lyrics takes priority. If the user hasn't provided lyrics, you can first use the lyrics mode to generate them, then pass the result to the song mode.

2. bgm — Instrumental BGM

Describe the desired music in natural language. The v5.0 model does not require Genre/Mood parameters — just describe everything in the --text field.

python scripts/music_generate.py bgm --text "Relaxed coffee shop ambiance music with piano and guitar" --duration 60

# With song structure segments
python scripts/music_generate.py bgm --text "Epic game soundtrack" --segments '[{"Name":"intro","Duration":10},{"Name":"chorus","Duration":30}]'

3. lyrics — Lyrics Generation

Returns synchronously (no polling needed). Can be used standalone or as a pre-step for the song mode.

python scripts/music_generate.py lyrics --prompt "A song about graduation farewell" --genre Folk --mood "Sentimental/Melancholic/Lonely" --gender Female

Manual Task Query (timeout fallback)

python scripts/music_generate.py query --task-id "202601397834584670076931"

Mode Detection Logic

User Request
    ↓
Contains "instrumental/BGM/background music/soundtrack"?
    ├─ Yes → bgm mode
    └─ No → Contains "lyrics/write lyrics" and does NOT request audio?
        ├─ Yes → lyrics mode
        └─ No → song mode
            ├─ User provided lyrics → --lyrics
            └─ User only described a theme → --prompt (or lyrics first, then song)

Script Parameters

song mode

ParameterRequiredDescription
--lyricseitherLyrics with structure tags
--prompteitherText prompt (Chinese, 5-700 chars)
--model-versionnov4.0 or v4.3 (default: v4.3)
--genrenoMusic genre
--moodnoMusic mood
--gendernoFemale / Male
--timbrenoVocal timbre
--durationnoDuration in seconds [30-240]
--keynoMusical key (v4.3 only)
--kmodenoMajor / Minor (v4.3 only)
--temponoTempo (v4.3 only)
--instrumentnoInstruments, comma-separated (v4.3 only)
--genre-extranoSecondary genres, comma-separated, max 2 (v4.3 only)
--scenenoScene tags, comma-separated (v4.3 only)
--langnoLanguage (v4.3 only)
--vod-formatnowav / mp3 (v4.3 only)
--billingnoprepaid / postpaid (default: postpaid)
--timeoutnoMax wait seconds (default: 300)

bgm mode

ParameterRequiredDescription
--textyesNatural language description
--durationnoDuration in seconds [30-120]
--segmentsnoJSON array of song structure segments
--versionnoModel version (default: v5.0)
--enable-input-rewritenoEnable prompt rewriting
--billingnoprepaid / postpaid (default: postpaid)
--timeoutnoMax wait seconds (default: 300)

lyrics mode

ParameterRequiredDescription
--promptyesLyrics prompt (Chinese only, <500 chars)
--genrenoMusic genre
--moodnoMusic mood
--gendernoFemale / Male

Script Return Info

The script outputs JSON with the following fields:

{
    "status": "success | timeout | error",
    "mode": "song | bgm | lyrics | query",
    "task_id": "...",
    "audio_url": "https://...",
    "duration": 46.0,
    "lyrics": "...",
    "error": null
}

Return the audio_url to the user for download or playback. URLs are valid for approximately 1 year, but users should save the file promptly.

Error Handling

  • IF the script raises PermissionError: Authentication not configured ..., inform the user to configure either API gateway (ARK_SKILL_API_BASE + ARK_SKILL_API_KEY) or direct AK/SK (VOLCENGINE_ACCESS_KEY + VOLCENGINE_SECRET_KEY) environment variables. Write them to the workspace environment variable file, then retry.
  • IF status is "timeout", the task is still generating. Provide the user with the task_id and the manual query command from the output.
  • IF copyright check fails (code 50000001), suggest the user enrich the description or increase the audio duration, then retry.

References

Related skills

FAQ

What API does byted-music-generate use?

It uses the Volcengine Music Generation API and supports vocal songs, instrumental BGM, and AI lyrics generation.

How long does a generation take?

The script polls the API internally and typically takes 1 to 5 minutes for song or bgm modes.

Generative Mediaautomationllm

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.