{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/hud-ai/json-schema/hud-ai-atif-trajectory-schema.json",
  "title": "AtifTrajectory",
  "description": "ATIF v1.0-v1.8 document accepted by the public import endpoints.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/hud-ai-jobs-api-openapi.yml#/components/schemas/AtifTrajectory",
  "properties": {
    "schema_version": {
      "type": "string",
      "enum": [
        "ATIF-v1.0",
        "ATIF-v1.1",
        "ATIF-v1.2",
        "ATIF-v1.3",
        "ATIF-v1.4",
        "ATIF-v1.5",
        "ATIF-v1.6",
        "ATIF-v1.7",
        "ATIF-v1.8"
      ],
      "title": "Schema Version",
      "default": "ATIF-v1.8"
    },
    "session_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Session Id"
    },
    "trajectory_id": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Trajectory Id"
    },
    "agent": {
      "$ref": "#/$defs/AtifAgent"
    },
    "steps": {
      "items": {
        "$ref": "#/$defs/AtifStep"
      },
      "type": "array",
      "maxItems": 10000,
      "minItems": 1,
      "title": "Steps"
    },
    "notes": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Notes"
    },
    "final_metrics": {
      "anyOf": [
        {
          "$ref": "#/$defs/AtifFinalMetrics"
        },
        {
          "type": "null"
        }
      ]
    },
    "continued_trajectory_ref": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "title": "Continued Trajectory Ref"
    },
    "extra": {
      "anyOf": [
        {
          "additionalProperties": true,
          "type": "object"
        },
        {
          "type": "null"
        }
      ],
      "title": "Extra"
    },
    "subagent_trajectories": {
      "anyOf": [
        {
          "items": {
            "$ref": "#/$defs/AtifTrajectory"
          },
          "type": "array",
          "maxItems": 100
        },
        {
          "type": "null"
        }
      ],
      "title": "Subagent Trajectories"
    }
  },
  "additionalProperties": false,
  "type": "object",
  "required": [
    "agent",
    "steps"
  ],
  "$defs": {
    "AtifAgent": {
      "properties": {
        "name": {
          "type": "string",
          "title": "Name"
        },
        "version": {
          "type": "string",
          "title": "Version"
        },
        "model_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Model Name"
        },
        "tool_definitions": {
          "anyOf": [
            {
              "items": {
                "additionalProperties": true,
                "type": "object"
              },
              "type": "array",
              "maxItems": 1000
            },
            {
              "type": "null"
            }
          ],
          "title": "Tool Definitions"
        },
        "extra": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Extra"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "name",
        "version"
      ],
      "title": "AtifAgent"
    },
    "AtifAudioSource": {
      "properties": {
        "media_type": {
          "type": "string",
          "enum": [
            "audio/wav",
            "audio/mpeg",
            "audio/mp4",
            "audio/aac",
            "audio/ogg",
            "audio/flac",
            "audio/webm",
            "audio/aiff"
          ],
          "title": "Media Type"
        },
        "path": {
          "type": "string",
          "title": "Path"
        },
        "duration_sec": {
          "anyOf": [
            {
              "type": "number",
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Duration Sec"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "media_type",
        "path"
      ],
      "title": "AtifAudioSource"
    },
    "AtifContentPart": {
      "properties": {
        "type": {
          "type": "string",
          "enum": [
            "text",
            "image",
            "audio"
          ],
          "title": "Type"
        },
        "text": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Text"
        },
        "source": {
          "anyOf": [
            {
              "$ref": "#/$defs/AtifImageSource"
            },
            {
              "$ref": "#/$defs/AtifAudioSource"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "type"
      ],
      "title": "AtifContentPart"
    },
    "AtifFinalMetrics": {
      "properties": {
        "total_prompt_tokens": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Total Prompt Tokens"
        },
        "total_completion_tokens": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Total Completion Tokens"
        },
        "total_cached_tokens": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Total Cached Tokens"
        },
        "total_cost_usd": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Total Cost Usd"
        },
        "total_steps": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Total Steps"
        },
        "extra": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Extra"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "AtifFinalMetrics"
    },
    "AtifImageSource": {
      "properties": {
        "media_type": {
          "type": "string",
          "enum": [
            "image/jpeg",
            "image/png",
            "image/gif",
            "image/webp"
          ],
          "title": "Media Type"
        },
        "path": {
          "type": "string",
          "title": "Path"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "media_type",
        "path"
      ],
      "title": "AtifImageSource"
    },
    "AtifMetrics": {
      "properties": {
        "prompt_tokens": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Prompt Tokens"
        },
        "completion_tokens": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Completion Tokens"
        },
        "cached_tokens": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cached Tokens"
        },
        "cost_usd": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Cost Usd"
        },
        "prompt_token_ids": {
          "anyOf": [
            {
              "items": {
                "type": "integer"
              },
              "type": "array",
              "maxItems": 250000
            },
            {
              "type": "null"
            }
          ],
          "title": "Prompt Token Ids"
        },
        "completion_token_ids": {
          "anyOf": [
            {
              "items": {
                "type": "integer"
              },
              "type": "array",
              "maxItems": 250000
            },
            {
              "type": "null"
            }
          ],
          "title": "Completion Token Ids"
        },
        "logprobs": {
          "anyOf": [
            {
              "items": {
                "type": "number"
              },
              "type": "array",
              "maxItems": 250000
            },
            {
              "type": "null"
            }
          ],
          "title": "Logprobs"
        },
        "extra": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Extra"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "AtifMetrics"
    },
    "AtifObservation": {
      "properties": {
        "results": {
          "items": {
            "$ref": "#/$defs/AtifObservationResult"
          },
          "type": "array",
          "maxItems": 1000,
          "title": "Results"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "results"
      ],
      "title": "AtifObservation"
    },
    "AtifObservationResult": {
      "properties": {
        "source_call_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Source Call Id"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "$ref": "#/$defs/AtifContentPart"
              },
              "type": "array",
              "maxItems": 1000
            },
            {
              "type": "null"
            }
          ],
          "title": "Content"
        },
        "subagent_trajectory_ref": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/AtifSubagentRef"
              },
              "type": "array",
              "maxItems": 1000
            },
            {
              "type": "null"
            }
          ],
          "title": "Subagent Trajectory Ref"
        },
        "extra": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Extra"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "AtifObservationResult"
    },
    "AtifStep": {
      "properties": {
        "step_id": {
          "type": "integer",
          "minimum": 1.0,
          "title": "Step Id"
        },
        "timestamp": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Timestamp"
        },
        "source": {
          "type": "string",
          "enum": [
            "system",
            "user",
            "agent"
          ],
          "title": "Source"
        },
        "model_name": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Model Name"
        },
        "reasoning_effort": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reasoning Effort"
        },
        "message": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "$ref": "#/$defs/AtifContentPart"
              },
              "type": "array",
              "maxItems": 1000
            }
          ],
          "title": "Message"
        },
        "reasoning_content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reasoning Content"
        },
        "tool_calls": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/AtifToolCall"
              },
              "type": "array",
              "maxItems": 1000
            },
            {
              "type": "null"
            }
          ],
          "title": "Tool Calls"
        },
        "observation": {
          "anyOf": [
            {
              "$ref": "#/$defs/AtifObservation"
            },
            {
              "type": "null"
            }
          ]
        },
        "metrics": {
          "anyOf": [
            {
              "$ref": "#/$defs/AtifMetrics"
            },
            {
              "type": "null"
            }
          ]
        },
        "is_copied_context": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Is Copied Context"
        },
        "llm_call_count": {
          "anyOf": [
            {
              "type": "integer",
              "minimum": 0.0
            },
            {
              "type": "null"
            }
          ],
          "title": "Llm Call Count"
        },
        "extra": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Extra"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "step_id",
        "source",
        "message"
      ],
      "title": "AtifStep"
    },
    "AtifSubagentRef": {
      "properties": {
        "trajectory_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Trajectory Id"
        },
        "session_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Session Id"
        },
        "trajectory_path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Trajectory Path"
        },
        "extra": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Extra"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "title": "AtifSubagentRef"
    },
    "AtifToolCall": {
      "properties": {
        "tool_call_id": {
          "type": "string",
          "title": "Tool Call Id"
        },
        "function_name": {
          "type": "string",
          "title": "Function Name"
        },
        "arguments": {
          "additionalProperties": true,
          "type": "object",
          "title": "Arguments"
        },
        "extra": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Extra"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "tool_call_id",
        "function_name",
        "arguments"
      ],
      "title": "AtifToolCall"
    },
    "AtifTrajectory": {
      "properties": {
        "schema_version": {
          "type": "string",
          "enum": [
            "ATIF-v1.0",
            "ATIF-v1.1",
            "ATIF-v1.2",
            "ATIF-v1.3",
            "ATIF-v1.4",
            "ATIF-v1.5",
            "ATIF-v1.6",
            "ATIF-v1.7",
            "ATIF-v1.8"
          ],
          "title": "Schema Version",
          "default": "ATIF-v1.8"
        },
        "session_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Session Id"
        },
        "trajectory_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Trajectory Id"
        },
        "agent": {
          "$ref": "#/$defs/AtifAgent"
        },
        "steps": {
          "items": {
            "$ref": "#/$defs/AtifStep"
          },
          "type": "array",
          "maxItems": 10000,
          "minItems": 1,
          "title": "Steps"
        },
        "notes": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Notes"
        },
        "final_metrics": {
          "anyOf": [
            {
              "$ref": "#/$defs/AtifFinalMetrics"
            },
            {
              "type": "null"
            }
          ]
        },
        "continued_trajectory_ref": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Continued Trajectory Ref"
        },
        "extra": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Extra"
        },
        "subagent_trajectories": {
          "anyOf": [
            {
              "items": {
                "$ref": "#/$defs/AtifTrajectory"
              },
              "type": "array",
              "maxItems": 100
            },
            {
              "type": "null"
            }
          ],
          "title": "Subagent Trajectories"
        }
      },
      "additionalProperties": false,
      "type": "object",
      "required": [
        "agent",
        "steps"
      ],
      "title": "AtifTrajectory",
      "description": "ATIF v1.0-v1.8 document accepted by the public import endpoints."
    }
  }
}