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 fromPOST /customers. Leave it out to act in your own workspace. Refused with404(Workspace not found.) when the id is unknown, is not one of your customers, or is not anorg_…id;410when that customer was deleted (restore it withPOST /customers/{id}/restoreuntil it is erased);403when the key belongs to one customer workspace (it cannot act as another);400when your workspace is not a developer workspace./customers/*andGET /customers/usageare your own workspace's and refuse the header with400: 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 nolanguage. - textstring
- The line to speak, up to 200 characters. Left out, a short greeting of ours.
- languagestring
- A language tag such as
hi-INoren, 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
| Status | Description |
|---|---|
200 | The spoken line. audio/mpeg from most providers; audio/wav from some (Sarvam). Cacheable privately for an hour. |
400 | voice, text or language is missing or malformed. |
401 | The key is missing, wrong or revoked. The answer is always the same, whichever it is. |
403 | The 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. |
404 | agentId is not an agent in your workspace. |
409 | The workspace is not using its own keys. |
410 | The customer named in Katexs-Workspace was deleted. POST /customers/{id}/restore brings it back until its erase date. |
429 | Over 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. |
502 | Your 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
