{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/amazon-sagemaker/json-schema/amazon-sagemaker-describe-optimization-job-response-schema.json",
  "title": "DescribeOptimizationJobResponse",
  "x-generated": "2026-11-11",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amazon-sagemaker-optimization-job-api-openapi.yml#/components/schemas/DescribeOptimizationJobResponse",
  "type": "object",
  "properties": {
    "OptimizationJobArn": {
      "type": "string",
      "description": "The Amazon Resource Name (ARN) of the optimization job."
    },
    "OptimizationJobStatus": {
      "type": "string",
      "enum": [
        "INPROGRESS",
        "COMPLETED",
        "FAILED",
        "STARTING",
        "STOPPING",
        "STOPPED"
      ],
      "description": "The current status of the optimization job."
    },
    "OptimizationStartTime": {
      "type": "string",
      "format": "date-time",
      "description": "The time when the optimization job started."
    },
    "OptimizationEndTime": {
      "type": "string",
      "format": "date-time",
      "description": "The time when the optimization job finished processing."
    },
    "CreationTime": {
      "type": "string",
      "format": "date-time",
      "description": "The time when you created the optimization job."
    },
    "LastModifiedTime": {
      "type": "string",
      "format": "date-time",
      "description": "The time when the optimization job was last updated."
    },
    "FailureReason": {
      "type": "string",
      "description": "If the optimization job status is FAILED, the reason for the failure."
    },
    "OptimizationJobName": {
      "type": "string",
      "description": "The name that you assigned to the optimization job."
    },
    "ModelSource": {
      "$ref": "#/$defs/OptimizationJobModelSource"
    },
    "OptimizationEnvironment": {
      "type": "object",
      "additionalProperties": {
        "type": "string"
      },
      "description": "The environment variables to set in the model container."
    },
    "DeploymentInstanceType": {
      "type": "string",
      "enum": [
        "ml.p4d.24xlarge",
        "ml.p4de.24xlarge",
        "ml.p5.48xlarge",
        "ml.p5e.48xlarge",
        "ml.p5en.48xlarge",
        "ml.g4dn.xlarge",
        "ml.g4dn.2xlarge",
        "ml.g4dn.4xlarge",
        "ml.g4dn.8xlarge",
        "ml.g4dn.12xlarge",
        "ml.g4dn.16xlarge",
        "ml.g5.xlarge",
        "ml.g5.2xlarge",
        "ml.g5.4xlarge",
        "ml.g5.8xlarge",
        "ml.g5.12xlarge",
        "ml.g5.16xlarge",
        "ml.g5.24xlarge",
        "ml.g5.48xlarge",
        "ml.g6.xlarge",
        "ml.g6.2xlarge",
        "ml.g6.4xlarge",
        "ml.g6.8xlarge",
        "ml.g6.12xlarge",
        "ml.g6.16xlarge",
        "ml.g6.24xlarge",
        "ml.g6.48xlarge",
        "ml.g6e.xlarge",
        "ml.g6e.2xlarge",
        "ml.g6e.4xlarge",
        "ml.g6e.8xlarge",
        "ml.g6e.12xlarge",
        "ml.g6e.16xlarge",
        "ml.g6e.24xlarge",
        "ml.g6e.48xlarge",
        "ml.inf2.xlarge",
        "ml.inf2.8xlarge",
        "ml.inf2.24xlarge",
        "ml.inf2.48xlarge",
        "ml.trn1.2xlarge",
        "ml.trn1.32xlarge",
        "ml.trn1n.32xlarge",
        "ml.p6-b200.48xlarge",
        "ml.g7e.2xlarge",
        "ml.g7e.4xlarge",
        "ml.g7e.8xlarge",
        "ml.g7e.12xlarge",
        "ml.g7e.24xlarge",
        "ml.g7e.48xlarge",
        "ml.g7.2xlarge",
        "ml.g7.4xlarge",
        "ml.g7.8xlarge",
        "ml.g7.12xlarge",
        "ml.g7.24xlarge",
        "ml.g7.48xlarge"
      ],
      "description": "The type of instance that hosts the optimized model that you create with the optimization job."
    },
    "MaxInstanceCount": {
      "type": "integer",
      "description": "The maximum number of instances to use for the optimization job."
    },
    "OptimizationConfigs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/OptimizationConfig"
      },
      "description": "Settings for each of the optimization techniques that the job applies."
    },
    "OutputConfig": {
      "$ref": "#/$defs/OptimizationJobOutputConfig"
    },
    "OptimizationOutput": {
      "$ref": "#/$defs/OptimizationOutput"
    },
    "RoleArn": {
      "type": "string",
      "description": "The ARN of the IAM role that you assigned to the optimization job."
    },
    "StoppingCondition": {
      "$ref": "#/$defs/StoppingCondition"
    },
    "VpcConfig": {
      "$ref": "#/$defs/OptimizationVpcConfig"
    },
    "TrainingPlanArns": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "The Amazon Resource Name (ARN) of the training plan associated with this optimization job. This field appears only when you specified a training plan when you created the job. Optimization jobs that use on-demand capacity don't return this field."
    }
  },
  "required": [
    "OptimizationJobArn",
    "OptimizationJobStatus",
    "CreationTime",
    "LastModifiedTime",
    "OptimizationJobName",
    "ModelSource",
    "DeploymentInstanceType",
    "OptimizationConfigs",
    "OutputConfig",
    "RoleArn",
    "StoppingCondition"
  ],
  "$defs": {
    "ModelCompilationConfig": {
      "type": "object",
      "properties": {
        "Image": {
          "type": "string",
          "description": "The URI of an LMI DLC in Amazon ECR. SageMaker uses this image to run the optimization."
        },
        "OverrideEnvironment": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Environment variables that override the default ones in the model container."
        }
      }
    },
    "ModelQuantizationConfig": {
      "type": "object",
      "properties": {
        "Image": {
          "type": "string",
          "description": "The URI of an LMI DLC in Amazon ECR. SageMaker uses this image to run the optimization."
        },
        "OverrideEnvironment": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Environment variables that override the default ones in the model container."
        }
      }
    },
    "ModelShardingConfig": {
      "type": "object",
      "properties": {
        "Image": {
          "type": "string",
          "description": "The URI of an LMI DLC in Amazon ECR. SageMaker uses this image to run the optimization."
        },
        "OverrideEnvironment": {
          "type": "object",
          "additionalProperties": {
            "type": "string"
          },
          "description": "Environment variables that override the default ones in the model container."
        }
      }
    },
    "ModelSpeculativeDecodingConfig": {
      "type": "object",
      "properties": {
        "Technique": {
          "type": "string",
          "enum": [
            "EAGLE"
          ],
          "description": "The speculative decoding technique to apply during model optimization."
        },
        "TrainingDataSource": {
          "$ref": "#/$defs/ModelSpeculativeDecodingTrainingDataSource"
        }
      },
      "required": [
        "Technique"
      ]
    },
    "ModelSpeculativeDecodingTrainingDataSource": {
      "type": "object",
      "properties": {
        "S3Uri": {
          "type": "string",
          "description": "The Amazon S3 URI that points to the training data for speculative decoding."
        },
        "S3DataType": {
          "type": "string",
          "enum": [
            "S3Prefix",
            "ManifestFile"
          ],
          "description": "The type of data stored in the Amazon S3 location. Valid values are S3Prefix or ManifestFile."
        }
      },
      "required": [
        "S3Uri",
        "S3DataType"
      ]
    },
    "OptimizationConfig": {
      "type": "object",
      "properties": {
        "ModelQuantizationConfig": {
          "$ref": "#/$defs/ModelQuantizationConfig"
        },
        "ModelCompilationConfig": {
          "$ref": "#/$defs/ModelCompilationConfig"
        },
        "ModelShardingConfig": {
          "$ref": "#/$defs/ModelShardingConfig"
        },
        "ModelSpeculativeDecodingConfig": {
          "$ref": "#/$defs/ModelSpeculativeDecodingConfig"
        }
      },
      "description": "Exactly one member is set."
    },
    "OptimizationJobModelSource": {
      "type": "object",
      "properties": {
        "S3": {
          "$ref": "#/$defs/OptimizationJobModelSourceS3"
        },
        "SageMakerModel": {
          "$ref": "#/$defs/OptimizationSageMakerModel"
        }
      }
    },
    "OptimizationJobModelSourceS3": {
      "type": "object",
      "properties": {
        "S3Uri": {
          "type": "string",
          "description": "An Amazon S3 URI that locates a source model to optimize with an optimization job."
        },
        "ModelAccessConfig": {
          "$ref": "#/$defs/OptimizationModelAccessConfig"
        }
      }
    },
    "OptimizationJobOutputConfig": {
      "type": "object",
      "properties": {
        "KmsKeyId": {
          "type": "string",
          "description": "The Amazon Resource Name (ARN) of a key in Amazon Web Services KMS. SageMaker uses they key to encrypt the artifacts of the optimized model when SageMaker uploads the model to Amazon S3."
        },
        "S3OutputLocation": {
          "type": "string",
          "description": "The Amazon S3 URI for where to store the optimized model that you create with an optimization job."
        },
        "SageMakerModel": {
          "$ref": "#/$defs/OptimizationSageMakerModel"
        }
      },
      "required": [
        "S3OutputLocation"
      ]
    },
    "OptimizationModelAccessConfig": {
      "type": "object",
      "properties": {
        "AcceptEula": {
          "type": "boolean",
          "description": "Specifies agreement to the model end-user license agreement (EULA). The AcceptEula value must be explicitly defined as True in order to accept the EULA that this model requires. You are responsible for reviewing and complying with any applicable license terms and making sure they are acceptable for your use case before downloading or using a model."
        }
      },
      "required": [
        "AcceptEula"
      ]
    },
    "OptimizationOutput": {
      "type": "object",
      "properties": {
        "RecommendedInferenceImage": {
          "type": "string",
          "description": "The image that SageMaker recommends that you use to host the optimized model that you created with an optimization job."
        }
      }
    },
    "OptimizationSageMakerModel": {
      "type": "object",
      "properties": {
        "ModelName": {
          "type": "string",
          "description": "The name of a SageMaker model."
        }
      }
    },
    "OptimizationVpcConfig": {
      "type": "object",
      "properties": {
        "SecurityGroupIds": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The VPC security group IDs, in the form sg-xxxxxxxx. Specify the security groups for the VPC that is specified in the Subnets field."
        },
        "Subnets": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "The ID of the subnets in the VPC to which you want to connect your optimized model."
        }
      },
      "required": [
        "SecurityGroupIds",
        "Subnets"
      ]
    },
    "StoppingCondition": {
      "type": "object",
      "properties": {
        "MaxRuntimeInSeconds": {
          "type": "integer",
          "description": "The maximum length of time, in seconds, that a training or compilation job can run before it is stopped. For compilation jobs, if the job does not complete during this time, a TimeOut error is generated. We recommend starting with 900 seconds and increasing as necessary based on your model. For all other jobs, if the job does not complete during this time, SageMaker ends the job. When RetryStrategy is specified in the job request, MaxRuntimeInSeconds specifies the maximum time for all of the attempts in total, not each individual attempt. The default value is 1 day. The maximum value is 28 day"
        },
        "MaxWaitTimeInSeconds": {
          "type": "integer",
          "description": "The maximum length of time, in seconds, that a managed Spot training job has to complete. It is the amount of time spent waiting for Spot capacity plus the amount of time the job can run. It must be equal to or greater than MaxRuntimeInSeconds. If the job does not complete during this time, SageMaker ends the job. When RetryStrategy is specified in the job request, MaxWaitTimeInSeconds specifies the maximum time for all of the attempts in total, not each individual attempt."
        },
        "MaxPendingTimeInSeconds": {
          "type": "integer",
          "description": "The maximum length of time, in seconds, that a training or compilation job can be pending before it is stopped. When working with training jobs that use capacity from training plans, not all Pending job states count against the MaxPendingTimeInSeconds limit. The following scenarios do not increment the MaxPendingTimeInSeconds counter: The plan is in a Scheduled state: Jobs queued (in Pending status) before a plan's start date (waiting for scheduled start time) Between capacity reservations: Jobs temporarily back to Pending status between two capacity reservation periods MaxPendingTimeInSeconds"
        }
      }
    }
  }
}