LLM & Chat
Chat
Generate AI responses using our Small Language Model (SLM) with support for streaming, text correction, and function calling
POST
Request
Headers
Bearer token with your API key
application/json
Body - Direct Messages Mode (OpenAI Compatible)
The model to use for completion
Array of message objects with
role and contentEnable streaming response (Server-Sent Events)
Top-k sampling parameter for response generation
Template configuration options
Enable thinking mode in the model
Array of tool/function definitions for function calling
Body - Enhanced Text Correction Mode
The text to correct/improve
Array of term-replacement pairs for custom corrections
The term to find and replace
The replacement text
Style configuration for text correction
Tone to apply (e.g., “professional”, “casual”, “friendly”)
Automatically capitalize sentences
Add proper punctuation
Whether to use contractions (false to expand them)
Expand abbreviations to full form
Application context (e.g., “email”, “chat”, “document”)
Save conversation to chat history
Existing chat ID to continue conversation
Response
Array of completion choices
The generated message with role and content
Streaming delta with incremental content (stream mode only)
ID of the chat session (for new chats)
Token usage information
Total tokens used in the request
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:
| Option | Type | Description |
|---|---|---|
tone | string | Target tone: “professional”, “casual”, “friendly” |
autoCapitalize | boolean | Automatically capitalize first letter of sentences |
autoPunctuate | boolean | Add proper punctuation marks |
useContractions | boolean | Set to false to expand contractions (can’t → cannot) |
expandAbbreviations | boolean | Expand common abbreviations |
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.