Access and API keys
Get a key bound to Inference, and give each integration only what it needs.
Inference isn't enabled on every workspace. If it isn't on yours, ask us to
turn it on — until it is, requests fail with 403 entitlement_required.
Create an Inference key from Settings → API keys (choose Kejue Inference), or use
POST /v1/inference/api-keys with an authorized Inference management credential.
Send an Idempotency-Key for API-key creation. The response shows key once.
Authorization: Bearer kejue_<prefix>_<secret>Voice keys, including existing wildcard keys, cannot call Inference. Inference
keys cannot call Voice endpoints. Key format alone does not determine product;
the product binding is stored with the credential. A mismatch returns
403 api_key_product_mismatch. Existing Voice credentials keep their current
Voice behavior. Connected-app OAuth tokens do not grant Inference access.
Manage keys
GET /v1/inference/api-keys lists safe metadata, newest keys first. Follow
next_cursor until it is null to read the complete list. All key operations
stay within the active workspace and product; reads never return the secret.
Read one key with GET /v1/inference/api-keys/{id}. Its strong ETag changes
when last_used_at or other returned metadata changes. For conditional
revocation, send its current ETag in If-Match with
DELETE /v1/inference/api-keys/{id}. Send no request body. Repeating the
revocation is safe; metadata remains available for auditing.
Supplied scopes are normalized and cannot exceed your own permissions.
Give the key only what it needs
| Permission | Allows |
|---|---|
inference-models:read | Discover published model names |
inference-voices:read | Discover approved voices and play cached samples |
inference-tts:create | Generate speech and open live speech sessions |
inference-stt:create | Transcribe short files, create/resume uploads and file jobs, cancel remaining work, and open live sessions |
inference-stt:read | Read file-job metadata and retrieve retained transcript content under workspace sensitive-data policy |
inference-stt:delete | Cancel and delete retained job content |
inference-usage:read | Read balances, usage, and request status |
inference-api-keys:read / create / delete | Manage Inference keys |
POST /v1/inference/realtime-tokens checks the permission for the model's kind:
inference-stt:create for a speech-to-text model, inference-tts:create for a
TTS model.
WebSocket authentication
| Client | How to connect |
|---|---|
| Your backend | Send Authorization: Bearer INFERENCE_API_KEY in the WebSocket handshake and configuration in query parameters. No token request is needed. |
| Browser or mobile frontend | Your backend mints a one-use token and returns it to the authenticated frontend. Connect with ?token=TOKEN. |
Start with the direct backend examples for live speech or live transcription. Before the upgrade, we check credentials, session options, permissions, and available credit. Each direct connection creates a new session and reserves credit (a character budget for speech, minutes for transcription) and concurrency.
For a browser, have your backend call POST /v1/inference/realtime-tokens
with your Inference key and the session options. Return its url and token
to your frontend. The browser can then connect using its native WebSocket API:
// Your own authenticated backend route mints the token.
const response = await fetch("/api/inference-session", { method: "POST" });
if (!response.ok) throw new Error("Could not create a speech session");
const session = await response.json();
const url = new URL(session.url);
url.searchParams.set("token", session.token);
const socket = new WebSocket(url);Tokens expire after 30 seconds and are consumed on the first connection attempt. Mint a fresh one for every reconnect. Do not combine a token with an Authorization header or additional configuration parameters. Keep long-lived keys on your backend; never put them in browser code or WebSocket URLs.
Each successful token request returns a fresh token. Minting it does not reserve credit or concurrency; reservations start when the WebSocket connects. The dashboard can mint tokens with your authorized sign-in session; integrations mint them on the backend with an Inference key.
Keep credentials on your backend
Give each integration its own key, the scopes it needs, and an expiry.
Inference keys accept only Inference permissions or *. Keep long-lived keys
out of browser code and URLs.
We check workspace access, key revocation and expiry, and the creator account before execution. For a long-running request, we check again every 15 seconds. Disabling access, revoking the key, or unpublishing its model cancels work at the next check. Audio already consumed is still chargeable.
File-job content access
Transcription create, read and delete permissions are separate. Usage access
alone never grants transcript access, and a scoped usage viewer does not
automatically receive the new content-read permission. Give integrations only
the explicit scopes they need. An upload and job always belong to the active
workspace; unknown and cross-workspace IDs have the same 404 response.
File jobs survive closing a browser and ordinary session expiry. Revoking a key, membership or workspace access stops new work; service workers do not reuse an expired browser cookie to keep processing.
Reading a result decrypts sensitive content through an audited API. Workspace
open, reason and approval policies apply. Supply a written reason when
required. In approval mode, dashboard users use Studio's access prompt to
request access to that specific transcription job. An approver decides in
Settings → Access requests. A grant is scoped to its subject and expires
according to workspace policy. An Inference integration key needs explicit
transcription read permission and follows the API-key reason policy.
Signed part URLs grant only a short-lived PUT to one exact part and checksum. They grant no object reads, listing or result access. Never send your API key or browser cookies with a storage PUT, and never put a long-lived key in a URL.