{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trezalabs-com/json-schema/trezalabs-com-run-status-schema.json",
  "title": "RunStatus",
  "x-generated": "2026-11-27",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trezalabs-com-openapi.json#/components/schemas/RunStatus",
  "type": "object",
  "properties": {
    "runId": {
      "type": "string"
    },
    "status": {
      "type": "string",
      "enum": [
        "running",
        "success",
        "error",
        "partial",
        "cancelled"
      ],
      "description": "cancelled is a run stopped before it finished (cancel_run or the dashboard), or one Treza closed after its worker was lost."
    },
    "version": {
      "type": "integer",
      "description": "The published version that ran."
    },
    "startedAt": {
      "type": "string",
      "format": "date-time"
    },
    "finishedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Present once the run has finished."
    },
    "durationMs": {
      "type": "integer",
      "description": "Present once the run has finished."
    },
    "usage": {
      "type": "object",
      "description": "Token counts summed over the run's model steps, and the provider cost when reported.",
      "properties": {
        "prompt": {
          "type": "integer"
        },
        "completion": {
          "type": "integer"
        },
        "total": {
          "type": "integer"
        },
        "costUsd": {
          "type": "number",
          "description": "Provider cost in USD before markup (not the credits charged)."
        }
      }
    },
    "outputs": {
      "type": "object",
      "description": "Values keyed by the output contract of the version that ran, present once the run has finished. Media URLs are returned verbatim; long text values are truncated.",
      "additionalProperties": true
    }
  }
}