API Documentation

for our official discord bot integration, please see official discord bot integration docid\ rlluzotf4dsbpr1hupyg6 our open source repo for deploying kindroid discord bots is at https //github com/kindroidai/kindroid discord https //github com/kindroidai/kindroid discord base url https //api kindroid ai/v1 authentication 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 endpoints these few are the select ones we openly document for integrations currently we may expand featuresets for api at a later point in time send message 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 chat break 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 discord bot endpoint core endpoint for sending context and getting a response, used in https //github com/kindroidai/kindroid discord 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