Braintrust · AsyncAPI Specification
Braintrust Streaming (SSE) API
Version 1.0
AsyncAPI description of Braintrust's documented HTTP Server-Sent Events (SSE) streams. Braintrust does NOT expose a WebSocket API. Streaming is delivered as one-way HTTP SSE over the same REST endpoints when the request body sets `stream: true`: streaming function invocation and the OpenAI-compatible AI proxy chat completions endpoint. This document models those SSE streams; it must not be read as describing a WebSocket transport.
Channels
/v1/proxy/chat/completions
Receive streamed chat completion chunks over SSE.
OpenAI-compatible chat completions over the AI proxy. When the request sets stream=true, the response is an SSE stream of completion chunks terminated by a `data: [DONE]` event.
/v1/function/{function_id}/invoke
Receive streamed function invocation events over SSE.
Server-side function invocation. When the request sets stream=true, the function result is delivered as an SSE stream of progress and result events.
Messages
ChatCompletionChunk
Chat Completion Chunk (SSE data event)
One SSE `data:` event carrying a partial chat completion delta.
FunctionInvokeEvent
Function Invoke Event (SSE data event)
One SSE `data:` event carrying a chunk of the function invocation result.
Servers
https
production
api.braintrust.dev
Braintrust US data plane. SSE streams are delivered over HTTPS POST requests with stream=true; this is HTTP Server-Sent Events, not WebSocket. EU data plane is api-eu.braintrust.dev.