mv.voices
Voices assistants can speak with. These methods are on mv.voices, where mv is your client (see the Node.js SDK). Each one returns the response object and throws when the API answers with an error.
list()
Section titled “list()”List voices. The voices assistants can speak with: your custom voices first, then the provider’s library by name (the dashboard’s order).
mv.voices.list(query?: NonNullable<VoicesListData["query"]>, options?: RequestOptions): PagedList<VoicesListResponse["data"][number], NonNullable<VoicesListData["query"]>>GET /voices · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
query.limit |
integer |
no | How many objects to return, 1–100 (default 20). |
query.starting_after |
string |
no | A cursor (next_cursor) or object ID: return the objects after it (older). |
query.ending_before |
string |
no | A cursor or object ID: return the objects before it (newer). |
query.type |
string |
no | Only prebuilt or only custom voices. |
query.language |
string |
no | Only voices listing this language (en matches en-US). |
options.headers["MoreVoice-Version"] |
string |
no | The API version to use for this request. Defaults to the version the API key is pinned to. |
options |
RequestOptions |
no | idempotencyKey, extra headers and an abort signal: see retries and idempotency. |
Returns
Section titled “Returns”A PagedList: await it for the first page, for await it for every item.
Example
Section titled “Example”import { createClient, createResources } from "@morevoice/sdk";
const mv = createResources({ client: createClient({ baseUrl: "https://api.morevoice.ai/v1", auth: process.env.MOREVOICE_API_KEY }),});
for await (const voice of mv.voices.list()) { console.log(voice);}preview()
Section titled “preview()”Preview a voice. Speaks up to 300 characters in a voice and returns a WAV file. Test-mode keys get a synthetic tone of the same length instead, and no speech provider is called; the Audio-Source response header says which you got (speech or synthetic).
mv.voices.preview(body: VoicesPreviewData["body"], options?: RequestOptions): Promise<VoicesPreviewResponse>POST /voices/preview · API reference
Parameters
Section titled “Parameters”| Name | Type | Required | Description |
|---|---|---|---|
body.voice_id |
string |
yes | The voice to hear (voice_id from GET /v1/voices). |
body.language |
string |
no | The language of text (default he). |
body.model |
string |
no | The TTS model (default: the assistants’ default). |
body.style |
string |
no | Delivery direction, e.g. calm and reassuring. |
body.text |
string |
no | What to say, up to 300 characters (default: a short greeting in language). |
options.headers["MoreVoice-Version"] |
string |
no | The API version to use for this request. Defaults to the version the API key is pinned to. |
options.headers["Idempotency-Key"] |
string |
no | A unique key (for example a UUID) that makes this request safe to retry: for 24 hours, a retry with the same key and parameters returns the first response instead of acting twice. |
options |
RequestOptions |
no | idempotencyKey, extra headers and an abort signal: see retries and idempotency. |
Returns
Section titled “Returns”Nothing, on success.
Example
Section titled “Example”import { createClient, createResources } from "@morevoice/sdk";
const mv = createResources({ client: createClient({ baseUrl: "https://api.morevoice.ai/v1", auth: process.env.MOREVOICE_API_KEY }),});
const result = await mv.voices.preview({ language: "he", style: "warm and friendly", text: "שלום! ככה אני נשמעת.", voice_id: "Kore",});console.log(result);