Preview BYOK Voice

Bring your own keys

Preview BYOK Voice

Speaks one short line in a voice of your own voice provider, on your key, and answers with the audio itself. Your provider charges you for the characters, so text is capped at 200; without it the voice says a short greeting of ours in language, or the agent's language when you name an agent. Soniox has no preview: it speaks only on a live call. On a Cartesia key, speed, volume, emotion, model and pronunciationDictId are spoken too, so a setting is heard before it is saved (they work as in Set Agent BYOK Voice; the agent's saved settings are not read). Needs a full key.

POST/byok/voices/preview

Headers

Katexs-Workspacestring
Developers only: the customer workspace this request acts in — its org_… id from POST /customers. Leave it out to act in your own workspace. Refused with 404 (Workspace not found.) when the id is unknown, is not one of your customers, or is not an org_… id; 410 when that customer was deleted (restore it with POST /customers/{id}/restore until it is erased); 403 when the key belongs to one customer workspace (it cannot act as another); 400 when your workspace is not a developer workspace. /customers/* and GET /customers/usage are your own workspace's and refuse the header with 400: call them without it.

Request body

voicestringrequired
A voice id from List BYOK Voices.
agentIdstring | null
An agent (ag_…) whose language the line is spoken in when you send no language.
textstring
The line to speak, up to 200 characters. Left out, a short greeting of ours.
languagestring
A language tag such as hi-IN or en, for the line and the voice.
speednumber
Cartesia only. The speed to hear. Range: 0.6–1.5.
volumenumber
Cartesia only. The volume to hear. Range: 0.5–2.
emotionstring
Cartesia only. One of Cartesia's emotions (English only).
modelstring
Cartesia only. A Sonic model other than your key's. One of: sonic-3.6, sonic-3.6-2026-08-27, sonic-3.5, sonic-3, sonic-2.
pronunciationDictIdstring
Cartesia only. A pronunciation dictionary of your account.

Example request

bash
curl -X POST "https://app.katexs.com/api/v1/byok/voices/preview" \
  -H "Authorization: Bearer $KATEXS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "voice": "EXAVITQu4vr4xnSDxMaL",
  "agentId": "ag_5c4a5f93-2b1e-4d7a-9f60-8e2d1c3b4a71",
  "language": "hi-IN"
}'

Responses

StatusDescription
200The spoken line. audio/mpeg from most providers; audio/wav from some (Sarvam). Cacheable privately for an hour.
400voice, text or language is missing or malformed.
401The key is missing, wrong or revoked. The answer is always the same, whichever it is.
403The key's access level (read-only or build) does not allow this request, the plan does not include it, or a customer's key named another workspace in Katexs-Workspace. code says which: key_scope_read, key_scope_build, workspace_header_forbidden, or forbidden.
404agentId is not an agent in your workspace.
409The workspace is not using its own keys.
410The customer named in Katexs-Workspace was deleted. POST /customers/{id}/restore brings it back until its erase date.
429Over a per-minute limit. Wait for Retry-After seconds. code and limit say which limit: rate_limit_resources (240 requests a minute for the workspace), rate_limit_family (2,400 across a developer's customers), rate_limit_calls, rate_limit_messages, rate_limit_codes, rate_limit_code_recipient, concurrent_calls or number_daily_limit.
502Your provider would not speak the line, could not be reached, or has no preview.

Last updated November 2026 · Found a problem? Email support@katexs.com