---
title: Quickstart
icon: Rocket
description: Install the HUMAIN Voice SDK and transcribe your first recording in about five minutes.
---

You install the SDK, transcribe a WAV recording, and get the transcript plus WebVTT captions.

## Before you start

- An API key from the [HUMAIN Voice console](https://console.voice.humain.com) ([Authentication](/en/authentication)).
- A WAV recording saved as `recording.wav`.
- Node.js 24 or newer (runs `.ts` files directly) or Python 3.10 or newer.

## 1. Install the SDK

**JavaScript / TypeScript**

```bash
npm install @humain-voice/sdk@0.18.1
```

**Python**

```bash
python -m pip install humain-voice==0.18.1
```

## 2. Set your environment

```bash
export API_URL="https://api.voice.humain.com"
export API_KEY="YOUR_API_KEY"
```

Socket.IO examples also read the optional `API_PATH`
([Connection settings](/en/authentication#connection-settings)).

## 3. Run a batch transcription

**JavaScript / TypeScript**

```ts
import { readFile, writeFile } from 'node:fs/promises';

import {
  BatchDiarization,
  BatchTranscribeClient,
  BatchTranscriptionModel,
  Language,
  Subtitles,
} from '@humain-voice/sdk';

function requiredEnv(name: 'API_KEY' | 'API_URL'): string {
  const value = process.env[name];
  if (!value) throw new Error(`${name} is required`);
  return value;
}

async function main(): Promise<void> {
  const inputPath = process.argv[2] ?? 'recording.wav';
  const outputPath = process.argv[3] ?? 'recording.vtt';
  const client = new BatchTranscribeClient({
    api_url: requiredEnv('API_URL'),
    api_key: requiredEnv('API_KEY'),
    api_version: process.env.API_VERSION ?? 'v1',
  });

  try {
    const result = await client.transcribe(
      await readFile(inputPath),
      Language.ArEn,
      {
        asr: BatchTranscriptionModel.BayanArEn,
        diarization: BatchDiarization.On,
        saveResult: true,
        pollInterval: 2,
        timeout: 300,
        onProgress: ({ status }) => console.info('status:', status),
      },
    );

    console.info(result.results?.transcript ?? '');
    await writeFile(outputPath, Subtitles.fromResponse(result).toVtt(), 'utf8');
  } finally {
    await client.close();
  }
}

void main().catch((error: unknown) => {
  console.error(error);
  process.exitCode = 1;
});
```

**Python**

```python
from __future__ import annotations

import asyncio
import os
import sys
from pathlib import Path

from humain_voice import stt
from humain_voice.stt.batchtranscription import BatchDiarization


def required_env(name: str) -> str:
    value = os.environ.get(name)
    if not value:
        raise RuntimeError(f"{name} is required")
    return value


async def main() -> None:
    input_path = Path(sys.argv[1] if len(sys.argv) > 1 else "recording.wav")
    output_path = Path(sys.argv[2] if len(sys.argv) > 2 else "recording.vtt")

    async with stt.BatchTranscribeClient(
        api_url=required_env("API_URL"),
        api_key=required_env("API_KEY"),
        api_version=os.environ.get("API_VERSION", "v1"),
    ) as client:
        result = await client.transcribe(
            input_path,
            lang=stt.Language.ArEn,
            asr=stt.BatchTranscriptionModel.BayanArEn,
            diarization=BatchDiarization.On,
            save_result=True,
            poll_interval=2.0,
            timeout_seconds=300.0,
            on_progress=lambda response: print("status:", response.status.value),
        )

    print(result.results.transcript if result.results else "")
    output_path.write_text(
        stt.Subtitles.from_response(result).to_vtt(),
        encoding="utf-8",
    )


if __name__ == "__main__":
    asyncio.run(main())
```

Save the example under its displayed filename and run it:

- JavaScript / TypeScript: `node batch-transcription.ts recording.wav`
- Python: `python batch_transcription.py recording.wav`

## What you get back

Expected output (illustrative):

```text
status: queued
status: processing
status: processing
status: done
Hello and welcome to the meeting.
```

Captions are written to `recording.vtt`. The upload runs as a job with its own statuses
([Batch is a job](/en/concepts#batch-is-a-job)).

## Next steps

- [Realtime transcription](/en/recipes/realtime-transcription): Transcribe live audio as it arrives.
- [Transcribe a recording](/en/recipes/transcribe-a-recording): Label who said what in a recording.
- [Text to speech: save or stream](/en/recipes/text-to-speech-to-file): Turn text into speech and save or play it.
- [Choose a workflow](/en/concepts#choose-a-workflow): Pick batch, fast, or realtime for your audio.
