{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/robosystems-ai/json-schema/robosystems-ai-operator-run-list-response-schema.json",
  "title": "OperatorRunListResponse",
  "description": "A page of the graph's operator runs, newest first.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/robosystems-ai-graph-audit-api-openapi.yml#/components/schemas/OperatorRunListResponse",
  "properties": {
    "graph_id": {
      "type": "string",
      "title": "Graph Id"
    },
    "runs": {
      "items": {
        "$ref": "#/$defs/OperatorRunSummary"
      },
      "type": "array",
      "title": "Runs"
    },
    "next_cursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Next Cursor",
      "description": "Pass as `cursor` for the next, older page; null on the last page"
    }
  },
  "type": "object",
  "required": [
    "graph_id",
    "runs"
  ],
  "$defs": {
    "OperatorRunSummary": {
      "properties": {
        "operation_id": {
          "type": "string",
          "title": "Operation Id",
          "description": "The run's operation id; every mutation audit entry the run made carries it as `operation_id`"
        },
        "thread_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Thread Id",
          "description": "The conversation the run belongs to, when the caller threaded it; null for a standalone API call"
        },
        "user_id": {
          "type": "string",
          "title": "User Id",
          "description": "The user the run ran as"
        },
        "operator_type": {
          "type": "string",
          "title": "Operator Type",
          "description": "The operator that ran"
        },
        "mode": {
          "type": "string",
          "title": "Mode",
          "description": "The execution mode the run used"
        },
        "status": {
          "type": "string",
          "enum": [
            "completed",
            "failed",
            "cancelled"
          ],
          "title": "Status",
          "description": "How the run ended"
        },
        "question": {
          "type": "string",
          "title": "Question",
          "description": "The message the run was given"
        },
        "answer": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Answer",
          "description": "The operator's answer; null when the run did not reach one"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error",
          "description": "Why a failed run failed"
        },
        "credits_consumed": {
          "type": "number",
          "title": "Credits Consumed",
          "description": "Credits the run's model calls cost",
          "default": 0.0
        },
        "call_count": {
          "type": "integer",
          "title": "Call Count",
          "description": "Model calls the run made",
          "default": 0
        },
        "tools_called": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Tools Called",
          "description": "The tools the run called, each named once"
        },
        "write_count": {
          "type": "integer",
          "title": "Write Count",
          "description": "Writes the run made to the graph",
          "default": 0
        },
        "started_at": {
          "type": "string",
          "format": "date-time",
          "title": "Started At",
          "description": "When the run started on the worker"
        },
        "finished_at": {
          "type": "string",
          "format": "date-time",
          "title": "Finished At",
          "description": "When the run ended"
        },
        "duration_ms": {
          "type": "number",
          "title": "Duration Ms",
          "description": "How long the run took"
        }
      },
      "type": "object",
      "required": [
        "operation_id",
        "user_id",
        "operator_type",
        "mode",
        "status",
        "question",
        "started_at",
        "finished_at",
        "duration_ms"
      ],
      "title": "OperatorRunSummary",
      "description": "One in-app AI operator run: what it was asked and what it answered."
    }
  }
}