AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

After you deploy a model into production using Amazon SageMaker hosting services, your client applications use this API to get inferences from the model hosted at the specified endpoint.

For an overview of Amazon SageMaker, see How It Works.

Amazon SageMaker strips all POST headers except those supported by the API. Amazon SageMaker might add additional headers. You should not rely on the behavior of headers outside those enumerated in the request syntax.

Calls to InvokeEndpoint are authenticated by using Amazon Web Services Signature Version 4. For information, see Authenticating Requests (Amazon Web Services Signature Version 4) in the Amazon S3 API Reference.

A customer's model containers must respond to requests within 60 seconds. The model itself can have a maximum processing time of 60 seconds before responding to invocations. If your model is going to take 50-60 seconds of processing time, the SDK socket timeout should be set to be 70 seconds.

Endpoints are scoped to an individual account, and are not public. The URL does not contain the account ID, but Amazon SageMaker determines the account ID from the authentication token that is supplied by the caller.

Note:

This is an asynchronous operation using the standard naming convention for .NET 4.5 or higher. For .NET 3.5 the operation is implemented as a pair of methods using the standard naming convention of BeginInvokeEndpoint and EndInvokeEndpoint.

Namespace: Amazon.SageMakerRuntime
Assembly: AWSSDK.SageMakerRuntime.dll
Version: 3.x.y.z

Syntax

C#
public abstract Task<InvokeEndpointResponse> InvokeEndpointAsync(
         InvokeEndpointRequest request,
         CancellationToken cancellationToken
)

Parameters

request
Type: Amazon.SageMakerRuntime.Model.InvokeEndpointRequest

Container for the necessary parameters to execute the InvokeEndpoint service method.

cancellationToken
Type: System.Threading.CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Return Value


The response from the InvokeEndpoint service method, as returned by SageMakerRuntime.

Exceptions

ExceptionCondition
InternalDependencyException Your request caused an exception with an internal dependency. Contact customer support.
InternalFailureException An internal failure occurred.
ModelErrorException Model (owned by the customer in the container) returned 4xx or 5xx error code.
ModelNotReadyException Either a serverless endpoint variant's resources are still being provisioned, or a multi-model endpoint is still downloading or loading the target model. Wait and try your request again.
ServiceUnavailableException The service is unavailable. Try your call again.
ValidationErrorException Inspect your request and try again.

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5

See Also