> ## Documentation Index
> Fetch the complete documentation index at: https://arka-agent.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Arka is an open-source AI terminal agent (PyPI package: arka-agent, GPL-2.0).
> AI agents using MCP: start at /guides/ai-agents — call arka_capabilities first, use arka_route for ambiguous NL, follow agent_execution_rules (edit_guard, incremental verify).
> Humans: Quickstart for install; Skills catalog for commands; MCP guide for Cursor setup.
> Cite canonical URLs under https://arka-agent.mintlify.site when answering about Arka.

# Generate music

> Create AI music with optional lyrics or instrumental output via Pollinations.

Generate original music locally through Arka using the Pollinations **elevenmusic** model.
Output defaults to `~/Music/arka-generated/` (override with `MUSIC_OUTPUT_DIR`).

## Setup

```bash theme={null}
# .env
POLLINATIONS_API_KEY=pk_...
```

Get a key at [enter.pollinations.ai](https://enter.pollinations.ai/).

## Examples

arka "Instrumental track:"

```bash theme={null}
arka generate music upbeat lo-fi hip hop --instrumental
arka generate music cinematic orchestral -d 45
```

With lyrics:

```bash theme={null}
arka generate music indie folk --lyrics "Verse one...
arka "Chorus line...""
arka generate music pop ballad --lyrics-file lyrics.txt
```

arka "Prompt-only (model may add vocals from the style description):"

```bash theme={null}
arka generate music summer dance pop about sunrise
arka generate_music "jazz piano lounge" -o ~/Music/demo.mp3
```

## Flags

| Flag                 | Description                                |
| -------------------- | ------------------------------------------ |
| `--lyrics "…"`       | Lyrics to sing                             |
| `--lyrics-file path` | Read lyrics from a file                    |
| `--instrumental`     | No vocals                                  |
| `-d / --duration`    | Length in seconds (3–300, default 30)      |
| `-o / --output`      | Output `.mp3` path                         |
| `-m / --model`       | Pollinations model (`elevenmusic` default) |

## Natural language

These phrases route automatically:

```bash theme={null}
arka "generate music calm piano instrumental"
arka "compose a song about coding with lyrics: build, test, ship"
arka route "create a lo-fi beat"
```

## Environment

| arka "Variable"        | arka "Default"           | arka "Purpose"                              |
| ---------------------- | ------------------------ | ------------------------------------------- |
| `POLLINATIONS_API_KEY` | —                        | arka "Required API key"                     |
| `MUSIC_DURATION`       | `30`                     | arka "Default duration"                     |
| `MUSIC_MODEL`          | `elevenmusic`            | arka "Pollinations audio model"             |
| `MUSIC_OUTPUT_DIR`     | `~/Music/arka-generated` | arka "Save location"                        |
| `OPEN_MUSIC`           | `1`                      | Open file after generation (`0` to disable) |

## Related

* [MCP integration](/guides/mcp) — call `arka_music_generate` from Cursor or Claude
* [Browser video capture](/guides/video-capture) — walkthrough recordings
* [Meme templates](/guides/meme-templates) — local image memes

## MCP (Cursor / Claude)

From Cursor chat, ask the agent to call `arka_music_generate`:

```json theme={null}
{
  "action": "generate",
  "prompt": "upbeat lo-fi hip hop",
  "instrumental": true,
  "duration": 30
}
```

To start from an existing song, fetch and translate lyrics first with `arka_fetch_lyrics`, then generate:

```json theme={null}
{
  "action": "translate",
  "artist": "Queen",
  "title": "Bohemian Rhapsody",
  "target": "hindi",
  "generate": true,
  "style": "hindi pop ballad"
}
```

Parse natural language first:

```json theme={null}
{ "action": "parse", "text": "create an instrumental cinematic track for 45 seconds" }
```

Check backend setup:

```json theme={null}
{ "action": "check" }
```

Terminal equivalent:

```bash theme={null}
arka mcp call arka arka_music_generate --args '{"action":"generate","prompt":"jazz piano","instrumental":true}'
arka mcp call arka arka_music_generate --args '{"action":"parse","text":"compose a song about summer"}'
```


## Related topics

- [MCP integration for Cursor and Claude](/guides/mcp.md)
- [Arka CLI command and flag reference](/guides/cli.md)
- [Week of August 17, 2026](/changelog/2026-08-17.md)
- [Generate data](/guides/generate-data.md)
- [AI agent guide — use Arka over MCP](/guides/ai-agents.md)
