Skip to main content

Call SageMaker endpoint

Send a request as it is to any Amazon SageMaker endpoint (a model of any kind: forecasting, classification, pictures) and return its answer as text.

Command in the Generative AI toolkit · id ooa.genai/invoke_endpoint · 19 inputs (1 required), 4 outputs

Inputs​

InputTypeRequiredDefaultWhat it is
Endpoint nameStringYesName of the SageMaker endpoint.
BodyStringNoThe request body, sent as it is.
Body fileFileNoA file whose bytes are the request body (a picture, a CSV or protobuf file); at most 25 MB.
Content typeStringNoapplication/jsonWhat the body is; image/* takes the picture type from the file's extension; custom: give it in custom_content_type.
Custom content typeStringNoThe content type, when content_type is custom.
ConnectionStringNoName of a Model Connection (provider, model and key managed in one place). Leave empty to set them on this action.
API keyCredentialNoThe AWS secret access key from the vault (or ACCESS_KEY_ID:SECRET).
AWS access key IDCredentialNoThe AWS access key id from the vault.
AWS session tokenCredentialNoAWS Bedrock and AWS SageMaker only: the session token from the vault, when the access key is a temporary one (for example from an assumed role).
AWS regionStringNoAWS region of the endpoint.
Endpoint addressStringNoAnother address for the SageMaker runtime (a private endpoint); https://runtime.sagemaker.REGION.amazonaws.com when empty.
AcceptStringNo*/*The answer type to ask for; any when /.
Custom attributesStringNoExtra information passed to the model's code as it is, up to 1024 characters.
Enable explanationsStringNoWith SageMaker Clarify explanations set up: an expression saying which answers to explain.
Inference IDStringNoYour id for this request, kept with the captured data (up to 64 characters).
Target container hostnameStringNoWhich container answers, on an endpoint with several containers called directly.
Target modelStringNoWhich model answers, on a multi-model endpoint.
Target variantStringNoWhich production variant answers, instead of the endpoint's own split.
Timeout (seconds)NumberNo0Seconds to wait for the model; 180 when 0.

Outputs​

OutputTypeWhat it is
textStringThe endpoint's answer as text.
jsonAnyThe answer parsed as JSON, when it is JSON.
content_typeStringThe answer's content type, as the endpoint gave it.
invoked_variantStringThe endpoint variant that answered.