Overview

Krisp's speech models as realtime WebSocket endpoints: authentication, the session protocol, message limits and common errors.

The Krisp API gives you Krisp's speech models as realtime WebSocket endpoints. You open one WebSocket connection per session, describe the session in a JSON message, then stream audio or text and receive results on the same connection as they are produced.

Endpoints

EndpointWhat it doesPage
wss://streaming.krisp.ai/sttSpeech-to-Text: stream audio, receive transcriptsSpeech-to-Text (STT)
wss://streaming.krisp.ai/ttsText-to-Speech: stream text, receive synthesized audioText-to-Speech (TTS)
wss://streaming.krisp.ai/vtVoice Translation: stream speech, receive translated speechVoice Translation (VT)
wss://streaming.krisp.ai/voice-isolationVoice Isolation: stream noisy audio, receive cleaned audioVoice Isolation

Region and latency

The Krisp API currently runs in the US region. This applies to all endpoints: Speech-to-Text, Text-to-Speech, Voice Translation and Voice Isolation. You can connect from anywhere, but clients outside the US see extra network latency, which grows with the distance from the US. For the lowest latency, connect from servers in or near the US.

Authentication

The STT, TTS and Voice Isolation endpoints authenticate with a session token that your backend generates from your Krisp API key. See Authentication for how to generate one; do not send your API key (master token) on the WebSocket. Voice Translation uses the same session tokens, with usage_type vt. Send the session token in the Authorization header of the WebSocket handshake, using the api-key scheme (case-insensitive, so Api-Key also works):

Authorization: api-key SESSION_TOKEN

If 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_TOKEN

If authentication fails, the server sends an error message (see below) and closes the connection with close code 1008.

Session protocol

All endpoints follow the same flow:

  1. Connect to wss://streaming.krisp.ai/<endpoint> with your session token.
  2. Send the client hello. The first message must be a JSON text message that configures the session (each endpoint page documents its fields). It must arrive within 15 seconds of connecting.
  3. Wait for the server hello. The server answers with either a ready message (session started) or an error message, after which it closes the connection.
  4. Stream. After ready, send binary audio frames and/or JSON text messages, as described on the endpoint page. Results arrive on the same connection.
  5. Close the WebSocket when you are done.

Each message you send after the hello must be at most 65,536 bytes (64 KB). Larger messages are rejected with the chunk_too_large error and the connection is closed.

ready: GatewayServerHello

The first response sent by the server to the client. Successful handshake response format.

FieldTypeRequiredDefaultDescription
typestringno"ready"Response type
request_idstring | nullnonullRequest ID if available
tracks_msarray of integer | nullnonullDelays in ms of the decoders producing partial results. Each partial word's src is one of these values.
metadataobject | nullnonullUser-provided metadata, echoed back. Omitted entirely when the service's ClientHello carries no metadata field.

Fields with a null value are omitted from the message. Some endpoints add their own fields to ready; see each endpoint page. Keep request_id: it identifies the session if you contact Krisp support.

{"type": "ready", "request_id": "3f2a9c1e-7b4d-4c2a-9e51-0d6f8a2b7c90", "metadata": {"call_id": "abc-123"}}

error: ErrorResponse

Error response schema following the standard format.

FieldTypeRequiredDefaultDescription
typestringno"error"Response type
request_idstring | nullnonullRequest ID if available
errorErrorInfoyesError information

ErrorInfo

Error information structure.

FieldTypeRequiredDefaultDescription
codestringyesError code identifier
status_codeintegeryesHTTP status code
messagestringyesHuman-readable error message
detailsobject | nullnonullOptional error details (e.g., {'hint': '...'})

After sending an error message, the server closes the WebSocket. The close reason is the same as error.message.

{
  "type": "error",
  "request_id": "3f2a9c1e-7b4d-4c2a-9e51-0d6f8a2b7c90",
  "error": {
    "code": "invalid_client_hello",
    "status_code": 400,
    "message": "Invalid ClientHello: sample_rate: Input should be less than or equal to 16000",
    "details": {
      "hint": "Check documentation for the correct ClientHello message format",
      "errors": [{"field": "sample_rate", "message": "Input should be less than or equal to 16000"}]
    }
  }
}

Common errors

These errors can occur on every endpoint. Endpoint-specific errors are listed on each endpoint page.

error.codestatus_codeWebSocket close codeMeaning
missing_authorization_header4011008No Authorization header or authorization query parameter was sent.
invalid_api_key4011008The Authorization value does not use the api-key scheme.
unauthorized4031008The session token or API key is not valid, or has expired.
client_hello_timeout4081008No client hello was received within 15 seconds of connecting.
invalid_client_hello4001003 / 1008The first message was binary (1003), or it was not valid JSON or failed validation (1008). details.errors lists each invalid field as field / message.
internal_server_error5001008 / 1011The session could not be created. Retry after a few seconds.
upstream_connection_failed5001011The model could not be reached. Retry after a few seconds.
upstream_initialization_failed5001011The model rejected or failed to start the session. Retry after a few seconds.
chunk_too_large4131009A message was larger than 65,536 bytes.
service_shutting_down5031012The server instance is restarting. Reconnect to start a new session.
concurrency_limit_exceeded4031008Your team reached the maximum number of simultaneous sessions allowed on its plan.

Changelog

  • 2026-10-01: Voice Translation authentication now points to its own session token endpoint.
  • 2026-10-01: Authentication now uses a session token; see Authentication.
  • 2026-10-01: Page created: endpoints, authentication, session protocol, common errors.

Did this page help you?