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.
The completed AI response, including the generated message, finish reason, and token usage.
Stream a chat completion
Streams a chat completion over Server-Sent Events. Emits message_delta,
message_complete, tool_call_*, tool_result, and a terminal done (or
error) event. Same request shape as the non-streaming completion endpoint;
the app must have the llm_calls entitlement.
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.
Server-Sent Events stream
Create a chat completion Sends a list of messages to the configured AI provider and returns a single completion. Use this endpoint when you want direct, low-level access to the underlying model without any workflow or agent orchestration. The authenticated app must have the
llm_callsentitlement enabled on its plan. Requests that exceed the plan quota are rejected with402. Token usage is recorded against the authenticated app and organization. Supplytoolsandtool_choiceto enable OpenAI-compatible function calling. Useserver_toolsto activate platform-managed tools such as search that run on the server side before the response is returned.