API Documentation
For our official Discord bot integration, please see Official Discord bot integration. Our open source repo for deploying Kindroid-Discord bots is at https://github.com/KindroidAI/Kindroid-discord
https://api.kindroid.ai/v1
All endpoints require authentication, use the Authorization header with Bearer {Your API key, which should start with kn_...}. Your API key and AI ID can be found in General settings.
WARNING: You should only play around with the API if you're a developer interested in tinkering with integrating Kindroid. DO NOT share your key with anyone who asks, and unless it comes from admins do not trust other sources. Someone with your API key could do anything do your account, including deleting it.
These few are the select ones we openly document for integrations currently. We may expand featuresets for API at a later point in time.
Sends a message to an AI and receives a response. This request may take a long time, so you should await for its response.
- URL: /send-message
- Method: POST
- Request Body:
- { "ai_id": "string", "message": "string" }
- Response:
- Success: 200 OK with AI response
- Error: 400 Bad Request, 401 Unauthorized, 403 Forbidden, 500 Internal Server Error
Ends a chat and resets the short term memory. Greeting is mandatory & is the first message in a new conversation.
- URL: /chat-break
- Method: POST
- Request Body:
- { "ai_id": "string", "greeting": "string" }
- Response:
- Success: 200 OK
- Error: 400 Bad Request, 401 Unauthorized, 403 Forbidden, 500 Internal Server Error
Core endpoint for sending context and getting a response, used in https://github.com/KindroidAI/Kindroid-discord
- URL: /discord-bot
- Method: POST
- Request Header:
- In addition to the authorization header, another header to identify the hashed, unique string of the Discord user who triggered this call is recommended. This helps with rate limiting and preventing bot abuse. The string can be hashed using anything but we recommend the following:
- const lastUsername = conversation[conversation.length - 1].username; // Encode username to handle non-ASCII characters, then hash to alphanumeric const hashedUsername = Buffer.from(encodeURIComponent(lastUsername)) .toString("base64") .replace(/[^a-zA-Z0-9]/g, "") .slice(0, 32);
- Place in header as: "X-Kindroid-Requester": hashedUsername
- Request Body:
- { "share_code": 5 letter string - see Discord repo for more, and must be shared by the UID who is authenticating. "enable_filter": boolean - content filter for public servers is recommended. "conversation": array of {"username": string, "text": string, "timestamp": string (Date as msg.createdAt.toISOString())} }
- Response:
- Success: 200 OK
- Error: 400 Bad Request, 401 Unauthorized, 403 Forbidden, 500 Internal Server Error