LLM & Chat
Chat
Generate AI responses using our Small Language Model (SLM) with support for streaming, text correction, and function calling
POST
Request
Headers
string
required
Bearer token with your API key
string
required
application/json
Body - Direct Messages Mode (OpenAI Compatible)
string
default:"qcall/slm-3b-int4"
The model to use for completion
array
required
Array of message objects with
role and contentboolean
default:"true"
Enable streaming response (Server-Sent Events)
number
default:"20"
Top-k sampling parameter for response generation
object
Template configuration options
boolean
default:"false"
Enable thinking mode in the model
array
Array of tool/function definitions for function calling
Body - Enhanced Text Correction Mode
string
required
The text to correct/improve
array
Array of term-replacement pairs for custom corrections
string
The term to find and replace
string
The replacement text
object
Style configuration for text correction
string
Tone to apply (e.g., “professional”, “casual”, “friendly”)
boolean
Automatically capitalize sentences
boolean
Add proper punctuation
boolean
Whether to use contractions (false to expand them)
boolean
Expand abbreviations to full form
string
Application context (e.g., “email”, “chat”, “document”)
boolean
default:"true"
Save conversation to chat history
string
Existing chat ID to continue conversation
Response
array
Array of completion choices
object
The generated message with role and content
object
Streaming delta with incremental content (stream mode only)
string
ID of the chat session (for new chats)
object
Token usage information
number
Total tokens used in the request
number
Response time in milliseconds
Streaming Response
Server-Sent Events Format
Server-Sent Events Format
When
stream: true, the response is sent as Server-Sent Events (SSE):- chat_id event - Sent first for new chats
- content chunks - Delta updates with incremental content
- done event - Signals completion with response time
- [DONE] - Final termination signal
Function Calling with Tools
Function Calling with Tools
Define tools/functions that the model can call during conversation:The model will respond with tool calls that you can execute and send back the results.
Text Correction Features
Dictionary Replacements
Dictionary Replacements
Define custom term replacements that will always be applied:Up to 100 dictionary entries are supported, each with a maximum length of 200 characters.
Style Options
Style Options
Configure how the text should be corrected and styled:
Application Context
Application Context
Provide context to help the model adjust its corrections:Supported contexts: “email”, “chat”, “document”, “message”, “social”
Chat history is automatically saved when
save_chat: true. Use chat_id to
continue existing conversations or create new chats by omitting this
parameter.