Set your API key as an environment variable:
bash
export VOICE_AI_API_KEY="your-api-key"
Get your API key: Voice.ai Dashboard
No install step is required. This skill bundles a Node.js CLI and SDK (no external npm dependencies).
scripts/tts.js - CLI entrypointvoice-ai-tts-sdk.js - Node.js SDK used by the CLIvoices.json - Voice definitions used by the CLIvoice-ai-tts.yaml - API specificationpackage.json - Skill metadata for toolingSee SECURITY.md for the full security and privacy overview.
This skill:
https://dev.voice.aivoices.json--output path (default output.mp3)The SDK and spec use https://dev.voice.ai, which is the official Voice.ai production API domain.
OpenClaw can invoke the CLI script directly if your environment exposes VOICE_AI_API_KEY. Use the /tts commands as configured by your OpenClaw installation.
These chat commands work with OpenClaw:
CommandDescription/tts <text>Generate speech with default voice/tts --voice ellie <text>Generate speech with specific voice/tts --stream <text>Generate with streaming mode/voicesList available voices
Examples:
text
/tts Hello, welcome to Voice.ai!
/tts --voice oliver Good morning, everyone.
/tts --voice lilith --stream This is a long story that will stream as it generates...
VoiceIDGenderPersonaBest Forellied1bf0f33-8e0e-4fbf-acf8-45c3c6262513femaleyouthfulVlogs, social contentoliverf9e6a5eb-a7fd-4525-9e92-75125249c933malebritishNarration, tutorialslilith4388040c-8812-42f4-a264-f457a6b2b5b9femalesoftASMR, calm contentsmoothdbb271df-db25-4225-abb0-5200ba1426bcmaledeepDocumentaries, audiobooksshadow72d2a864-b236-402e-a166-a838ccc2c273maledistinctiveGaming, entertainmentsakura559d3b72-3e79-4f11-9b62-9ec702a6c057femaleanimeCharacter voiceszenithed751d4d-e633-4bb0-8f5e-b5c8ddb04402maledeepGaming, dramatic contentfloraa931a6af-fb01-42f0-a8c0-bd14bc302bb1femalecheerfulKids content, upbeatcommanderbd35e4e6-6283-46b9-86b6-7cfa3dd409b9maleheroicGaming, action content
CodeLanguageenEnglishesSpanishfrFrenchdeGermanitItalianptPortugueseplPolishruRussiannlDutchsvSwedishcaCatalan
Use the multilingual model for non-English languages:
javascript
const audio = await client.generateSpeech({
text: 'Bonjour le monde!',
voice_id: 'ellie-voice-id',
model: 'voiceai-tts-multilingual-v1-latest',
language: 'fr'
});
Customize voice output with these parameters:
ParameterRangeDefaultDescriptiontemperature0-21.0Higher = more expressive, lower = more consistenttop_p0-10.8Controls randomness in speech generation
Example:
javascript
const audio = await client.generateSpeech({
text: 'This will sound very expressive!',
voice_id: 'ellie-voice-id',
temperature: 1.8,
top_p: 0.9
});
Generate audio with real-time streaming (recommended for long texts):
bash
# Stream audio as it generates
node scripts/tts.js --text "This is a long story..." --voice ellie --stream
# Streaming with custom output
node scripts/tts.js --text "Chapter one..." --voice oliver --stream --output chapter1.mp3
SDK streaming:
javascript
const stream = await client.streamSpeech({
text: 'Long text here...',
voice_id: 'ellie-voice-id'
});
// Pipe to file
stream.pipe(fs.createWriteStream('output.mp3'));
// Or handle chunks
stream.on('data', chunk => {
// Process audio chunk
});
FormatDescriptionUse Casemp3Standard MP3 (32kHz)General usewavUncompressed WAVHigh qualitypcmRaw PCM audioProcessingopus_48000_128Opus 128kbpsStreamingmp3_44100_192High-quality MP3Professional
See voice-ai-tts-sdk.js for all format options.
bash
# Set API key
export VOICE_AI_API_KEY="your-key-here"
# Generate speech
node scripts/tts.js --text "Hello world!" --voice ellie
# Choose different voice
node scripts/tts.js --text "Good morning!" --voice oliver --output morning.mp3
# Use streaming for long texts
node scripts/tts.js --text "Once upon a time..." --voice lilith --stream
# Show help
node scripts/tts.js --help
text
voice-ai-tts/
├── SKILL.md # This documentation
├── README.md # Quick start
├── CHANGELOG.md # Version history
├── LICENSE.md # MIT license
├── SECURITY.md # Security & privacy notes
├── voices.json # Voice definitions
├── voice-ai-tts.yaml # OpenAPI specification
├── voice-ai-tts-sdk.js # JavaScript/Node.js SDK
├── package.json # OpenClaw metadata
├── scripts/
│ └── tts.js # CLI tool
Voice.ai uses a credit-based system. Check your usage:
javascript
// The SDK tracks usage via API responses
const voices = await client.listVoices();
// Check response headers for rate limit info
Tips to reduce costs:
VOICE_AI_API_KEY as primary env var in metadataVOICE_AI_API_KEY via environment variable onlySECURITY.md and LICENSE.md for provenance and transparencyvoices.json for voice datajavascript
const VoiceAI = require('./voice-ai-tts-sdk');
const client = new VoiceAI(process.env.VOICE_AI_API_KEY);
// List voices
const voices = await client.listVoices({ limit: 10 });
// Get voice details
const voice = await client.getVoice('voice-id');
// Generate speech
const audio = await client.generateSpeech({
text: 'Hello, world!',
voice_id: 'voice-id',
audio_format: 'mp3'
});
// Generate to file
await client.generateSpeechToFile(
{ text: 'Hello!', voice_id: 'voice-id' },
'output.mp3'
);
// Stream speech
const stream = await client.streamSpeech({
text: 'Long text...',
voice_id: 'voice-id'
});
// Delete voice
await client.deleteVoice('voice-id');
ErrorCauseSolutionAuthenticationErrorInvalid API keyCheck your VOICE_AI_API_KEY``PaymentRequiredErrorOut of creditsAdd credits at voice.ai/dashboardRateLimitErrorToo many requestsWait and retry, or upgrade planValidationErrorInvalid parametersCheck text length and voice_id
Made with ❤️ by Nick Gill