Add BYOK Key

Bring your own keys

Add BYOK Key

Adds or replaces your key for one job. The key is checked with the provider before anything is stored — a key the provider rejects is not saved — then stored encrypted and only ever shown by its last four characters. The provider's model list is pulled at the same time. Without credentials.model, a speech key starts on the provider's usual model and an LLM key on its usual one where it has one; replacing a key with one for the same provider keeps the model already chosen. Needs a full key.

PUT/byok/credentials

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

kindstringrequired
The job this key does: speech-to-text, LLM or voice. One of: stt, llm, tts.
providerstringrequired
Who does the job. Speech-to-text: deepgram, assemblyai, soniox, speechmatics, gladia, sarvam, elevenlabs, cartesia, openai, groq, mistral, azure. LLM: openai, anthropic, google, groq, mistral, sarvam, deepseek, xai, together, fireworks, cerebras, openrouter, openai_compatible. Voice: deepgram, elevenlabs, cartesia, openai, sarvam, soniox, mistral, azure, rime, inworld, hume, murf, speechify. A provider that does not do the job is refused with the list that does. One of: deepgram, assemblyai, soniox, speechmatics, gladia, sarvam, elevenlabs, cartesia, openai, groq, mistral, azure, rime, inworld, hume, murf, speechify, anthropic, google, deepseek, xai, together, fireworks, cerebras, openrouter, openai_compatible.
credentialsobjectrequired
The provider's fields. Every provider takes apiKey and an optional model; azure also takes region and optionally endpoint; openai_compatible also takes baseUrl. Any other field is refused.
credentials.apiKeystringrequired
The key, as the provider gave it. Stored encrypted; only its last four characters are ever shown.
credentials.modelstring
The model to run, from the provider's list for this key. Left out, the provider's usual model where it has one. Refused for a speech provider with no model to choose.
credentials.regionstring
azure only, required: the resource's region, e.g. centralindia.
credentials.endpointstring (uri)
azure only, optional: the resource's own https address on cognitiveservices.azure.com, openai.azure.com or services.ai.azure.com — for a resource (such as an AI Foundry one) that accepts its key only there.
credentials.baseUrlstring (uri)
openai_compatible only, required: the API's https base address, e.g. https://api.together.xyz/v1. If the server lists no models, send model too and the two are checked together.

Example request

bash
curl -X PUT "https://app.katexs.com/api/v1/byok/credentials" \
  -H "Authorization: Bearer $KATEXS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "kind": "llm",
  "provider": "openai",
  "credentials": {
    "apiKey": "sk-proj-4fT9xQ2mLr8Vw1Zc7Kb3Nh6Yd0Pe5Gs9Qw7m",
    "model": "gpt-5.4-mini"
  }
}'

Responses

StatusDescription
200The key as stored, masked.
400A field is missing or malformed, the provider rejected the key, or it does not offer the model on 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.
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.
409BYOK is on and this key would leave the job without a model it reaches.
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.
502The provider could not be reached to check the key. Nothing was stored; try again.

Response fields

kindstringrequired
Its job: speech-to-text, LLM or voice. One of: stt, llm, tts.
providerstringrequired
The provider's id, e.g. deepgram.
labelstringrequired
The provider's name as the console shows it.
keystringrequired
The key's last four characters after … — never more.
fieldsobjectrequired
The key's other settings, as stored: model, region, endpoint or baseUrl. The secret is never among them.
modelstring | nullrequired
The model this key runs, or null while one is still to be chosen (or for a provider with no model to choose, such as Azure Speech).
modelsstring[]required
What the provider offered this key when it was added or last refreshed.
verifiedAtstring (date-time) | nullrequired
When the provider last accepted the key.
updatedAtstring (date-time)required
When the key or its model last changed.
200 response
{
  "kind": "llm",
  "provider": "openai",
  "label": "OpenAI",
  "key": "…Qw7m",
  "fields": {
    "model": "gpt-5.4-mini"
  },
  "model": "gpt-5.4-mini",
  "models": [
    "gpt-5.4",
    "gpt-5.4-mini",
    "gpt-5.4-nano",
    "gpt-4.1-mini"
  ],
  "verifiedAt": "2026-10-06T10:01:40.902Z",
  "updatedAt": "2026-10-06T10:01:40.902Z"
}

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