← Back to Blog

How to Run an AI Music Generation Agent with OE Runtime

Generate original music tracks from text descriptions automatically. OE Runtime connects to Suno, crafts optimised music prompts, and returns the audio URL — from a background track to a full composition, all from a YAML file.

🎵
Step 1
Design Music Prompt
Craft a detailed Suno prompt specifying genre, mood, tempo, instruments, and duration.
Step 2
Generate Track
Submit the prompt to Suno and poll for completion before retrieving the audio URL.
Step 3
Report
Return the prompt used, track title, audio URL, duration, format, and generation time.

What You Need


Create the Project Folder

Create a folder called music-generation/ and add these two files:

music-generation/
├── SKILL.md         # the portable skill (agentskills.io)
├── agent.yaml       # wires SKILL.md to your connector
└── oe-config.json  # LLM key + connector credentials

The Skill Files

Create SKILL.md inside a music-generation/ directory. This is the portable skill — it follows the agentskills.io format and runs unchanged on Claude, Cursor, Windsurf, or OE Runtime:

---
name: music-generation
description: Generate original music tracks from text descriptions
license: Apache-2.0
metadata:
  author: Open Enthrium
  version: "1.0"
---

You are a music generation agent. Create original music using the Suno connector via kie.ai.
Music generation is asynchronous — after submitting, poll for completion before returning the result.
Complete all steps fully before writing your report.

## Step 1: Design Music Prompt
Craft a detailed music prompt for an upbeat corporate background track.
Specify: genre (corporate pop), mood (energetic, optimistic), tempo (120 BPM),
instruments (acoustic guitar, light drums, piano), no vocals.

## Step 2: Generate Track
Submit the music prompt to the Suno connector.
POST /generate with body:
{
  "prompt": "<detailed music prompt from previous step>",
  "model": "V4_5",
  "instrumental": true,
  "customMode": false
}
Save the taskId from the response: data.taskId.
Then poll GET /generate/<taskId> every 10 seconds until data.status is "complete".
Once complete, extract and save the audio URL from the response.

## Step 3: Report
Summarize the result:
- Prompt used for generation
- Track title returned by Suno
- Audio URL
- Generation time taken

Create agent.yaml in the same directory to wire the skill to your connector:

name: Music Creator
description: Generate original music tracks from text descriptions
connectors:
  - connection_name: Suno
    connection_type: suno
skills:
  - path: ./
    trigger_type: auto

The Config File

Create oe-config.json in the same directory:

{
  "llm": {
    "provider": "openai",
    "model": "gpt-4o",
    "apiKey": "YOUR_OPENAI_API_KEY"
  },
  "server": {
    "enabled": false,
    "port": 3333,
    "apiKey": "your-secret-api-key"
  },
  "connectors": [
    {
      "connection_name": "Suno",
      "connection_type": "suno",
      "bearerToken": "YOUR_KIE_AI_API_KEY",
      "baseUrl": "https://api.kie.ai/api/v1"
    }
  ]
}

Get your API key from kie.ai (the Suno API provider). The agent uses model V4_5 and polls the generation task until the track is complete before returning the audio URL. Music generation is asynchronous — polling typically takes 30–90 seconds.

Download OE Runtime

OE Runtime — Direct Downloads

Run the Agent

From the parent folder containing your skill directory:

MethodBest forDownload
1 npx recommended No install needed — always runs the latest version —
2 Windows .exe Download once, run offline on Windows ⊞ Windows (.exe)
3 macOS binary Download once, run offline on Mac  macOS
4 Linux binary Server deployments, cron jobs, Docker 🐧 Linux
5 API Server integration Call from any app, webhook, or automation pipeline 📮 Postman Collection

1 npx recommended

npx -y @openenthrium/oe-runtime@latest ./music-generation

2 Windows

oe-runtime-win.exe ./music-generation

3 macOS

chmod +x oe-runtime-macos
./oe-runtime-macos ./music-generation

First run blocked? System Settings → Privacy & Security → Allow Anyway.

4 Linux

chmod +x oe-runtime-linux
./oe-runtime-linux ./music-generation

5 API Server integration

Add a "server" block to oe-config.json, then start with --serve:

{
  "llm": { ... },
  "server": { "enabled": true, "port": 3333, "apiKey": "your-secret-key" },
  "connectors": [ ... ]
}
npx -y @openenthrium/oe-runtime@latest --serve --config oe-config.json

Run with inline YAML:

curl -X POST http://localhost:3333/run \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-secret-key" \
  -d '{"yaml": "...", "params": {}}'

Or run from a file on the server:

curl -X POST http://localhost:3333/run-file \
  -H "Content-Type: application/json" \
  -H "X-API-Key: your-secret-key" \
  -d '{"file": "/path/to/agent.yaml", "params": {}}'

Use Cases

Build your own agents with OE Runtime

Download OE Runtime and run any AI agent locally or as a server — no cloud required.

Get OE Runtime →
Series OE Runtime Agent Guides — 21 Connectors
Series overview →