Introducing our new Monitoring feature Learn more

Documentation

Chat

Create and manage Krastie chat sessions over the public API.

Chat

Base path: /v1/ai/chat

Send chat messages with POST /v1/ai/generate/chat. Use the endpoints below to manage sessions and related brand-voice helpers.

List sessions

GET /v1/ai/chat/sessions

QueryDescription
skipOffset for pagination (default 0). Returns up to 10 sessions.
curl "https://api.krastie.ai/v1/ai/chat/sessions?skip=0" \
  -H "api-key: YOUR_KEY"
{
  "message": "Chat sessions fetched successfully.",
  "chatHistory": []
}

Get latest session

GET /v1/ai/chat/session

Returns the most recent session for the authenticated user. Optional skip query paginates message blocks (3 at a time).

{
  "message": "Chat session fetched successfully.",
  "sessionId": "…",
  "blocks": []
}

Create session

POST /v1/ai/chat/session

FieldTypeDescription
sessionIdstringClient-generated session id
curl https://api.krastie.ai/v1/ai/chat/session \
  -H "api-key: YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"sessionId":"sess_abc123"}'
{
  "message": "Chat session created successfully.",
  "sessionId": "sess_abc123",
  "session": {}
}

Get session by id

GET /v1/ai/chat/session/:sessionId

Optional skip query for block pagination.

Delete session

Either path deletes the session:

  • DELETE /v1/ai/chat/session/:sessionId
  • DELETE /v1/ai/chat/chatSession/:sessionId

Brand voice (chat routes)

POST /v1/ai/chat/brand-voice — create a brand voice from a website (same body as generate brand-voice/website).

PUT /v1/ai/chat/brandVoices/:id — update a brand voice.

DELETE /v1/ai/chat/brandVoices/:id — soft-delete a brand voice.

Prefer the dedicated Brand voice routes for CRUD.

Fine-tuning job

GET /v1/ai/chat/getFineTuningJob

Returns the current fine-tuning job status for the account when one exists.

Feedback

POST /v1/ai/chat/feedback

Submit feedback on a chat generation.