Skip to content

Protocol Model

Endpoints and TLS

ChannelDefault external SDK URLPlaintext compatibility URL
Assethttps://sdk-runtime.localhost:18082http://127.0.0.1:17082
Command WSwss://sdk-runtime.localhost:18090ws://127.0.0.1:17090
Video WSwss://sdk-runtime.localhost:18091ws://127.0.0.1:17091

The external SDK enables SDK_TLS_ENABLED=1 by default and maps sdk-runtime.localhost to 127.0.0.1. The default TLS ports are 18082, 18090, and 18091. Clients must trust the server certificate or its issuing CA; plaintext endpoints are for compatibility scenarios only. See Connectivity for TLS settings and certificate-chain and private-key requirements.

Command WS

Default external SDK URL:

text
wss://sdk-runtime.localhost:18090

Command WS carries JSON requests and responses. The handshake URL does not include API keys, session tokens, or business parameters.

For a custom TLS deployment, use wss://<tls-host>:18090, where <tls-host> must match the server certificate. With either ws or wss, clients submit the API key after connection through auth.create_session.

Request

json
{
  "request_id": "req-001",
  "method": "system.ping",
  "params": {},
  "client": {
    "source": "your-app",
    "protocol_version": "2.0.0",
    "trace_id": "trc-001"
  }
}
FieldTypeRequiredDescription
request_idstringYesClient-generated request ID
methodstringYesTarget method name
paramsobjectNoMethod parameters; omitted value is treated as an empty object
clientobjectNoSource, protocol version, trace metadata, and diagnostics

Response

json
{
  "request_id": "req-001",
  "code": 0,
  "message": "ok",
  "data": {},
  "ts": 1710000000
}
FieldTypeDescription
request_idstringMatching request ID
codenumberStable status code. 0 means success
messagestringShort message
dataobjectMethod result data
tsnumberServer timestamp

Event

Server-pushed events use a separate envelope:

json
{
  "event": "video.ready",
  "code": 0,
  "message": "ok",
  "payload": {
    "stream_id": "stream-1"
  },
  "ts": 1710000000
}

Video WS

Default external SDK URL:

text
wss://sdk-runtime.localhost:18091?session_token=<session-token>&stream_id=<stream-id>

Video WS query parameters:

ParameterDescription
session_tokenConnection-bound session token returned by video.start
stream_idStream ID returned by video.start

After connection, the server sends:

  • video.ready text event
  • one stream.frame_meta text event per frame
  • one MJPEG/JPEG binary frame per frame

Video WS is output-only. Clients should keep all control commands on Command WS.

For a custom TLS hostname, use:

text
wss://<tls-host>:18091?session_token=<session-token>&stream_id=<stream-id>

session_token and stream_id are required Video WS query parameters with both ws and wss.

Common Error Codes

CodeNameCommon Cause
1000INVALID_REQUESTRequest is not a valid JSON object
1001INVALID_METHODmethod is missing or invalid
1002INVALID_PARAMSRequired params are missing
1003UNSUPPORTED_METHODMethod is not public or not implemented
1004RATE_LIMITEDCapture interval has not elapsed; data.retry_after_ms in a capture.take response gives the suggested delay
1100AUTH_REQUIREDNo bound session exists
1101TOKEN_INVALIDAPI key is invalid
1103SESSION_TOKEN_INVALIDSession token is invalid
1105DEVICE_NOT_IN_AUTH_SCOPEDevice is outside the authorized scope
1107CAPABILITY_NOT_ALLOWEDThe session lacks the target method capability, or the parameter-level feature exceeds the current entitlement tier
1110USAGE_LIMIT_EXCEEDEDQuota exceeded; the shared trial quota for restricted features has been exhausted
1200DEVICE_NOT_FOUNDDevice does not exist
1201DEVICE_BUSYDevice is occupied by a conflicting operation; for capture, a physical capture action is executing
1203DEVICE_NOT_OPENDevice is not open
1300STREAM_NOT_FOUNDStream does not exist or is already closed
1901PROVIDER_NOT_READYProvider is not ready
1902PROVIDER_CALL_FAILEDProvider call failed

For more information, see Error Codes.

CZUR Open Platform Documentation