events.iterate.com

Event type

events.iterate.com/agent/llm-request-settled

The ONE terminal fact for an LLM request (succeeded | failed | cancelled), pointing back at the requested event's offset. Idempotency-keyed on that offset, so a zombie driver racing a fresh incarnation or an interrupt collapses to one settlement.

Payload schema

requestOffsetinteger

The settled request: the offset of its llm-request-requested event.

durationMsintegeroptional

Wall-clock duration of the settling attempt.

resultobject

How the request settled.

status: "succeeded"object
status"succeeded"
textstring

The assistant's text — ALSO carried by the atomically-appended assistant context item; kept here so the settled event alone tells the whole story.

usageobjectoptional

Normalized provider-reported token usage.

inputTokensinteger

Total input tokens, including cached ones.

outputTokensinteger

Total output tokens, including reasoning ones.

cachedInputTokensintegeroptional

Prompt-cache hits, where the model reports them.

reasoningOutputTokensintegeroptional

Reasoning/thinking tokens, where the model reports them.

rawResponseanyoptional

Provider response verbatim.

status: "failed"object
status"failed"
errorMessagestring

What the transport reported.

rawResponseanyoptional

Provider response verbatim.

status: "cancelled"object
status"cancelled"
reason"interrupted-by-user-input" | "expired"

Why the request was cancelled.

partialTextstringoptional

Whatever streamed before the abort — preserved for the conversation.

Raw JSON schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "requestOffset": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991,
      "description": "The settled request: the offset of its llm-request-requested event."
    },
    "durationMs": {
      "description": "Wall-clock duration of the settling attempt.",
      "type": "integer",
      "minimum": 0,
      "maximum": 9007199254740991
    },
    "result": {
      "oneOf": [
        {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "const": "succeeded"
            },
            "text": {
              "type": "string",
              "description": "The assistant's text — ALSO carried by the atomically-appended assistant context item; kept here so the settled event alone tells the whole story."
            },
            "usage": {
              "description": "Normalized provider-reported token usage.",
              "type": "object",
              "properties": {
                "inputTokens": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "Total input tokens, including cached ones."
                },
                "outputTokens": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991,
                  "description": "Total output tokens, including reasoning ones."
                },
                "cachedInputTokens": {
                  "description": "Prompt-cache hits, where the model reports them.",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "reasoningOutputTokens": {
                  "description": "Reasoning/thinking tokens, where the model reports them.",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "inputTokens",
                "outputTokens"
              ]
            },
            "rawResponse": {
              "description": "Provider response verbatim."
            }
          },
          "required": [
            "status",
            "text"
          ]
        },
        {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "const": "failed"
            },
            "errorMessage": {
              "type": "string",
              "description": "What the transport reported."
            },
            "rawResponse": {
              "description": "Provider response verbatim."
            }
          },
          "required": [
            "status",
            "errorMessage"
          ]
        },
        {
          "type": "object",
          "properties": {
            "status": {
              "type": "string",
              "const": "cancelled"
            },
            "reason": {
              "type": "string",
              "enum": [
                "interrupted-by-user-input",
                "expired"
              ],
              "description": "Why the request was cancelled."
            },
            "partialText": {
              "description": "Whatever streamed before the abort — preserved for the conversation.",
              "type": "string"
            }
          },
          "required": [
            "status",
            "reason"
          ]
        }
      ],
      "description": "How the request settled."
    }
  },
  "required": [
    "requestOffset",
    "result"
  ]
}