← Settings

API

Create a key in Settings, then send it as a Bearer token. Every request is scoped to your own account — an agent, conversation, or routine that isn't yours will 404. Sending a message or running a routine counts against your plan's message limit, same as the chat UI.

Authentication

curl https://bot.kru.ai/api/v1/agents \
  -H "Authorization: Bearer bk_live_..."
POST /api/v1/messages
Send a message to an agent (creates a conversation if none given), returns the reply.
{"agent_id": "...", "message": "..."}
GET /api/v1/agents
List your agents.
POST /api/v1/agents
Create an agent.
{"name": "...", "persona": "...", "role_description": "...", "model": null}
PATCH /api/v1/agents/{id}
Update an agent — any subset of the create fields.
{"name": "..."}
GET /api/v1/conversations
List your conversations (most recent 100).
GET /api/v1/conversations/{id}/messages
Full message history for one conversation.
POST /api/v1/routines/{id}/run
Run a routine right now, outside its daily schedule.
GET /api/v1/usage
Your plan, its limits, and this month's usage.