Endpoints
Chat Completions
Create conversational responses using KrosAI’s chat models
Chat Completions API
The chat completions endpoint enables multi-turn conversations with KrosAI’s language models. This is ideal for chatbots, virtual assistants, and interactive applications.
Create Chat Completion
Request Body
Array of messages comprising the conversation history
The ID of the model to use. Currently supported: KrosMLingual1.0.1
The maximum number of tokens to generate
Controls randomness in the output. Values between 0 and 1.
Message Object
The role of the message author. Must be one of: system
, user
, or assistant
The content of the message
Example Request
Example Response
The chat completion API maintains conversation context across multiple messages.
Error Responses
Invalid request parameters or message format
Invalid or missing API key
Rate limit exceeded
Best Practices
- System Messages: Use system messages to set the behavior and context for your assistant.
- Message History: Keep message history concise to stay within token limits.
- Temperature: Use lower temperature (0.2-0.4) for more focused, deterministic responses.
- Rate Limits: Implement proper error handling for rate limits.