Authentication
Get a Krisp API key and create short-lived session tokens for the realtime WebSocket endpoints.
Krisp APIs use two kinds of credentials:
- API key (master token): the long-lived key from your Developers Portal dashboard. Use it only on your backend, to call the Developers Portal API, for example to create session tokens.
- Session token: a short-lived key created from your API key. Use it to open the realtime WebSocket endpoints: Speech-to-Text (STT), Text-to-Speech (TTS), Voice Translation (VT) and Voice Isolation.
Do not send the master token on the WebSocket, and never ship it in a browser or mobile app. Create session tokens on your backend and give only the session token to the client.
Get your API key
- Sign up or log in at the Developers Portal.
- Go to API Keys → Create key.
- Store it as a secret on your backend, for example in the
KRISP_API_KEYenvironment variable.
For a complete example that goes from API key to live transcript, see the Quickstart.
Generate a session token
Host: https://api.developers.krisp.ai/
POST /v2/sdk/tokens/session
POST /v2/sdk/tokens/sessionCreates a session token for the product you name in usage_type.
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Your API key in the format api-key YOUR_API_KEY |
Content-Type | Yes | application/json |
Body parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
usage_type | String | Yes | The product the token is for: stt, tts, viva (Voice Isolation) or vt. |
expiration_ttl | Integer | No | Lifetime of the session token in minutes. Minimum 5, maximum 300 (5 hours). Default 180 (3 hours). For vt, the maximum is 1440 (24 hours). |
metadata.session_id | String | No | Your own identifier for the session, up to 255 characters. |
The team and user always come from the API key. They are never read from the request.
Example request
curl -X POST \
'https://api.developers.krisp.ai/v2/sdk/tokens/session' \
-H 'Authorization: api-key YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{"usage_type": "stt", "expiration_ttl": 100}'Example response
{
"code": 0,
"message": "Success",
"data": {
"session_key": "session_key_...",
"expires_at": "2026-10-01T15:40:00.000Z",
"key_id": 123,
"status": "LICENSE_VALID",
"type": "session",
"usage_type": "stt"
},
"req_id": "..."
}Response attributes
| Field | Type | Description |
|---|---|---|
code | Integer | 0 on success. |
message | String | Success. |
data.session_key | String | The session token. Use it as the API key when opening the WebSocket. |
data.expires_at | String | When the session token expires (ISO 8601, UTC). |
data.key_id | Integer | ID of the API key the session token was created from. |
data.status | String | Status of the session token. |
data.type | String | Always session. |
data.usage_type | String | The product the token is scoped to. |
req_id | String | Request ID. Include it if you contact Krisp support. |
Errors
Errors use this shape:
{
"code": 1,
"error_code": "AUTH_API_KEY_INVALID",
"message": "...",
"req_id": "..."
}| HTTP status | error_code | Meaning |
|---|---|---|
| 400 | VALIDATION_ERROR | usage_type is missing or unknown, or expiration_ttl is out of range. |
| 401 | AUTH_HEADER_MISSING | The Authorization header is missing or is not in the api-key YOUR_API_KEY format. |
| 401 | AUTH_API_KEY_INVALID | The API key is invalid, paused, suspended, or not attached to a team. |
| 401 | AUTH_API_KEY_EXPIRED | The API key has expired. |
| 401 | AUTH_NO_LICENSE | The API key is not assigned to a license. |
| 403 | PRODUCT_NOT_ALLOWED | Your team does not have access to the requested product. |
| 403 | PAYMENT_PAST_DUE | An invoice payment failed and the grace period has expired. |
| 403 | BALANCE_EXHAUSTED | Your prepaid credit balance is used up. |
| 403 | SPEND_CAP_REACHED | Your monthly spending limit is reached. |
| 403 | USAGE_LIMIT_EXCEEDED | stt, tts or viva: your team used the minutes its contract allows for this product. |
| 403 | VT_USAGE_LIMIT_EXCEEDED | vt only: your team used its allowed Voice Translation hours. |
| 502 | CACHE_UNAVAILABLE | The token could not be stored. It is safe to retry. |
The billing errors (PAYMENT_PAST_DUE, BALANCE_EXHAUSTED, SPEND_CAP_REACHED) are returned only when usage checks are enabled for your account.
The simultaneous-sessions limit is checked when the WebSocket opens (concurrency_limit_exceeded), not here.
Use the session token on the WebSocket
Use the returned session token as the API key when opening the WebSocket. Send it in the Authorization header of the handshake, with the api-key scheme:
Authorization: api-key SESSION_TOKENIf your client cannot set headers on a WebSocket handshake (for example, browsers), pass the same value as the authorization query parameter instead, URL-encoded:
wss://streaming.krisp.ai/stt?authorization=api-key%20SESSION_TOKENCreate a session token for each product you use: usage_type stt, tts, viva or vt for /stt, /tts, /voice-isolation and /vt. See Voice Translation (VT) for the VT details. Create a new token before the current one expires. If the token is missing, malformed or expired, the server closes the connection with one of the errors below. See the API overview for the full list.
code | HTTP status | Meaning |
|---|---|---|
missing_authorization_header | 401 | No Authorization header or authorization query parameter was sent. |
invalid_api_key | 401 | The Authorization value does not use the api-key scheme. |
unauthorized | 403 | The session token is not valid or has expired. |
Example (Python)
import requests
import websockets
API_KEY = "YOUR_API_KEY" # backend only
resp = requests.post(
"https://api.developers.krisp.ai/v2/sdk/tokens/session",
json={"usage_type": "stt", "expiration_ttl": 100},
headers={"Authorization": f"api-key {API_KEY}"},
)
resp.raise_for_status()
SESSION_TOKEN = resp.json()["data"]["session_key"]
async def connect():
headers = {"Authorization": f"api-key {SESSION_TOKEN}"}
return await websockets.connect("wss://streaming.krisp.ai/stt", additional_headers=headers)Updated 3 days ago

