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:
- OpenClaw installed -
npm install -g openclaw@latest - Typecast API Key - Get yours here
- 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
brew install neosapience/tap/cast
Step 2: Authenticate
cast login
Or pass the key directly:
cast login <your-api-key>
Step 3: Verify
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:
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:
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:
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.
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:
openclaw mcp show typecast
Once registered, Typecast tools appear as typecast__synthesize_speech, typecast__list_voices, etc. Ask your agent:
Use the typecast MCP tools to synthesize "Hello from Typecast" as an mp3 file.
Voice and Emotion Control
Finding Voices
Use the cast CLI to list available voices:
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
AI automatically detects the best emotion from text context. Great for natural conversations and storytelling.
Manually choose from 7 emotions: Normal, Happy, Sad, Angry, Whisper, Tone Up, Tone Down.
cast CLI with emotion:
# 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
Automated meeting summary narration
- OpenClaw receives meeting transcript
- Agent summarizes key points with an LLM
- Agent runs
castto generate audio summary - Output file is uploaded to Slack or Google Drive
Multilingual content pipeline
- Agent receives content in English
- Translates to Korean, Japanese, Chinese
- Generates Typecast audio for each language
- Saves all audio files to cloud storage
CI/CD voice notifications
- Build pipeline triggers OpenClaw agent
- Agent generates status message: "Build succeeded" or "Build failed"
castproduces audio notification- Audio is posted to team Discord channel
Troubleshooting
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.
Authentication error
Run cast login or pass your API key directly with cast login <api_key>. Verify at the Typecast API Console.
No audio playback in headless sessions
Use --out to save to a file instead of playing audio. Return the file path to the user.
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.
MCP server not connecting
- Ensure
uvxis installed and onPATH:command -v uvx - Check that
TYPECAST_API_KEYis set in the environment - Run
openclaw mcp show typecastto verify registration