Bots

Read New Bot Chat Messages

Changed on

Poll a chat: where its bots stand, and the messages, media, files and question posted since cursor. Pass wait to hold the request until the bots finish or ask something. Call again with the returned cursor until finished is true.

get/bots/chats/{chat_id}/messages

Request

  • Base URL
    https://api.krea.ai
  • Auth
    HTTP bearer

Path parameters

chat_id, string uuid required

Query parameters

cursor, string

The cursor of the previous response, so only what happened since is returned. Without one, the read starts after your own newest message.

wait, integer

Seconds to wait for the bots to finish or ask something before answering. 0 answers at once; the most is 30.

Response

The state of the chat.

object required
chat_id, string required
title, string required
status, 'working' | 'needs_input' | 'done' | 'failed' | 'stopped' required

working while a bot is mid-turn, needs_input when a bot waits on question, then done, failed or stopped.

finished, boolean required

True once status is done, failed or stopped.

bots, object[] required
working, object[] required
progress, string[] required

New steps of the working bots' turns.

messages, object[] required

New visible messages since cursor, oldest first.

text, string required

The bots' new message text, joined.

media, object[] required

Images, video and audio the bots posted since cursor.

files, object[] required
question, object
error, object

Present when status is failed. out_of_compute, bot_usage_limit and chat_usage_limit are billing holds, not faults.

out_of_compute_bot_ids, string[] required

Bots held in this chat because the workspace ran out of compute units. Add units, then call retry or send a message.

timed_out, boolean required

True when wait ran out while a bot was still working, or more is unread than one response carries. Read again with cursor.

cursor, string required
url, string required

Changes