Publishable keys (kroos_pk_)#
- Sent in the request body as
pk, from a browser on an allowed origin. - Locked to your verified domains plus any extra allowed origins you add in the console (
PUT /api/tenant/origins). - Mobile apps have no web origin: add the app as an allowed origin,
app:ios:<bundle id>orapp:android:<package name>(for exampleapp:ios:com.example.shop). The mobile SDKs send it in theX-Kroos-Appheader. Browsers can't send that header cross-origin, and a request that carries a webOriginis checked against that origin instead. - Requests from other origins are refused. Optionally, a foreign-origin request rotates the key automatically (
usagePolicy.keys.autoRotateOnForeignOrigin), and owners get akey.foreign_originwebhook.
Secret keys (kroos_sk_)#
Send as a bearer token from your server:
curl -s https://kroos.ai/api/tenant -H "authorization: Bearer kroos_sk_..."- Never ship a secret key to a browser or mobile app.
- Kroos watches for use from new networks and sends
key.new_network/key.leak_suspectedevents.
Admin keys (kroos_ak_)#
Create one with POST /api/tenant/keys/admin (secret key required). Admin keys call the admin API only. They're shown once.
Rotating and revoking#
| Action | Request |
|---|---|
| Rotate any key | POST /api/tenant/keys/:id/rotate or POST /v1/api_keys/:id/rotate |
| Revoke any key | POST /api/tenant/keys/:id/revoke or POST /v1/api_keys/:id/revoke |
Rotation returns the new key once. The old key stops working immediately.
End-user tokens#
Short-lived HS256 tokens your backend signs so the chatbot knows a visitor is a signed-in customer. See End-user tokens.
Employee sessions#
Employees sign in to the internal assistant with your SSO, or during pilots with a one-time link (POST /api/tenant/employees/:id/login-link). The link opens Kroos chat, where your organization's assistant appears under Projects. See Internal assistant.
Pairing tokens#
People create pairing tokens in Kroos chat → Projects for IDE extensions and the local Code Advisor (MCP). Set it as KROOS_PROJECT_TOKEN. Tokens are hashed at rest, expire, and can be revoked from the same page.
AI access tokens (first-party pages)#
Kroos's own pages exchange a signed-in session for a five-minute, origin-bound token (POST /api/ai/token) before calling the AI host. You don't need this for your integrations; it's listed so the traffic you see is explained.
Storage checklist#
- Secret and admin keys in a secrets manager or environment variable, never in source control.
- One key per environment (development, staging, production).
- A webhook endpoint subscribed to
key.*events. - A documented rotation owner.