Turn BYOK On or Off

Bring your own keys

Turn BYOK On or Off

Switches your workspace onto your own keys, or back onto ours, and/or chooses what you bring (scope). Scope all needs all three keys — speech-to-text, LLM and voice — added, verified and each with a model chosen; scope voice needs only the voice key, and speech-to-text, the LLM and telephony stay ours; scope llm needs only the LLM key, and speech-to-text and the voice stay ours (calls are billed on the normal voice plan, whatever your model); scope llm_voice needs the LLM key and the voice key, and our speech recogniser stays (a call is a flat $0.012/min like all). scope is the default for your agents: any agent may follow it, be switched off, or choose another scope your keys allow (Update Agent byok). Any plan may turn it on. On a developer's workspace, turning it off turns it off for every customer using your keys, and a customer inherits your scope. Needs a full key.

PATCH/byok

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

enabledboolean
true to run on your own keys, false to run on ours.
scopestring
all — all three of your keys; voice — only your voice key; llm — only your language-model key (we keep the speech recogniser and the voice, and calls stay on the normal voice plan); llm_voice — your language-model key and your voice key (we keep the speech recogniser; a flat $0.012/min). Changing it while on needs the new scope's keys complete. One of: all, voice, llm, llm_voice.

Example request

bash
curl -X PATCH "https://app.katexs.com/api/v1/byok" \
  -H "Authorization: Bearer $KATEXS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "enabled": true,
  "scope": "voice"
}'

Responses

StatusDescription
200The workspace's BYOK state after the change.
400enabled is not a boolean, scope is not all, voice, llm or llm_voice, or neither was sent.
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.
404The Katexs-Workspace header names a workspace that is unknown, is not one of your customers, or is not an org_… id. Always this one sentence, so a key cannot learn which ids exist in other accounts.
409Refused: a key the scope needs is missing, unverified or has no model (turning on, or changing scope while on).
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.

Response fields

enabledbooleanrequired
Whether this workspace has switched its own keys on.
scopestringrequired
What this workspace brings: all — speech-to-text, LLM and voice keys (a call is $0.012/min all-in, a chat reply at the own-key reply price); voice — only the voice key, with our speech-to-text, model and telephony (a call is billed at the voice-only BYOK rate, replies as usual); llm — only the language-model key, with our speech-to-text and voice (a call is billed on the same Premium or Studio voice plan as any call, a chat reply at the own-key reply price); llm_voice — the language-model key and the voice key, with our speech recogniser (a call is a flat $0.012/min like all, no model limit, a chat reply at the own-key reply price). It is the default for your agents; an agent may choose its own (byok on the agent). all unless changed. One of: all, voice, llm, llm_voice.
usingScopestring | nullrequired
The scope that applies right now — a customer inheriting runs on its developer's scope — or null when no keys apply. One of: all, voice, llm, llm_voice.
usingstringrequired
Whose keys calls and replies use right now: this workspace's, its developer's (a customer inheriting them), or none. One of: own, developer, none.
completebooleanrequired
Whether this workspace's own keys for its scope are verified and each has a model — what turning BYOK on needs (all three under all, the voice key under voice, the LLM key under llm, the LLM and voice keys under llm_voice).
credentialsobject[]required
This workspace's own keys, masked.
200 response
{
  "enabled": true,
  "scope": "all",
  "usingScope": "all",
  "using": "own",
  "complete": true,
  "credentials": [
    {
      "kind": "stt",
      "provider": "deepgram",
      "label": "Deepgram",
      "key": "…k9z2",
      "fields": {
        "model": "nova-3-general"
      },
      "model": "nova-3-general",
      "models": [
        "flux-general-en",
        "nova-3-general",
        "nova-2-general"
      ],
      "verifiedAt": "2026-10-06T10:00:12.441Z",
      "updatedAt": "2026-10-06T10:00:12.441Z"
    },
    {
      "kind": "llm",
      "provider": "openai",
      "label": "OpenAI",
      "key": "…Qw7m",
      "fields": {
        "model": "gpt-5.4-nano"
      },
      "model": "gpt-5.4-nano",
      "models": [
        "gpt-5.4",
        "gpt-5.4-mini",
        "gpt-5.4-nano"
      ],
      "verifiedAt": "2026-10-06T10:01:40.902Z",
      "updatedAt": "2026-10-06T10:01:40.902Z"
    },
    {
      "kind": "tts",
      "provider": "elevenlabs",
      "label": "ElevenLabs",
      "key": "…3c1d",
      "fields": {
        "model": "eleven_flash_v2_5"
      },
      "model": "eleven_flash_v2_5",
      "models": [
        "eleven_flash_v2_5",
        "eleven_multilingual_v2"
      ],
      "verifiedAt": "2026-10-06T10:02:05.117Z",
      "updatedAt": "2026-10-06T10:02:05.117Z"
    }
  ]
}

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