{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/langflow/json-schema/langflow-trace-read-schema.json",
  "title": "TraceRead",
  "description": "Response model for a single trace with its hierarchical span tree.\n\nSerializes to camelCase JSON to match the frontend API contract.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/langflow-traces-api-openapi.yml#/components/schemas/TraceRead",
  "properties": {
    "endTime": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Endtime"
    },
    "flowId": {
      "format": "uuid",
      "title": "Flowid",
      "type": "string"
    },
    "id": {
      "format": "uuid",
      "title": "Id",
      "type": "string"
    },
    "input": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Input"
    },
    "name": {
      "title": "Name",
      "type": "string"
    },
    "output": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Output"
    },
    "sessionId": {
      "title": "Sessionid",
      "type": "string"
    },
    "spans": {
      "items": {
        "$ref": "#/$defs/SpanReadResponse"
      },
      "title": "Spans",
      "type": "array"
    },
    "startTime": {
      "anyOf": [
        {
          "format": "date-time",
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Starttime"
    },
    "status": {
      "$ref": "#/$defs/SpanStatus"
    },
    "totalLatencyMs": {
      "title": "Totallatencyms",
      "type": "integer"
    },
    "totalTokens": {
      "title": "Totaltokens",
      "type": "integer"
    }
  },
  "required": [
    "id",
    "name",
    "status",
    "startTime",
    "endTime",
    "totalLatencyMs",
    "totalTokens",
    "flowId",
    "sessionId"
  ],
  "type": "object",
  "$defs": {
    "SpanReadResponse": {
      "description": "Response model for a single span, with nested children.\n\nSerializes to camelCase JSON to match the frontend API contract.",
      "properties": {
        "children": {
          "items": {
            "$ref": "#/$defs/SpanReadResponse"
          },
          "title": "Children",
          "type": "array"
        },
        "endTime": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Endtime"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error"
        },
        "id": {
          "format": "uuid",
          "title": "Id",
          "type": "string"
        },
        "inputs": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Inputs"
        },
        "latencyMs": {
          "title": "Latencyms",
          "type": "integer"
        },
        "modelName": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Modelname"
        },
        "name": {
          "title": "Name",
          "type": "string"
        },
        "outputs": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Outputs"
        },
        "startTime": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Starttime"
        },
        "status": {
          "$ref": "#/$defs/SpanStatus"
        },
        "tokenUsage": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tokenusage"
        },
        "type": {
          "$ref": "#/$defs/SpanType"
        }
      },
      "required": [
        "id",
        "name",
        "type",
        "status",
        "startTime",
        "endTime",
        "latencyMs",
        "inputs",
        "outputs",
        "error",
        "modelName",
        "tokenUsage"
      ],
      "title": "SpanReadResponse",
      "type": "object"
    },
    "SpanStatus": {
      "description": "OpenTelemetry status codes.\n\n- UNSET: Default status, span has not ended yet\n- OK: Span completed successfully\n- ERROR: Span completed with an error",
      "enum": [
        "unset",
        "ok",
        "error"
      ],
      "title": "SpanStatus",
      "type": "string"
    },
    "SpanType": {
      "description": "Types of spans that can be recorded.",
      "enum": [
        "chain",
        "llm",
        "tool",
        "retriever",
        "embedding",
        "parser",
        "agent"
      ],
      "title": "SpanType",
      "type": "string"
    }
  }
}