Skip to content

Developer quickstart

Install the SDK and generate your first VoiceLab audio file with an API key.

Official packages: Python on PyPI and TypeScript on npm.

Create a key in the VoiceLab app, then export it:

bash
export VOICELAB_API_KEY=your_api_key

Choose a language

Choose your language

Generate your first audio file

  1. Install the npm package

    Terminal
    npm install @voicelab/sdk
  2. Generate speech

    TypeScript
    import { writeFile } from "node:fs/promises";
    import { VoiceLab } from "@voicelab/sdk";
    
    const voiceLab = new VoiceLab({
      apiKey: process.env.VOICELAB_API_KEY!,
    });
    
    const speech = await voiceLab.tts.synthesize({
      text: "Hello from VoiceLab.",
      language: "en",
      voiceId: "voice_01J9NEUTRAL0000000000000001",
    });
    
    await writeFile("speech.wav", new Uint8Array(speech.audio));

Next