API reference · WebSocket

Stream events over SSE

GET/v1/stream/sse

The same stream as the WebSocket over Server-Sent Events, for networks that block WebSockets.

On this page

Auth. None. Without a token the call is served as Free (the Free delay and request budget, shared per IP); send Authorization: Bearer lb_… for your plan's.

Limits. Counts toward your plan's concurrent streams, WebSocket and SSE together (1, 5 or 20). Served at your plan's delay (+60 s Free, +10 s Builder, +2 s Standard).

Parameters

Query parameters

NameTypeRequiredDescription
eventsstringnoComma-separated event ids (ev_…).
phrasesstringnoComma-separated phrase keys.
typesstringnoComma-separated event types.
subjectsstringnoComma-separated typed-fact subjects.
contextstringnoContext kinds to opt in to: on_air, topic, near_miss, typed or all.

Request

Terminal
curl -N -H "Authorization: Bearer $LANGBOT_API_TOKEN" \
  "https://api.langbot.ai/v1/stream/sse?phrases=tariff&types=phrase_detected"

Response

200 OK

event: hello
data: {"type":"hello","seq":9032,"delay_ms":60000,"plan":"anonymous","effective_plan":"free",…}

event: phrase_detected
data: {"id":"evt_01M6…","type":"phrase_detected","phrase":"tariff",…}

text/event-stream: the event type is the SSE event: and the JSON is data:; keep-alives are SSE comments (: ping).

Errors

StatuscodeWhen
401token_invalidA token was sent and not recognised. Send a valid one, or none to call anonymously.
422validation_errorA parameter failed validation; detail[].loc names it.
429rate_limitedOver your request budget; wait Retry-After seconds.

Every error body is {"detail": …, "code": "…"}; branch on code. All codes: Errors.