Constructor
Bot Management
createBot()
Create a new AI bot.Display name for your bot
AI model to use:
gpt-5.1, gpt-5-mini, claude-3.7-sonnet, gemini-2.0-flash, etc.System instruction guiding the AI’s behavior
Maximum tokens in AI responses
Reasoning mode:
auto, standard, agentBot status:
active or inactivefetchBot()
Get a bot’s configuration.ID of the bot to fetch
fetchBots()
Get all bots in a project (paginated).Page number
Items per page
updateBot()
Update a bot’s configuration.createBot(), plus:
ID of the bot to update
resetBot()
Delete all training data from a bot.deleteBot()
Delete a bot permanently.Chat Operations
chat()
Send a message and get an AI response.ID of the bot to chat with
User’s message
Unique ID for conversation continuity
Enable streaming responses
Use agent’s training data/memory
Override bot’s default model
Use your own API key (BYOK)
Provider host URL (required for Ollama)
Override bot’s default instruction
Limit knowledge to specific sources
Override reasoning mode:
auto, standard, agentOverride bot’s default token limit
Chat mode:
ask for normal chat, edit for agent-powered code editing, plan for conversational planning before tool execution. Edit mode routes through the agent reasoning pipeline to make targeted file changes. Plan mode proposes a step-by-step plan for review before executing. Both edit and plan require workspace to be enabled — if disabled, requests fall back to ask.fetchChat()
Get chat history for a conversation.Bot ID
Chat/conversation ID
Page number
Messages per page
fetchChats()
Get all chats for a bot.Bot ID
Page number
Chats per page
deleteChat()
Delete a chat history.Chat ID to delete
Bot ID
executeTool()
Execute tool calls for a chat.Bot ID
Chat ID
Array of tool call objects with
tool_name and parametersvoteMessage()
Vote on a message (upvote/downvote).Bot ID
Message ID to vote on
ID of the user voting
Type of voter (e.g., ‘member’)
Vote type: ‘upvote’ or ‘downvote’
fetchVoteStatus()
Get the vote status for a message.Bot ID
Message ID
Voter ID
Voter type
deleteMessage()
Delete a specific message.Bot ID
Chat ID
Message ID to delete
Training & Sources
startTraining()
Add training data to a bot.Bot ID
Source type:
text, website, file, webpagetext: String contentwebsite: String URL to crawlfile: Array of file pathswebpage: Array of URLs
fetchTraining()
Get a specific training source.fetchTrainings()
Get all training sources for a bot.updateTraining()
Update a training source.startTraining() with status, tokens, and links.
deleteTraining()
Delete a training source.Search
search()
Search the bot’s knowledge base.Bot ID
Search query
Limit search to specific sources
Subscribers
fetchSubscribers()
Get all subscribers for your project.Page number
Subscribers per page
Analytics & Statistics
fetchVoteStats()
Get voting statistics for a bot.Bot ID
fetchSummaryStats()
Get summary statistics for a bot.Bot ID
fetchDashboardStats()
Get dashboard statistics for a bot.Bot ID
fetchToolUsageStats()
Get tool usage statistics for a bot.Bot ID
fetchWorkflowStats()
Get workflow statistics for a bot.Bot ID
fetchPerformanceMetrics()
Get performance metrics for a bot.Bot ID
fetchBehaviorStats()
Get user behavior statistics for a bot.Bot ID
fetchErrorAnalysis()
Get error analysis for a bot.Bot ID
fetchReasoningSummary()
Get reasoning summary statistics for a bot.Bot ID
Error Handling
All methods return a consistent response format:- 401 - Invalid API key
- 403 - Insufficient permissions
- 404 - Resource not found
- 429 - Rate limit exceeded
- 500 - Server error
Complete Example
Next Steps
Router SDK
Deploy bots to multiple channels
REST API
Direct API access
Examples
Real-world implementations
Troubleshooting
Common issues