Preview a voice
preview a voice by name.
POST
https://api.centerfy.ai/webhooks/inbound/voices/preview Headers
| Header | Required | Value | Description |
|---|---|---|---|
x-api-key | Yes | your sub-account API key (cfy_…) | API key; or Authorization: Bearer <key>. |
Content-Type | Yes | application/json | JSON request body. |
Body parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
name | string | Yes | — | friendly voice NAME, e.g. “Marissa” (from GET /webhooks/inbound/voices). An unknown name → 400. |
text | string | No | — | optional custom line for the voice to speak; defaults to a built-in sample greeting if omitted. |
Request body
{
"name": "Marissa",
"text": "Hello, thanks for calling. How can I help you today?"
}Example
curl -X POST "https://api.centerfy.ai/webhooks/inbound/voices/preview" \
-H "x-api-key: $CENTERFY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Marissa",
"text": "Hello, thanks for calling. How can I help you today?"
}' \
--output preview.mp3 import { CenterfyClient } from "@centerfy/sdk";
const centerfy = new CenterfyClient({ apiKey: process.env.CENTERFY_API_KEY! });
const audio = await centerfy.voices.preview({
"name": "Marissa",
"text": "Hello, thanks for calling. How can I help you today?"
});
// audio is an ArrayBuffer of MP3 bytes
await import("node:fs/promises").then((fs) => fs.writeFile("preview.mp3", Buffer.from(audio))); centerfy voices preview '{"name":"Marissa","text":"Hello, thanks for calling. How can I help you today?"}' MCP tool: centerfy_voices_preview (see MCP server)
Response
(binary MP3 audio)
Content-Type: audio/mpeg
Content-Disposition: inline; filename="Marissa-preview.mp3"
<raw MP3 bytes of the synthesized voice preview>Errors
400— if name is missing or unknown; 500 if audio generation fails; 502 if the text-to-speech service is unavailable.
Notes
On success returns the MP3 audio INLINE (Content-Type audio/mpeg, Content-Disposition inline), not JSON.