Get started with Destined Voice API in 5 minutes
npm install @destined-ai/voice
import { SDK } from "@destined-ai/voice"; const client = new SDK({ bearerToken: process.env.DESTINED_API_KEY, });
// List female speakers from the US const speakers = await client.speakers.listSpeakersV1SpeakersGet({ gender: "Female", region: "United States", limit: 10, }); console.log(speakers); // [ // { id: "abc123", gender: "Female", region: "Georgia", accent: "Southern" }, // { id: "def456", gender: "Female", region: "California", accent: "General American" }, // ... // ]
const result = await client.ttsGeneration.synthesizeSpeechV1TtsSynthesizePost({ speakerId: "abc123", text: "Hello! This is a test of the Destined Voice API.", }); console.log(result.audioUrl); // https://destined-voice.s3.amazonaws.com/audio/xxx.wav
// Start a batch job const job = await client.ttsGeneration.batchSynthesizeV1TtsBatchPost({ items: [ { speakerId: "abc123", text: "First sentence." }, { speakerId: "def456", text: "Second sentence." }, { speakerId: "ghi789", text: "Third sentence." }, ], }); console.log(job.jobId); // "job_abc123" // Check job status const status = await client.jobs.getJobV1JobsJobIdGet({ jobId: job.jobId, }); console.log(status); // { status: "completed", progress: 100, results: [...] }