CreateInferenceRecommendationsJob - Amazon SageMaker
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).


Starts a recommendation job. You can create either an instance recommendation or load test job.

Request Syntax

{ "InputConfig": { "ContainerConfig": { "DataInputConfig": "string", "Domain": "string", "Framework": "string", "FrameworkVersion": "string", "NearestModelName": "string", "PayloadConfig": { "SamplePayloadUrl": "string", "SupportedContentTypes": [ "string" ] }, "SupportedEndpointType": "string", "SupportedInstanceTypes": [ "string" ], "SupportedResponseMIMETypes": [ "string" ], "Task": "string" }, "EndpointConfigurations": [ { "EnvironmentParameterRanges": { "CategoricalParameterRanges": [ { "Name": "string", "Value": [ "string" ] } ] }, "InferenceSpecificationName": "string", "InstanceType": "string", "ServerlessConfig": { "MaxConcurrency": number, "MemorySizeInMB": number, "ProvisionedConcurrency": number } } ], "Endpoints": [ { "EndpointName": "string" } ], "JobDurationInSeconds": number, "ModelName": "string", "ModelPackageVersionArn": "string", "ResourceLimit": { "MaxNumberOfTests": number, "MaxParallelOfTests": number }, "TrafficPattern": { "Phases": [ { "DurationInSeconds": number, "InitialNumberOfUsers": number, "SpawnRate": number } ], "Stairs": { "DurationInSeconds": number, "NumberOfSteps": number, "UsersPerStep": number }, "TrafficType": "string" }, "VolumeKmsKeyId": "string", "VpcConfig": { "SecurityGroupIds": [ "string" ], "Subnets": [ "string" ] } }, "JobDescription": "string", "JobName": "string", "JobType": "string", "OutputConfig": { "CompiledOutputConfig": { "S3OutputUri": "string" }, "KmsKeyId": "string" }, "RoleArn": "string", "StoppingConditions": { "FlatInvocations": "string", "MaxInvocations": number, "ModelLatencyThresholds": [ { "Percentile": "string", "ValueInMilliseconds": number } ] }, "Tags": [ { "Key": "string", "Value": "string" } ] }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.


Provides information about the versioned model package Amazon Resource Name (ARN), the traffic pattern, and endpoint configurations.

Type: RecommendationJobInputConfig object

Required: Yes


Description of the recommendation job.

Type: String

Length Constraints: Maximum length of 128.

Required: No


A name for the recommendation job. The name must be unique within the Amazon Region and within your Amazon account. The job name is passed down to the resources created by the recommendation job. The names of resources (such as the model, endpoint configuration, endpoint, and compilation) that are prefixed with the job name are truncated at 40 characters.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 64.

Pattern: ^[a-zA-Z0-9](-*[a-zA-Z0-9]){0,63}

Required: Yes


Defines the type of recommendation job. Specify Default to initiate an instance recommendation and Advanced to initiate a load test. If left unspecified, Amazon SageMaker Inference Recommender will run an instance recommendation (DEFAULT) job.

Type: String

Valid Values: Default | Advanced

Required: Yes


Provides information about the output artifacts and the KMS key to use for Amazon S3 server-side encryption.

Type: RecommendationJobOutputConfig object

Required: No


The Amazon Resource Name (ARN) of an IAM role that enables Amazon SageMaker to perform tasks on your behalf.

Type: String

Length Constraints: Minimum length of 20. Maximum length of 2048.

Pattern: ^arn:aws[a-z\-]*:iam::\d{12}:role/?[a-zA-Z_0-9+=,.@\-_/]+$

Required: Yes


A set of conditions for stopping a recommendation job. If any of the conditions are met, the job is automatically stopped.

Type: RecommendationJobStoppingConditions object

Required: No


The metadata that you apply to Amazon resources to help you categorize and organize them. Each tag consists of a key and a value, both of which you define. For more information, see Tagging Amazon Resources in the Amazon General Reference.

Type: Array of Tag objects

Array Members: Minimum number of 0 items. Maximum number of 50 items.

Required: No

Response Syntax

{ "JobArn": "string" }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.


The Amazon Resource Name (ARN) of the recommendation job.

Type: String

Length Constraints: Maximum length of 256.

Pattern: arn:aws[a-z\-]*:sagemaker:[a-z0-9\-]*:[0-9]{12}:inference-recommendations-job/.*


For information about the errors that are common to all actions, see Common Errors.


Resource being accessed is in use.

HTTP Status Code: 400


You have exceeded an SageMaker resource limit. For example, you might have too many training jobs created.

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific Amazon SDKs, see the following: