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

# OpenClaw

> Add Typecast TTS to your OpenClaw agent workflows with the cast CLI or MCP server.

<Info>
  [OpenClaw](https://docs.openclaw.ai/) is an AI agent runtime that can execute tools, shell commands, and MCP servers. With Typecast, your agent can generate natural-sounding speech in a single command.
</Info>

## What You Can Do

With Typecast and OpenClaw, you can:

* **Generate speech from agent workflows** — Convert any text output to natural-sounding audio
* **Choose from 500+ voices** — Select voices by gender, age, and style
* **Control emotion** — Apply Smart Emotion or preset emotions (happy, sad, angry, whisper, etc.)
* **Support 37 languages** — Generate speech in English, Korean, Japanese, Chinese, and more
* **Automate audio pipelines** — Combine with other tools for end-to-end content creation

***

## Prerequisites

Before you start, make sure you have:

1. **OpenClaw** installed — `npm install -g openclaw@latest`
2. **Typecast API Key** — [Get yours here](https://typecast.ai/developers/api/)
3. **Typecast CLI (`cast`)** — The fastest integration path

***

## Quick Start: cast CLI

The official Typecast CLI turns speech generation into a single shell command. If your agent can run shell commands, it can generate Typecast audio without writing a custom provider.

### Step 1: Install the CLI

<Tabs>
  <Tab title="Homebrew (macOS/Linux)">
    ```bash theme={null}
    brew install neosapience/tap/cast
    ```
  </Tab>

  <Tab title="Go">
    ```bash theme={null}
    go install github.com/neosapience/cast@latest
    ```
  </Tab>
</Tabs>

### Step 2: Authenticate

```bash theme={null}
cast login
```

Or pass the key directly:

```bash theme={null}
cast login <your-api-key>
```

### Step 3: Verify

```bash theme={null}
cast "Hello, world!" --out ./test.mp3 --format mp3
```

If the file is generated successfully, you're ready to use it with OpenClaw.

***

## Integration Methods

### Method 1: cast via Local exec (Recommended)

OpenClaw distinguishes local `exec` from remote `code_execution`. Use local `exec` when the command must access installed binaries on the machine.

Simply ask your OpenClaw agent:

```text theme={null}
Use local exec to run:
cast "Your reservation has been confirmed for Friday at 7 PM." --language eng --format mp3 --out ./confirmation.mp3
Return the generated file path.
```

For repeated use, add a project instruction to your OpenClaw config:

```markdown theme={null}
When the user asks for spoken audio, use the local `cast` CLI.
Default command:

cast "$TEXT" --voice-id "$TYPECAST_VOICE_ID" --language "${TYPECAST_LANGUAGE:-eng}" --format "${TYPECAST_FORMAT:-mp3}" --out "$OUTPUT"

Never print API keys. Prefer `--out` for headless sessions.
```

**Recommended environment variables:**

```bash theme={null}
export TYPECAST_VOICE_ID="tc_60e5426de8b95f1d3000d7b5"
export TYPECAST_LANGUAGE="eng"
export TYPECAST_FORMAT="mp3"
```

### Method 2: MCP Server (Tool-Native)

For deeper integration, connect the Typecast API MCP server so OpenClaw can call TTS tools directly.

<Tabs>
  <Tab title="CLI Registration">
    ```bash theme={null}
    openclaw mcp set typecast '{
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/neosapience/typecast-api-mcp-server.git",
        "typecast-api-mcp-server"
      ],
      "env": {
        "TYPECAST_API_KEY": "${TYPECAST_API_KEY}",
        "TYPECAST_OUTPUT_DIR": "./typecast_output"
      }
    }'
    ```

    Verify:

    ```bash theme={null}
    openclaw mcp show typecast
    ```
  </Tab>

  <Tab title="Bundle Config (JSON)">
    Add to your OpenClaw plugin bundle:

    ```json theme={null}
    {
      "mcp": {
        "servers": {
          "typecast": {
            "command": "uvx",
            "args": [
              "--from",
              "git+https://github.com/neosapience/typecast-api-mcp-server.git",
              "typecast-api-mcp-server"
            ],
            "env": {
              "TYPECAST_API_KEY": "${TYPECAST_API_KEY}",
              "TYPECAST_OUTPUT_DIR": "./typecast_output"
            },
            "connectionTimeoutMs": 30000
          }
        }
      }
    }
    ```
  </Tab>
</Tabs>

Once registered, Typecast tools appear as `typecast__synthesize_speech`, `typecast__list_voices`, etc. Ask your agent:

```text theme={null}
Use the typecast MCP tools to synthesize "Hello from Typecast" as an mp3 file.
```

<Tip>
  You can also connect the remote docs MCP at `https://typecast.ai/docs/mcp` for integration guidance — it provides Typecast documentation as MCP resources without generating audio.
</Tip>

***

## Voice and Emotion Control

### Finding Voices

Use the `cast` CLI to list available voices:

```bash theme={null}
cast voices --model ssfm-v30
```

Or ask your agent to use the MCP `list_voices` tool to browse by gender, age, and use case.

### Emotion Options

<CardGroup cols={2}>
  <Card title="Smart Emotion" icon="wand-magic-sparkles">
    AI automatically detects the best emotion from text context. Great for natural conversations and storytelling.
  </Card>

  <Card title="Preset Emotion" icon="sliders">
    Manually choose from 7 emotions: Normal, Happy, Sad, Angry, Whisper, Tone Up, Tone Down.
  </Card>
</CardGroup>

**cast CLI with emotion:**

```bash theme={null}
# Smart Emotion (ssfm-v30 only)
cast "I can't believe we won!" --model ssfm-v30 --emotion smart --out ./excited.mp3

# Preset Emotion
cast "I'm sorry to hear that." --model ssfm-v30 --emotion sad --out ./sorry.mp3
```

***

## Example Workflows

<AccordionGroup>
  <Accordion title="Automated meeting summary narration">
    1. OpenClaw receives meeting transcript
    2. Agent summarizes key points with an LLM
    3. Agent runs `cast` to generate audio summary
    4. Output file is uploaded to Slack or Google Drive
  </Accordion>

  <Accordion title="Multilingual content pipeline">
    1. Agent receives content in English
    2. Translates to Korean, Japanese, Chinese
    3. Generates Typecast audio for each language
    4. Saves all audio files to cloud storage
  </Accordion>

  <Accordion title="CI/CD voice notifications">
    1. Build pipeline triggers OpenClaw agent
    2. Agent generates status message: "Build succeeded" or "Build failed"
    3. `cast` produces audio notification
    4. Audio is posted to team Discord channel
  </Accordion>
</AccordionGroup>

***

## Troubleshooting

<AccordionGroup>
  <Accordion title="cast: command not found">
    Install the CLI in the same runtime where OpenClaw executes tools. If installed via Homebrew, verify your `PATH` includes the Homebrew bin directory.
  </Accordion>

  <Accordion title="Authentication error">
    Run `cast login` or pass your API key directly with `cast login <api_key>`. Verify at the [Typecast API Console](https://typecast.ai/developers/api/).
  </Accordion>

  <Accordion title="No audio playback in headless sessions">
    Use `--out` to save to a file instead of playing audio. Return the file path to the user.
  </Accordion>

  <Accordion title="Agent prints the command but doesn't run it">
    Explicitly ask the agent to use the `exec` tool or local shell. Add a project instruction to clarify this behavior.
  </Accordion>

  <Accordion title="MCP server not connecting">
    * Ensure `uvx` is installed and on `PATH`: `command -v uvx`
    * Check that `TYPECAST_API_KEY` is set in the environment
    * Run `openclaw mcp show typecast` to verify registration
  </Accordion>
</AccordionGroup>

***

## Resources

<CardGroup cols={2}>
  <Card title="Typecast API Console" icon="key" href="https://typecast.ai/developers/api/">
    Get your API key
  </Card>

  <Card title="Voice Library" icon="microphone" href="https://typecast.ai/developers/api/voices">
    Browse all available voices
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/text-to-speech/text-to-speech">
    Explore the Typecast API
  </Card>

  <Card title="MCP Server" icon="server" href="/integrations/mcp-server">
    Typecast MCP Server docs
  </Card>
</CardGroup>
