{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/trajectory/json-schema/trajectory-aperture-live-dataset-response-schema.json",
  "title": "ApertureLiveDatasetResponse",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/trajectory-aperture-api-openapi.yml#/components/schemas/ApertureLiveDatasetResponse",
  "properties": {
    "trajectories": {
      "items": {
        "$ref": "#/$defs/ApertureLiveDatasetTrajectory"
      },
      "type": "array",
      "title": "Trajectories"
    },
    "counts": {
      "$ref": "#/$defs/ApertureDatasetCounts"
    },
    "updates": {
      "items": {
        "$ref": "#/$defs/ApertureDatasetUpdate"
      },
      "type": "array",
      "title": "Updates"
    },
    "has_more": {
      "type": "boolean",
      "title": "Has More"
    },
    "next_offset": {
      "type": "integer",
      "title": "Next Offset"
    },
    "organization_id": {
      "type": "string",
      "title": "Organization Id"
    },
    "training_available": {
      "type": "boolean",
      "title": "Training Available"
    }
  },
  "type": "object",
  "required": [
    "trajectories",
    "counts",
    "updates",
    "has_more",
    "next_offset",
    "organization_id",
    "training_available"
  ],
  "$defs": {
    "ApertureDatasetCounts": {
      "properties": {
        "admitted": {
          "type": "integer",
          "title": "Admitted"
        },
        "active": {
          "type": "integer",
          "title": "Active"
        },
        "awaiting_reward": {
          "type": "integer",
          "title": "Awaiting Reward"
        },
        "ready": {
          "type": "integer",
          "title": "Ready"
        },
        "failed": {
          "type": "integer",
          "title": "Failed"
        },
        "trained": {
          "type": "integer",
          "title": "Trained"
        }
      },
      "type": "object",
      "required": [
        "admitted",
        "active",
        "awaiting_reward",
        "ready",
        "failed",
        "trained"
      ],
      "title": "ApertureDatasetCounts"
    },
    "ApertureDatasetEpisode": {
      "properties": {
        "capture": {
          "type": "string",
          "title": "Capture"
        },
        "termination_reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Termination Reason"
        },
        "reward_state": {
          "type": "string",
          "enum": [
            "valid",
            "unknown",
            "failed"
          ],
          "title": "Reward State"
        },
        "reward_version": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reward Version"
        },
        "ready": {
          "type": "boolean",
          "title": "Ready"
        },
        "failed": {
          "type": "boolean",
          "title": "Failed"
        },
        "training": {
          "type": "string",
          "enum": [
            "unassigned",
            "snapshot",
            "prepared",
            "trained"
          ],
          "title": "Training"
        },
        "behavior_endpoint": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Behavior Endpoint"
        },
        "behavior_checkpoint": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Behavior Checkpoint"
        },
        "behavior_checkpoint_step": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Behavior Checkpoint Step"
        },
        "frozen_rewards": {
          "items": {
            "$ref": "#/$defs/ApertureFrozenReward"
          },
          "type": "array",
          "title": "Frozen Rewards"
        },
        "updates": {
          "items": {
            "$ref": "#/$defs/ApertureDatasetUpdate"
          },
          "type": "array",
          "title": "Updates"
        }
      },
      "type": "object",
      "required": [
        "capture",
        "termination_reason",
        "reward_state",
        "reward_version",
        "ready",
        "failed",
        "training",
        "behavior_endpoint",
        "behavior_checkpoint",
        "behavior_checkpoint_step",
        "frozen_rewards",
        "updates"
      ],
      "title": "ApertureDatasetEpisode"
    },
    "ApertureDatasetUpdate": {
      "properties": {
        "snapshot_id": {
          "type": "string",
          "title": "Snapshot Id"
        },
        "xid": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Xid"
        },
        "step": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Step"
        },
        "status": {
          "type": "string",
          "title": "Status"
        },
        "checkpoint_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Checkpoint Id"
        },
        "checkpoint_step": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Checkpoint Step"
        },
        "global_step": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Global Step"
        },
        "checkpoint_path": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Checkpoint Path"
        },
        "trajectory_ids": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Trajectory Ids"
        }
      },
      "type": "object",
      "required": [
        "snapshot_id",
        "xid",
        "step",
        "status",
        "checkpoint_id",
        "checkpoint_step",
        "checkpoint_path",
        "trajectory_ids"
      ],
      "title": "ApertureDatasetUpdate"
    },
    "ApertureFrozenReward": {
      "properties": {
        "snapshot_id": {
          "type": "string",
          "title": "Snapshot Id"
        },
        "score_id": {
          "type": "string",
          "title": "Score Id"
        },
        "value": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Value"
        }
      },
      "type": "object",
      "required": [
        "snapshot_id",
        "score_id",
        "value"
      ],
      "title": "ApertureFrozenReward"
    },
    "ApertureLiveDatasetTrajectory": {
      "properties": {
        "xid": {
          "type": "string",
          "title": "Xid"
        },
        "trajectory_id": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Trajectory Id"
        },
        "trajectory_idx": {
          "type": "integer",
          "title": "Trajectory Idx"
        },
        "status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Status"
        },
        "termination_reason": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Termination Reason"
        },
        "reward": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reward"
        },
        "task": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Task"
        },
        "task_gcs_uri": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Task Gcs Uri"
        },
        "step_uris": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Step Uris"
        },
        "reference_step_uris": {
          "items": {
            "type": "string"
          },
          "type": "array",
          "title": "Reference Step Uris"
        },
        "reference_trajectory_json": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reference Trajectory Json"
        },
        "metrics": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Metrics"
        },
        "execution_metrics": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Execution Metrics"
        },
        "trajectory_json": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Trajectory Json"
        },
        "trajectory_json_gcs_uri": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Trajectory Json Gcs Uri"
        },
        "telemetry_data": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Telemetry Data"
        },
        "reward_components": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {},
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reward Components"
        },
        "error": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Error"
        },
        "created_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Created At"
        },
        "updated_at": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "string",
              "format": "date-time"
            },
            {
              "type": "null"
            }
          ],
          "title": "Updated At"
        },
        "uid": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Uid"
        },
        "mode": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Mode"
        },
        "global_step": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Global Step"
        },
        "storage_source": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Storage Source"
        },
        "blob_source": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Blob Source"
        },
        "training_step": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Training Step"
        },
        "has_reference": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Has Reference"
        },
        "trajectory_blob_token": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Trajectory Blob Token"
        },
        "parsed": {
          "$ref": "#/$defs/ApertureXidParsedTrajectory"
        },
        "source": {
          "type": "string",
          "const": "dataset",
          "title": "Source"
        },
        "dataset_name": {
          "type": "string",
          "title": "Dataset Name"
        },
        "dataset_split": {
          "type": "string",
          "title": "Dataset Split"
        },
        "organization_id": {
          "type": "string",
          "title": "Organization Id"
        },
        "dataset_source": {
          "type": "string",
          "const": "default",
          "title": "Dataset Source"
        },
        "episode": {
          "$ref": "#/$defs/ApertureDatasetEpisode"
        }
      },
      "type": "object",
      "required": [
        "xid",
        "trajectory_idx",
        "step_uris",
        "parsed",
        "source",
        "dataset_name",
        "dataset_split",
        "organization_id",
        "dataset_source",
        "episode"
      ],
      "title": "ApertureLiveDatasetTrajectory"
    },
    "ApertureXidMessage": {
      "properties": {
        "role": {
          "type": "string",
          "title": "Role"
        },
        "content": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "items": {
                "additionalProperties": true,
                "type": "object"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Content"
        },
        "reasoning": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reasoning"
        },
        "tool_calls": {
          "anyOf": [
            {
              "items": {
                "additionalProperties": true,
                "type": "object"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tool Calls"
        },
        "tool_response": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tool Response"
        },
        "usage": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Usage"
        },
        "metadata": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Metadata"
        },
        "started_at_us": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Started At Us"
        },
        "duration_seconds": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Duration Seconds"
        },
        "token_count": {
          "anyOf": [
            {
              "type": "integer"
            },
            {
              "type": "null"
            }
          ],
          "title": "Token Count"
        },
        "preview_truncated": {
          "anyOf": [
            {
              "type": "boolean"
            },
            {
              "type": "null"
            }
          ],
          "title": "Preview Truncated"
        },
        "message_blob_token": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Message Blob Token"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "role"
      ],
      "title": "ApertureXidMessage"
    },
    "ApertureXidParsedTrajectory": {
      "properties": {
        "task": {
          "anyOf": [
            {
              "$ref": "#/$defs/ApertureXidTask"
            },
            {
              "type": "null"
            }
          ]
        },
        "steps": {
          "items": {
            "anyOf": [
              {
                "$ref": "#/$defs/ApertureXidStep"
              },
              {
                "type": "null"
              }
            ]
          },
          "type": "array",
          "title": "Steps"
        },
        "step_count": {
          "type": "integer",
          "title": "Step Count"
        },
        "total_reward": {
          "anyOf": [
            {
              "type": "number"
            },
            {
              "type": "null"
            }
          ],
          "title": "Total Reward"
        },
        "reward": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reward"
        },
        "metrics": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Metrics"
        },
        "execution_metrics": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Execution Metrics"
        },
        "telemetry": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Telemetry"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "steps",
        "step_count"
      ],
      "title": "ApertureXidParsedTrajectory"
    },
    "ApertureXidStep": {
      "properties": {
        "messages": {
          "items": {
            "$ref": "#/$defs/ApertureXidMessage"
          },
          "type": "array",
          "title": "Messages"
        },
        "reward": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Reward"
        },
        "info": {
          "anyOf": [
            {
              "additionalProperties": true,
              "type": "object"
            },
            {
              "type": "null"
            }
          ],
          "title": "Info"
        },
        "raw_input": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Raw Input"
        },
        "raw_output": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Raw Output"
        },
        "tokens": {
          "anyOf": [
            {
              "items": {
                "type": "integer"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Tokens"
        },
        "token_masks": {
          "anyOf": [
            {
              "items": {
                "type": "integer"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Token Masks"
        },
        "logprobs": {
          "anyOf": [
            {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Logprobs"
        },
        "train_logprobs": {
          "anyOf": [
            {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Train Logprobs"
        },
        "token_strings": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Token Strings"
        },
        "advantages": {
          "anyOf": [
            {
              "items": {
                "anyOf": [
                  {
                    "type": "number"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Advantages"
        },
        "trainable_status": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "title": "Trainable Status"
        },
        "deferred_fields": {
          "anyOf": [
            {
              "items": {
                "type": "string"
              },
              "type": "array"
            },
            {
              "type": "null"
            }
          ],
          "title": "Deferred Fields"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "required": [
        "messages"
      ],
      "title": "ApertureXidStep"
    },
    "ApertureXidTask": {
      "properties": {
        "id": {
          "title": "Id"
        },
        "task_id": {
          "title": "Task Id"
        },
        "instruction": {
          "title": "Instruction"
        },
        "question": {
          "title": "Question"
        },
        "title": {
          "title": "Title"
        },
        "type": {
          "title": "Type"
        }
      },
      "additionalProperties": true,
      "type": "object",
      "title": "ApertureXidTask"
    }
  }
}