Set Agent BYOK Voice

Agents

Set Agent BYOK Voice

Chooses the voice this agent speaks with on your own voice provider: an id from List BYOK Voices, checked against the provider's list for your key, or null for the provider's default. On Cartesia an id that is not on the list yet, such as a voice cloned a moment ago, is checked with Cartesia directly and accepted if your key owns it. The agent needs a voice channel first. A build key may do this.

PUT/agents/{id}/byok-voice

Chooses the voice this agent speaks with on your own voice provider: an id from List BYOK Voices, checked against the provider's list for your key, or null for the provider's default. On Cartesia an id that is not on the list yet, such as a voice cloned a moment ago, is checked with Cartesia directly and accepted if your key owns it. The agent needs a voice channel first. A build key may do this.

On a Cartesia key you can also set how this agent's voice sounds: speed (0.6 to 1.5), volume (0.5 to 2.0), emotion (one of Cartesia's values; English only), model (sonic-3.6, sonic-3.6-2026-08-27, sonic-3.5, sonic-3 or sonic-2 for this agent alone; sonic-3.6 follows Cartesia's latest stable snapshot, the dated one never changes) and pronunciationDictId (a dictionary id from your Cartesia account). Every field is optional and the request only changes what it names: a key left out stays as it is, null goes back to the default, a value sets it. So { "voice": "…" } alone changes the voice and keeps the settings; { "voice": null } goes back to the provider's default voice and clears them. The settings belong to a voice of the agent's own: sending one before a voice is chosen, or with voice: null, is refused. speed, volume and emotion need a Sonic 3 model, and speed does not apply to a Cartesia Professional Voice Clone. A refused field answers 400 with code: validation_failed and field naming it.

Path parameters

idstringrequired
The agent's id (ag_…), as List Agents returns it. Another workspace's agent is the same 404 as one that never existed.

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

voicestring | null
A voice id from List BYOK Voices, or null for the provider's default (which clears the settings below).
speednumber | null
Cartesia only. How fast the voice speaks; 1 is Cartesia's own. Needs a Sonic 3 model. Does not apply to a Professional Voice Clone. Range: 0.6–1.5.
volumenumber | null
Cartesia only. How loud the voice is; 1 is Cartesia's own. Needs a Sonic 3 model. Range: 0.5–2.
emotionstring | null
Cartesia only. One of Cartesia's emotions, for example neutral, calm, content, sad, angry, scared, happy, excited. Works in English only. Needs a Sonic 3 model.
modelstring | null
Cartesia only. The Sonic model this agent speaks on; null uses your key's model. One of: sonic-3.6, sonic-3.6-2026-08-27, sonic-3.5, sonic-3, sonic-2.
pronunciationDictIdstring | null
Cartesia only. The id Cartesia gave a pronunciation dictionary in your account; null for none.

Example request

bash
curl -X PUT "https://app.katexs.com/api/v1/agents/{id}/byok-voice" \
  -H "Authorization: Bearer $KATEXS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "voice": "EXAVITQu4vr4xnSDxMaL"
}'

Responses

StatusDescription
200The voice saved on the agent, with the provider it belongs to, and its settings (null while unset). The voice and provider are null after choosing the default.
400Nothing to change was sent, voice is not a voice id or not one your provider offers your key, or a setting is out of range (field names it).
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.
404No such agent in your workspace.
409The workspace is not using its own voice key (it brings no keys, or only its language model), this agent is set to byok: "off", or the agent has no voice channel yet.
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 voice provider could not list its voices for your key.

Response fields

voicestring | nullrequired
The voice saved, or null for the provider's default.
providerstring | nullrequired
The provider id the voice belongs to, or null with the default.
speednumber | null
Cartesia only: the speed now saved, or null.
volumenumber | null
Cartesia only: the volume now saved, or null.
emotionstring | null
Cartesia only: the emotion now saved, or null.
agentModelstring | null
Cartesia only: the Sonic model now saved for this agent (the request's model), or null.
pronunciationDictIdstring | null
Cartesia only: the dictionary id now saved, or null.
200 response
{
  "voice": "a0e99841-438c-4a64-b679-ae501e7d6091",
  "provider": "cartesia",
  "speed": 0.95,
  "volume": 1.4,
  "emotion": null,
  "agentModel": null,
  "pronunciationDictId": null
}

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