Request body.
Optionalcontext?: Record<string, unknown>Key-value map used to resolve template variables in message content. Omit if messages contain no templates.
Ordered list of conversation messages to send to the model.
Model and sampling configuration for this request.
Optionalsession_id?: stringOptional UUID grouping this and other completions under one session in the Developers dashboard. Pass the same value across requests to link them; omit to auto-generate a per-request session.
Server-Sent Events stream
Stream a chat completion Streams a chat completion over Server-Sent Events. Emits
thinking_deltafor supported reasoning models,message_delta,message_complete,tool_call_*,tool_result, and a terminaldone(orerror) event. Same request shape as the non-streaming completion endpoint; the app must have thellm_callsentitlement.