Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Request Inferences from a Deployed Service (AWS CLI)

Focus mode
Request Inferences from a Deployed Service (AWS CLI) - Amazon SageMaker AI

Inference requests can be made with the sagemaker-runtime invoke-endpoint once you have an Amazon SageMaker AI endpoint InService. You can make inference requests with the AWS Command Line Interface (AWS CLI). The following example shows how to send an image for inference:

aws sagemaker-runtime invoke-endpoint --endpoint-name 'insert name of your endpoint here' --body fileb://image.jpg --content-type=application/x-image output_file.txt

An output_file.txt with information about your inference requests is made if the inference was successful.

For TensorFlow submit an input with application/json as the content type.

aws sagemaker-runtime invoke-endpoint --endpoint-name 'insert name of your endpoint here' --body fileb://input.json --content-type=application/json output_file.txt
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.