Skip to content

AIChatGetRun

GET ai/chat/run

Returns the state of a run and, when it is finished, the answer. This is both the polling path for interfaces without streaming and the recovery path after a lost connection — the full answer is never sent through the event channel.

Access Control

Allowed: client, manager, admin. Only runs started by the current session.

Request

GET request
GET https://{broker_domain}/ai/chat/run?runId=run_55b…
Authorization: <JWT_TOKEN>
{
  "command": "AIChatGetRun",
  "extID": "1",
  "data": { "runId": "run_55b…" }
}
const run = await platform.AIChatGetRun({ runId });

Parameters

Parameter Type Description
runId string Run id returned by AIChatSendMessage
accountLogin int Account context. Required for a client session of an account owner

Response Data

{
  "runId": "run_55b…",
  "conversationId": "cnv_8f3a…",
  "state": "completed",
  "model": "anthropic/claude-sonnet-4.5",
  "result": {
    "content": "The position was closed by stop out…",
    "sources": [
      { "id": "trading.trade-close-reasons", "title": "Why a position was closed", "section": "Trading", "scope": "global", "score": 14.2 }
    ],
    "actions": [
      { "type": "navigate", "route": "/backoffice/trades", "label": "Open trades" }
    ],
    "tools": [ { "tool": "get_open_trades", "state": "ok" } ],
    "messageId": "msg_1c7…"
  },
  "usage": { "inputTokens": 1840, "outputTokens": 120, "cost": 0.0042 },
  "errorCode": null,
  "errorMessage": null,
  "startedAt": "2026-09-17 10:12:21",
  "completedAt": "2026-09-17 10:12:40"
}
state Meaning
queued waiting for a slot
running the model is answering
completed the answer is in result
failed generation failed; see errorCode
cancelled stopped by AIChatCancelRun
interrupted the service restarted mid-generation; the question has to be asked again

sources are the knowledge documents behind the answer, actions are buttons defined by those documents (never invented by the model), tools is the trace of platform data the assistant read. What to render from each is described in Chat integration.

Errors

Code Error Description
403 AI_ACCESS_DENIED The session may not use the assistant
404 AI_RUN_NOT_FOUND Unknown run, or a run of another session