Agent

Wait For Agent Session

Changed on

Wait until the Agent turn finishes or timeoutSeconds elapses (default 60, maximum 300). Pass the runId returned by send-message so an earlier turn is not mistaken for this one. Call again when timedOut is true until finished is true. A timeout does not stop the turn.

post/agent/wait-for-session

Request

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

Request body

object required
sessionId, string uuid required

Session id returned by send_agent_message

timeoutSeconds, integer
runId, string uuid

runId from send_agent_message, so a previous turn's finished status is not mistaken for this one

Response

The Agent session result.

object required
sessionId, string required
threadId, string required
runId, string
status, 'not_started' | 'running' | 'completed' | 'failed' | 'cancelled' required
finished, boolean required

True once status is completed, failed, or cancelled

text, string required

Latest assistant message text

media, object[] required

Media the session produced — the deliverables the agent presented, plus its other generations while a turn is running. Order is not significant. Each item is {jobId, mediaKind?} for a generation (fetch it with get_job), {url} for rehosted media, or {uri, name, mimeType} for a Krea file (read it with read_files)

error, string
url, string required

The session in the Krea app

timedOut, boolean required

Changes

    • info

      added the optional property required_plan to the response with the status

    • info

      added the optional property required_plan to the response with the status

    • info

      added the optional property required_plan to the response with the status

    4 more changes in this revision