> ## Documentation Index
> Fetch the complete documentation index at: https://docs.audiopod.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# CLI

> Generate music, voiceover, transcribe, separate stems, and clone voices from your terminal.

<Info>
  The `audiopod` CLI ships bundled with both SDKs. Same commands, same flags whether you `pip install audiopod` or `npm install -g audiopod`.
</Info>

## Install

<Tabs>
  <Tab title="Python (pip)">
    ```bash theme={null}
    pip install audiopod
    ```

    Requires Python 3.8+.
  </Tab>

  <Tab title="Node (npm)">
    ```bash theme={null}
    npm install -g audiopod
    ```

    Requires Node 16+.
  </Tab>

  <Tab title="Node (pnpm)">
    ```bash theme={null}
    pnpm add -g audiopod
    ```
  </Tab>
</Tabs>

***

## Authenticate

Get an API key from [your dashboard](https://www.audiopod.ai/dashboard/account/api-keys), then either:

```bash theme={null}
audiopod login
# Paste ap_*  → stored at ~/.audiopod/config.json (mode 600)
```

…or set the environment variable:

```bash theme={null}
export AUDIOPOD_API_KEY=ap_YOUR_KEY
```

Per-call override:

```bash theme={null}
audiopod --api-key ap_OTHER_KEY music "test"
```

***

## Commands

### `audiopod music`

Generate a song, instrumental, rap, or vocal stem.

```bash theme={null}
audiopod music "lo-fi rainy 90 BPM" --duration 60 --out song.wav
audiopod music "intro for podcast about climate" --kind instrumental --out intro.wav
audiopod music "uplifting wedding ballad" --lyrics "We met..." --kind song
```

**Flags**

| Flag         | Default | Description                                                      |
| ------------ | ------- | ---------------------------------------------------------------- |
| `--kind`     | `song`  | One of `song`, `instrumental`, `rap`, `vocals`.                  |
| `--duration` | `60`    | Seconds (10–600).                                                |
| `--lyrics`   | —       | Optional lyric text for vocal modes.                             |
| `--out`      | —       | If set, the CLI waits for completion and downloads to this path. |
| `--timeout`  | `600`   | Max seconds to wait when `--out` is given.                       |

### `audiopod tts`

Synthesize speech.

```bash theme={null}
audiopod tts "Welcome to AudioPod." --voice 368 --out hello.mp3
audiopod tts "Bienvenue à AudioPod." --voice 368 --lang fr --out hello-fr.mp3
```

**Flags**

| Flag       | Default | Description                                         |
| ---------- | ------- | --------------------------------------------------- |
| `--voice`  | `368`   | AudioPod voice ID (integer) or public catalog name. |
| `--lang`   | `en`    | ISO language code.                                  |
| `--speed`  | `1.0`   | Multiplier (0.25–4.0).                              |
| `--format` | `mp3`   | `mp3`, `wav`, or `ogg`.                             |
| `--out`    | —       | If set, downloads on completion.                    |

### `audiopod transcribe`

Transcribe a local file or URL.

```bash theme={null}
audiopod transcribe meeting.mp3 --diarize --format srt > meeting.srt
audiopod transcribe https://example.com/podcast.mp3 --lang en --format json
```

| Flag        | Description                                  |
| ----------- | -------------------------------------------- |
| `--lang`    | Force a language (auto-detected if omitted). |
| `--diarize` | Emit speaker labels.                         |
| `--format`  | `text`, `srt`, `vtt`, `json`.                |
| `--out`     | Write the transcript to a file.              |

### `audiopod stems`

Separate audio into stems.

```bash theme={null}
audiopod stems track.wav --mode six
audiopod stems https://example.com/song.mp3 --mode two
```

| Flag     | Description                                                                              |
| -------- | ---------------------------------------------------------------------------------------- |
| `--mode` | `two` (vocal+instr), `four` (vocals/drums/bass/other), `six` (+guitar+piano), `sixteen`. |

### `audiopod clone`

Train a voice from a 5–30s reference clip.

```bash theme={null}
audiopod clone reference.wav --name "Narrator" --description "Calm narrator voice"
```

| Flag                | Description                                 |
| ------------------- | ------------------------------------------- |
| `--name` (required) | Display name for the cloned voice.          |
| `--description`     | Optional voice characteristics description. |

### `audiopod audiobook`

Produce a finished, ACX-compliant audiobook from a manuscript — upload, narrate, export, and (with `--out`) download the package in one command.

```bash theme={null}
audiopod audiobook book.epub --title "The Lighthouse Keeper" --author "A. P. Tester" --voice 387 --out lighthouse-acx.zip
audiopod audiobook --text "Once upon a time..." --title "A Short Tale" --voice 387
```

| Flag                 | Description                                                                     |
| -------------------- | ------------------------------------------------------------------------------- |
| `<file>`             | Manuscript file (PDF/EPUB/DOCX/TXT). Omit and use `--text` to narrate raw text. |
| `--title` (required) | Audiobook title.                                                                |
| `--author`           | Author name (written into the package metadata).                                |
| `--text`             | Narrate this text instead of a file.                                            |
| `--voice`            | Narration voice ID (default 387).                                               |
| `--out`              | Download the ACX package ZIP to this path.                                      |
| `--timeout`          | Max seconds to wait for the full pipeline (default 1800).                       |

### `audiopod jobs`

Look up any async job by id.

```bash theme={null}
audiopod jobs job_abc123
audiopod jobs job_abc123 --json | jq .output_url
```

***

## Output

Human-readable by default; pass `--json` for scripting:

```bash theme={null}
audiopod tts "hi" --voice 368 --json | jq -r '.id'
```

***

## Exit codes

| Code | Meaning                         |
| ---- | ------------------------------- |
| 0    | Success                         |
| 1    | API or runtime error            |
| 2    | Bad arguments / missing API key |
| 130  | Interrupted (Ctrl-C)            |

***

## See also

<Columns cols={2}>
  <Card title="MCP Server" icon="plug" href="/sdks/mcp">
    Wire AudioPod into any agent.
  </Card>

  <Card title="Python SDK" icon="python" href="/sdks/python">
    Programmatic access from Python.
  </Card>

  <Card title="Node.js SDK" icon="square-js" href="/sdks/nodejs">
    Programmatic access from Node.js / TypeScript.
  </Card>

  <Card title="For Agents landing" icon="robot" href="https://audiopod.ai/for-agents">
    Every developer surface in one page.
  </Card>
</Columns>
