Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Curl an Amazon Sagemaker Endpoint

What is a is the curl command to make a POST request to sage-maker and receive a ML inference?

like image 672
tlanigan Avatar asked Dec 15 '17 21:12

tlanigan


3 Answers

If you want to simply send a POST request and check, you can use the postman and in the Authorization tab select the AWS Signature and add the Access and Secret key from the aws account.

But as mentioned it is recommended to use the Sage maker run time client for API call invocations.

enter image description here

like image 71
Nirojan Selvanathan Avatar answered Nov 03 '22 08:11

Nirojan Selvanathan


This is how I do it (on MacOS):

$ (echo -n '{ INSERT JSON HERE }') | curl -H "Content-Type: application/json" -d @- $ENDPOINT_URL
like image 23
Julien Simon Avatar answered Nov 03 '22 08:11

Julien Simon


Rather than using curl, it's recommended that you use the SageMaker Runtime client to send data and get back inferences from a SageMaker Endpoint:

http://docs.aws.amazon.com/sagemaker/latest/dg/API_runtime_InvokeEndpoint.html

like image 3
Andre Avatar answered Nov 03 '22 07:11

Andre