Create Chat Completion
Creates a chat completion using the agent’s configured model. Supports both streaming and non-streaming responses.
Authentication
Headers
W3C Trace Context parent. When present, the Agent continues this trace for the request. Applies to all /api/v1 endpoints.
Request
Output-token cap for this request. An API key may set this above the agent’s Max Output Tokens. The value cannot exceed the model’s maximum. Requests without an API key keep the agent’s Max Output Tokens.
Chat messages in OpenAI format. Required when prompt is omitted.
User text to complete. Required when messages is omitted.
OpenAI-compatible function tool definitions. Passed through to the model as declaration-only tools (the client executes them and returns role=tool messages).
Response headers
W3C traceresponse for the server span (00-{trace-id}-{span-id}-{flags}). Present on all /api/v1 responses.