Cleanlab TLM Chat Completions Streaming (HTTP + SSE)
Version 1.0.0
AsyncAPI 2.6 description of the Trustworthy Language Model (TLM) **chat completion streaming** surface. Cleanlab does not publish a WebSocket API. The TLM is exposed via an OpenAI-compatible Chat Completions endpoint documented at https://help.cleanlab.ai/tlm/tutorials/tlm_chat_completion/. Point the OpenAI client `base_url` at `https://api.cleanlab.ai/api/v1/openai_trustworthy_llm/` and the client issues `POST /v1/chat/completions`. When the request body sets `stream: true`, the completion is delivered as **HTTP Server-Sent Events (SSE)** over that same REST endpoint. SSE is a one-way, server-to-client HTTP streaming channel; it is **not** WebSocket. Each streamed chunk is a JSON `chat.completion.chunk` object, identical to the OpenAI streaming schema, terminated by a `data: [DONE]` sentinel. The Cleanlab trustworthiness score is carried in `tlm_metadata` (returned on the final chunk for streamed responses). The non-streamed request body and response are modeled in the companion OpenAPI document at `openapi/cleanlab-openapi.yml`. Codex validation (`/codex/projects/{project_id}/validate`) and Cleanlab Studio inference (`/deployment/{model_id}/predict`) return single HTTP responses and are **not** streamed via SSE; they are not modeled here.
Channels
Messages
Servers
api.cleanlab.ai/api/v1/openai_trustworthy_llm/v1