[Deprecated] Chat completions for OpenAI SDK/client usage
Deprecated: Use the Responses API (/api/v1/llm/responses) instead. OpenAI-compatible chat completion endpoint designed for use with the official OpenAI client libraries (Python, Node.js, etc.). Supports both streaming and non-streaming requests by setting the stream parameter. This endpoint handles the request/response directly and returns standard OpenAI-formatted responses. Use this when integrating with existing OpenAI client code. Note: The actual handler is registered at the Bun server level for optimal performance with the OpenAI SDK streaming format.
Authorizations
Body
Request parameters for creating a chat completion. Based on the OpenAI Chat Completions API.
The maximum number of tokens that can be generated in the chat completion. The total length of input tokens and generated tokens is limited by the model's context length. The same setting as max_completion_tokens; if both are sent they must be equal. Null is the same as omitting it.
1 <= x <= 9007199254740991Response
Successful chat completion response. Returns JSON for non-streaming (stream=false) or Server-Sent Events for streaming (stream=true).
Represents a chat completion response from the API
Where the completion was served, as reported by the serving upstream (the x-mka1-serving-location response header) or, failing that, the single location the model's registry card declares. Null when neither is known, which is the case for externally hosted models.