Quickstart
1. Initialize the client
import { VyonicaClient } from 'vyonica';
const client = new VyonicaClient({ apiKey: 'nvsk_your_api_key_here', baseUrl: 'http://localhost:8000', // default});2. One-liner clone (recommended)
The clone() method handles everything: submitting the job, polling for completion, and returning the audio buffer.
import { VyonicaClient } from 'vyonica';import fs from 'fs';
const client = new VyonicaClient({ apiKey: 'nvsk_...' });
const audioBuffer = await client.clone( fs.readFileSync('reference.wav'), { text: 'Hello world', language: 'en' });
fs.writeFileSync('output.wav', audioBuffer);Custom poll options
const audioBuffer = await client.clone( fs.readFileSync('reference.wav'), { text: 'Hello world', language: 'en', temperature: 0.7, exaggeration: 0.5, }, { intervalMs: 3000, // poll every 3 seconds (default: 2000) timeoutMs: 120_000, // give up after 2 minutes (default: 300_000) });If the job doesn’t finish within timeoutMs, the SDK throws a JobTimeoutError. See Error handling for the full list.
Next steps
- Manual job flow — submit many jobs and download results later.
- Clone options — every parameter you can pass.
- Usage & quota — track minute-based limits.