Overview
TheChatRequest schema defines the structure for sending chat completion requests to the LLM Gateway. It includes message history, model configuration, and generation parameters.
Schema Definition
Array of message objects representing the conversation history.
Optional model identifier. If not specified, the gateway will select an appropriate model based on the request.
Optional hint to guide model selection. Can be used to specify preferences like model family or capabilities.
Maximum number of tokens to generate in the completion. Controls the length of the response.
Sampling temperature between 0 and 2. Higher values (e.g., 1.0) make output more random, while lower values (e.g., 0.2) make it more focused and deterministic.
Whether to stream the response. When set to
true, tokens are sent as they are generated.Example Request
Multi-Turn Conversation Example
Validation Rules
messagesarray must contain at least one message- Each message must have both
roleandcontentfields temperaturemust be between 0 and 2 (if provided)max_tokensmust be a positive integer (if provided)streammust be a boolean value
Related Schemas
- ChatResponse - Response schema for chat completions
- Errors - Error response formats