{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/cadencz-com/json-schema/cadencz-com-agent-run-read-schema.json",
  "title": "AgentRunRead",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/cadencz-com-agents-api-openapi.yml#/components/schemas/AgentRunRead",
  "properties": {
    "id": {
      "type": "string",
      "title": "Id"
    },
    "workspace_id": {
      "type": "string",
      "title": "Workspace Id"
    },
    "route": {
      "type": "string",
      "title": "Route",
      "description": "The graph route (stored as the run 'stage')."
    },
    "status": {
      "type": "string",
      "title": "Status"
    },
    "tags": {
      "items": {
        "type": "string"
      },
      "type": "array",
      "title": "Tags"
    },
    "input_text": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Input Text"
    },
    "output_json": {
      "additionalProperties": true,
      "type": "object",
      "title": "Output Json"
    },
    "error": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Error"
    },
    "tokens_used": {
      "type": "integer",
      "title": "Tokens Used"
    },
    "model_provider": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Model Provider"
    },
    "model_name": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Model Name"
    },
    "steps": {
      "items": {
        "$ref": "#/$defs/AgentStepRead"
      },
      "type": "array",
      "title": "Steps"
    },
    "created_at": {
      "type": "string",
      "format": "date-time",
      "title": "Created At"
    },
    "updated_at": {
      "type": "string",
      "format": "date-time",
      "title": "Updated At"
    }
  },
  "type": "object",
  "required": [
    "id",
    "workspace_id",
    "route",
    "status",
    "tags",
    "input_text",
    "output_json",
    "error",
    "tokens_used",
    "model_provider",
    "model_name",
    "steps",
    "created_at",
    "updated_at"
  ],
  "$defs": {
    "AgentStepRead": {
      "properties": {
        "id": {
          "type": "string",
          "title": "Id"
        },
        "sequence": {
          "type": "integer",
          "title": "Sequence"
        },
        "agent_name": {
          "type": "string",
          "title": "Agent Name"
        },
        "tier": {
          "type": "string",
          "title": "Tier"
        },
        "provider": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Provider"
        },
        "model": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Model"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "attempt": {
          "type": "integer",
          "title": "Attempt"
        },
        "output_json": {
          "additionalProperties": true,
          "type": "object",
          "title": "Output Json"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error"
        },
        "input_tokens": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Input Tokens"
        },
        "output_tokens": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Output Tokens"
        },
        "total_tokens": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Total Tokens"
        },
        "cached_input_tokens": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cached Input Tokens"
        },
        "latency_ms": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Latency Ms"
        },
        "created_at": {
          "type": "string",
          "format": "date-time",
          "title": "Created At"
        }
      },
      "type": "object",
      "required": [
        "id",
        "sequence",
        "agent_name",
        "tier",
        "provider",
        "model",
        "status",
        "attempt",
        "output_json",
        "error",
        "input_tokens",
        "output_tokens",
        "total_tokens",
        "cached_input_tokens",
        "latency_ms",
        "created_at"
      ],
      "title": "AgentStepRead"
    }
  }
}