KAI KAI

KAI AI for Developers

A practical page for engineers integrating KAI into real workflows: from chat UI usage to secure API-key based automation and runtime admin controls.

1. Getting Started

  1. Create an account and sign in to KAI Chat.
  2. Create an API key in API Keys for server-side calls.
  3. Check plan limits in Billing before production rollout.
  4. Configure Team and roles for shared operational work.

2. API Contract in Practice

The /chat endpoint supports JSON and multipart/form-data. In API-key mode, user identity is derived from the key, and user_id from payload is ignored to prevent impersonation.

POST /chat
Authorization: Bearer <API_KEY>
Content-Type: application/json

{
  "message": "Build a release plan for today",
  "developer_mode": true
}

3. Production Safety Basics

  • Rate limiting is enforced for auth, chat, and notes operations.
  • CSRF and session auth are required for web form actions.
  • reCAPTCHA v3 and Google/Facebook OAuth are runtime-managed from Admin settings.
  • Legacy password hashes are auto-upgraded on successful login.

4. Response Quality Guidelines

  • Always provide context: objective, constraints, and output format.
  • Use developer mode when you need structured technical output.
  • When uploading files, state exactly what to extract and how to return it.
  • Validate generated answers with tests and metrics, not text confidence.

5. Operations and Incident Triage

Use Admin Audit, Usage events, payment transaction logs, and server logs together. For incidents, check health and limits first, then provider-specific LLM failures.

6. curl and Postman Example

Minimal production-style CLI request:

curl -X POST "https://iuve.eu/chat" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Build a release plan for today",
    "developer_mode": true
  }'

For Postman: use POST to /chat, add Authorization and Content-Type headers, and send raw JSON body.

7. Common Errors and What To Do

  • 401 Unauthorized: missing API key or expired web session. Verify Bearer token and key status.
  • 429 flash.too_many_attempts: rate limiter triggered. Add retry with backoff and reduce burst traffic.
  • 429 billing.limit_exceeded: plan limit reached. Check Billing and upgrade/switch plan.
  • 500 Internal server error: inspect server logs and LLM provider health (Ollama in local setup).

8. Multipart with File Uploads

When you need to send attachments with the message, use multipart/form-data and repeat the files field.

curl -X POST "https://iuve.eu/chat" \
  -H "Authorization: Bearer <API_KEY>" \
  -F "message=Summarize key release risks from attached files" \
  -F "developer_mode=true" \
  -F "files=@/path/to/architecture.md" \
  -F "files=@/path/to/release-plan.pdf"

Limits: up to 10 files, 25 MB per file, and allowed extensions only. Invalid payloads return 400 with a detailed error.

If you need a private integration path or architecture review for your workload, use Team scoping and admin roles to isolate workspaces.