Endpoints
Completions
Create text completions using KrosAI’s language models
Completions API
The completions endpoint allows you to generate text completions using KrosAI’s language models. This is ideal for tasks like content generation, translation, and text transformation.
Create Completion
Request Body
The prompt to generate completions for
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. Higher values mean more random completions.
Controls diversity via nucleus sampling. Values between 0 and 1.
Example Request
Example Response
All requests must include an API key in the Authorization header.
Error Responses
Invalid request parameters
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.