{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/sap-btp/json-schema/sap-btp-ai-artifact-schema.json",
  "title": "AiArtifact",
  "description": "Base data of the artifact; this is the data that can be provided when the artifact is created; `name` and `kind` are required because they constitute important semantic filtering criteria for use in training / inference executables (`name` is a semantic handle of the artifact within a scenario and `kind` specifies the type of usage, e.g. you would only want to allow models in the model operator).\n",
  "x-generated": "2026-11-25",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/sap-btp-ai-core-openapi.yml#/components/schemas/AiArtifact",
  "type": "object",
  "properties": {
    "labels": {
      "$ref": "#/$defs/AiLabelList"
    },
    "name": {
      "$ref": "#/$defs/AiArtifactName"
    },
    "kind": {
      "type": "string",
      "enum": [
        "model",
        "dataset",
        "resultset",
        "other"
      ],
      "description": "Kind of the artifact, i.e. model or dataset"
    },
    "url": {
      "$ref": "#/$defs/AiArtifactUrl"
    },
    "description": {
      "$ref": "#/$defs/AiArtifactDescription"
    },
    "id": {
      "$ref": "#/$defs/AiArtifactId"
    },
    "scenarioId": {
      "$ref": "#/$defs/AiScenarioId"
    },
    "configurationId": {
      "$ref": "#/$defs/AiConfigurationId"
    },
    "executionId": {
      "$ref": "#/$defs/AiExecutionId"
    },
    "createdAt": {
      "type": "string",
      "description": "Timestamp of resource creation",
      "format": "date-time"
    },
    "modifiedAt": {
      "type": "string",
      "format": "date-time",
      "description": "Timestamp of latest resource modification"
    },
    "scenario": {
      "type": [
        "object",
        "null"
      ],
      "anyOf": [
        {
          "$ref": "#/$defs/AiScenario"
        },
        {}
      ]
    }
  },
  "required": [
    "name",
    "kind",
    "url",
    "id",
    "scenarioId",
    "createdAt",
    "modifiedAt"
  ],
  "$defs": {
    "AiArtifactDescription": {
      "type": "string",
      "maxLength": 5000,
      "description": "Description of the artifact"
    },
    "AiArtifactId": {
      "type": "string",
      "pattern": "^[\\w.-]{4,64}$",
      "description": "ID of the artifact"
    },
    "AiArtifactName": {
      "type": "string",
      "pattern": "^[\\w\\s.!?,;:\\[\\](){}<>\"'=+*/\\\\^&%@~$#|-]*$",
      "maxLength": 256,
      "description": "Name of the artifact"
    },
    "AiArtifactUrl": {
      "type": "string",
      "pattern": "([a-z0-9-]+):\\/\\/.+",
      "maxLength": 1024,
      "description": "Reference to the location of the artifact.\n"
    },
    "AiConfigurationId": {
      "type": "string",
      "pattern": "^[\\w.-]{4,64}$",
      "description": "ID of the configuration"
    },
    "AiExecutionId": {
      "type": "string",
      "pattern": "^[\\w.-]{4,64}$",
      "description": "ID of the execution"
    },
    "AiLabel": {
      "type": "object",
      "required": [
        "key",
        "value"
      ],
      "properties": {
        "key": {
          "$ref": "#/$defs/AiLabelKey"
        },
        "value": {
          "$ref": "#/$defs/AiLabelValue"
        }
      }
    },
    "AiLabelKey": {
      "type": "string",
      "maxLength": 256,
      "pattern": "^ext\\.ai\\.sap\\.com\\/[\\w\\.-]+$"
    },
    "AiLabelList": {
      "type": "array",
      "description": "Arbitrary labels as meta information",
      "items": {
        "$ref": "#/$defs/AiLabel"
      }
    },
    "AiLabelValue": {
      "type": "string",
      "maxLength": 5000
    },
    "AiScenario": {
      "type": "object",
      "description": "An ML Scenario consists of a number of executables. E.g., there can be one or several training executables, an inference (deployment) executable. An ML Scenario is versioned.\n",
      "required": [
        "name",
        "id",
        "createdAt",
        "modifiedAt"
      ],
      "properties": {
        "name": {
          "type": "string",
          "maxLength": 256,
          "description": "Name of the scenario"
        },
        "description": {
          "type": "string",
          "maxLength": 5000,
          "description": "Description of the scenario"
        },
        "labels": {
          "$ref": "#/$defs/AiScenarioLabelList"
        },
        "id": {
          "$ref": "#/$defs/AiScenarioId"
        },
        "createdAt": {
          "type": "string",
          "description": "Timestamp of resource creation",
          "format": "date-time"
        },
        "modifiedAt": {
          "type": "string",
          "format": "date-time",
          "description": "Timestamp of latest resource modification"
        }
      }
    },
    "AiScenarioId": {
      "type": "string",
      "pattern": "^[\\w.-]{4,64}$",
      "description": "ID of the scenario"
    },
    "AiScenarioLabel": {
      "type": "object",
      "required": [
        "key",
        "value"
      ],
      "properties": {
        "key": {
          "$ref": "#/$defs/AiScenarioLabelKey"
        },
        "value": {
          "$ref": "#/$defs/AiLabelValue"
        }
      }
    },
    "AiScenarioLabelKey": {
      "type": "string",
      "maxLength": 256,
      "pattern": "^(scenarios|ext)\\.ai\\.sap\\.com\\/[\\w\\.-]+$"
    },
    "AiScenarioLabelList": {
      "type": "array",
      "description": "Arbitrary labels as meta information",
      "items": {
        "$ref": "#/$defs/AiScenarioLabel"
      }
    }
  }
}