The APIs#
| API | Base | Auth | Use it for |
|---|---|---|---|
| Website chatbot API | https://api.kroos.ai/api/public/v1 | Publishable key + allowed origin | Building your own chat UI, voice, handoff |
| Organization API | https://kroos.ai/api/tenant | Bearer kroos_sk_… | Setup and configuration from your backend |
| Admin API | https://kroos.ai/v1 | Bearer kroos_ak_… | Usage, cost, limits, keys, end users |
| Internal assistant API | https://api.kroos.ai/internal/v1 | Employee session | Your company's assistant in your own tools |
| MCP | https://api.kroos.ai/mcp/tenant/<orgId> | Public facts; tools by token | AI assistants and agents |
| SCIM 2.0 | https://kroos.ai/scim/v2 | Bearer kroos_sk_… | Provisioning employees |
Requests#
Content-Type: application/jsonfor every write. Bodies are limited (256 KB on the AI host; 1 MB on the website host; 8 MB for document uploads).- Browser writes to
https://kroos.ai/api/*from another origin are refused (403 csrf.origin_mismatch). Call the organization and admin APIs from your server. - The AI host accepts only
GET,POSTandOPTIONS, and only AI routes.
Responses#
Successful responses are JSON with status 200. Each carries a kroos-request-id header; include it when you contact support.
Errors#
{
"error": {
"code": "policy.restricted_mode",
"message": "This key is in restricted mode: it only works on the Kroos preview page until a domain is verified and a policy is signed.",
"fix": { "tab": "setup", "section": "sec-domain", "label": "Verify a domain and sign your policy", "url": "/console#setup/sec-domain" }
}
}codeis stable; branch on it, not onmessage.fix, when present, points to the console section that resolves the problem. Show it to the person who can act.
| Status | Typical codes |
|---|---|
| 400 | invalid_json, invalid_policy, access.credentials_detected |
| 401 | auth.required, auth.enduser_token_invalid, auth.pairing_token_invalid |
| 402 | billing.credits_exhausted |
| 403 | policy.restricted_mode, auth.origin_not_allowed, csrf.origin_mismatch |
| 404 | not_found, conversation_not_found |
| 412 | explorer.access_required, explorer.roua_failing, explorer.metadata_only |
| 421 | ai.moved (with apiBase) |
| 429 | Rate limits, abuse.challenge_required (with challenge), budget limits (budget.*) |
See Errors & codes for the full list.
Streaming#
Endpoints ending in /stream return Server-Sent Events:
event: start
data: {"at":1764547200000}
event: token
data: {"t":"Our opening "}
event: done
data: { ...the same object the JSON endpoint returns... }An event: error carries { code, message, fix? } instead of done.
const res = await fetch("https://api.kroos.ai/api/public/v1/chat/stream", {
method: "POST", headers: { "content-type": "application/json" },
body: JSON.stringify({ pk: "kroos_pk_...", message: "Do you deliver?" }),
});
const reader = res.body.getReader(); const dec = new TextDecoder(); let buf = "";
for (;;) {
const { value, done } = await reader.read(); if (done) break;
buf += dec.decode(value, { stream: true });
let i; while ((i = buf.indexOf("\n\n")) >= 0) {
const chunk = buf.slice(0, i); buf = buf.slice(i + 2);
const ev = chunk.match(/^event: (.*)$/m)?.[1], data = JSON.parse(chunk.match(/^data: (.*)$/m)?.[1] ?? "null");
if (ev === "token") process.stdout.write(data.t);
if (ev === "done") console.log("\nconversation:", data.conversationId);
}
}Rate limits#
Limits apply per IP, per visitor, per workspace and per organization tier. Website chatbot responses carry kroos-ratelimit-* headers (details). On 429, wait for the -reset time; don't retry in a tight loop.
CORS#
The website chatbot API answers CORS preflights for your verified domains and allowed origins only. Other APIs don't allow browser cross-origin calls.
Versioning#
Paths are versioned (/api/public/v1, /v1). Fields may be added at any time; existing fields and codes aren't removed or renamed without a new version and notice in the changelog.