{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/professionalaiagents-com/json-schema/professionalaiagents-com-public-run-out-schema.json",
  "title": "PublicRunOut",
  "x-generated": "2026-11-22",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/seneca-research-openapi.json#/components/schemas/PublicRunOut",
  "properties": {
    "id": {
      "type": "string",
      "format": "uuid",
      "title": "Id"
    },
    "object": {
      "type": "string",
      "const": "research.run",
      "title": "Object",
      "default": "research.run"
    },
    "status": {
      "type": "string",
      "title": "Status",
      "description": "queued, running, synthesizing, completed, partial, or failed."
    },
    "phase": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Phase",
      "description": "panel while models are still answering. Null while synthesizing or after the run finishes."
    },
    "source": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Source"
    },
    "panel": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Panel",
      "description": "Canonical panel id: wide, consensus, or seneca. A stored Quick Pulse run still reports quick_pulse."
    },
    "prompt": {
      "type": "string",
      "title": "Prompt"
    },
    "credits_reserved": {
      "type": "integer",
      "title": "Credits Reserved",
      "description": "Credits reserved when the run was accepted. This is the panel price and does not change if the run is later refunded."
    },
    "credits_charged": {
      "anyOf": [
        {
          "type": "integer"
        },
        {
          "type": "null"
        }
      ],
      "title": "Credits Charged",
      "description": "Null while the run is in progress. Equal to credits_reserved when a customer report is delivered, including a partial run that has a report. 0 after a verified technical failure with no customer report; that refund restores the reserve. failure_code does not change between a charged failure and a refunded one."
    },
    "failure_code": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Failure Code",
      "description": "research_failed when status is failed. Null otherwise."
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "completed_at": {
      "anyOf": [
        {
          "type": "string",
          "format": "date-time"
        },
        {
          "type": "null"
        }
      ],
      "title": "Completed At"
    },
    "progress": {
      "$ref": "#/$defs/PublicProgressOut"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "id",
    "status",
    "prompt",
    "credits_reserved",
    "created_at",
    "progress"
  ],
  "$defs": {
    "PublicProgressOut": {
      "properties": {
        "total_models": {
          "type": "integer",
          "title": "Total Models"
        },
        "completed_models": {
          "type": "integer",
          "title": "Completed Models"
        },
        "successful_models": {
          "type": "integer",
          "title": "Successful Models"
        },
        "failed_models": {
          "type": "integer",
          "title": "Failed Models"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "total_models",
        "completed_models",
        "successful_models",
        "failed_models"
      ],
      "title": "PublicProgressOut"
    }
  }
}