{"files":{"SKILL.md":"---\nname: amazon-sagemaker-runtime\ndescription: \"Amazon SageMaker Runtime API skill. Use when working with Amazon SageMaker Runtime for endpoints. Covers 3 endpoints.\"\nversion: 1.0.0\ngenerator: lapsh\n---\n\n# Amazon SageMaker Runtime\nAPI version: 2017-05-13\n\n## Auth\nAWS SigV4\n\n## Base URL\nNot specified.\n\n## Setup\n1. Configure auth: AWS SigV4\n2. Verify API access with a test request\n3. POST /endpoints/{EndpointName}/invocations -- create first invocation\n\n## Endpoints\n3 endpoints across 1 group. See references/api-spec.lap for full details.\n\n### Endpoints\n| Method | Path | Description |\n|--------|------|-------------|\n| POST | /endpoints/{EndpointName}/invocations | 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. |\n| POST | /endpoints/{EndpointName}/async-invocations | 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 in an asynchronous manner. Inference requests sent to this API are enqueued for asynchronous processing. The processing of the inference request may or may not complete before you receive a response from this API. The response from this API will not contain the result of the inference request but contain information about where you can locate it. 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 InvokeEndpointAsync 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. |\n| POST | /endpoints/{EndpointName}/invocations-response-stream | Invokes a model at the specified endpoint to return the inference response as a stream. The inference stream provides the response payload incrementally as a series of parts. Before you can get an inference stream, you must have access to a model that's deployed using Amazon SageMaker hosting services, and the container for that model must support inference streaming. For more information that can help you use this API, see the following sections in the Amazon SageMaker Developer Guide:   For information about how to add streaming support to a model, see How Containers Serve Requests.   For information about how to process the streaming response, see Invoke real-time endpoints.   Before you can use this operation, your IAM permissions must allow the sagemaker:InvokeEndpoint action. For more information about Amazon SageMaker actions for IAM policies, see Actions, resources, and condition keys for Amazon SageMaker in the IAM Service Authorization Reference. 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 InvokeEndpointWithResponseStream 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. |\n\n## Common Questions\nMatch user requests to endpoints in references/api-spec.lap. Key patterns:\n- \"Create a invocation?\" -> POST /endpoints/{EndpointName}/invocations\n- \"Create a async-invocation?\" -> POST /endpoints/{EndpointName}/async-invocations\n- \"Create a invocations-response-stream?\" -> POST /endpoints/{EndpointName}/invocations-response-stream\n- \"How to authenticate?\" -> See Auth section above\n\n## Response Tips\n- Check response schemas in references/api-spec.lap for field details\n- Create/update endpoints return the modified resource on success\n- Error responses include status codes and descriptions in the spec\n\n## References\n- Full spec: See references/api-spec.lap for complete endpoint details, parameter tables, and response schemas\n\n> Generated from the official API spec by [LAP](https://lap.sh)\n","references/api-spec.lap":"@lap v0.3\n# Machine-readable API spec. Each @endpoint block is one API call.\n@api Amazon SageMaker Runtime\n@version 2017-05-13\n@auth AWS SigV4\n@endpoints 3\n@toc endpoints(3)\n\n@endpoint POST /endpoints/{EndpointName}/invocations\n@desc 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.\n@required {EndpointName: str, Body: bytes}\n@optional {Content-Type: str, Accept: str, X-Amzn-SageMaker-Custom-Attributes: str, X-Amzn-SageMaker-Target-Model: str, X-Amzn-SageMaker-Target-Variant: str, X-Amzn-SageMaker-Target-Container-Hostname: str, X-Amzn-SageMaker-Inference-Id: str, X-Amzn-SageMaker-Enable-Explanations: str, X-Amzn-SageMaker-Inference-Component: str}\n@returns(200) {Body: bytes, ContentType: str?, InvokedProductionVariant: str?, CustomAttributes: str?}\n\n@endpoint POST /endpoints/{EndpointName}/async-invocations\n@desc 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 in an asynchronous manner. Inference requests sent to this API are enqueued for asynchronous processing. The processing of the inference request may or may not complete before you receive a response from this API. The response from this API will not contain the result of the inference request but contain information about where you can locate it. 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 InvokeEndpointAsync 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.\n@required {EndpointName: str, X-Amzn-SageMaker-InputLocation: str}\n@optional {X-Amzn-SageMaker-Content-Type: str, X-Amzn-SageMaker-Accept: str, X-Amzn-SageMaker-Custom-Attributes: str, X-Amzn-SageMaker-Inference-Id: str, X-Amzn-SageMaker-RequestTTLSeconds: int, X-Amzn-SageMaker-InvocationTimeoutSeconds: int}\n@returns(200) {InferenceId: str?, OutputLocation: str?, FailureLocation: str?}\n\n@endpoint POST /endpoints/{EndpointName}/invocations-response-stream\n@desc Invokes a model at the specified endpoint to return the inference response as a stream. The inference stream provides the response payload incrementally as a series of parts. Before you can get an inference stream, you must have access to a model that's deployed using Amazon SageMaker hosting services, and the container for that model must support inference streaming. For more information that can help you use this API, see the following sections in the Amazon SageMaker Developer Guide:   For information about how to add streaming support to a model, see How Containers Serve Requests.   For information about how to process the streaming response, see Invoke real-time endpoints.   Before you can use this operation, your IAM permissions must allow the sagemaker:InvokeEndpoint action. For more information about Amazon SageMaker actions for IAM policies, see Actions, resources, and condition keys for Amazon SageMaker in the IAM Service Authorization Reference. 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 InvokeEndpointWithResponseStream 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.\n@required {EndpointName: str, Body: bytes}\n@optional {Content-Type: str, X-Amzn-SageMaker-Accept: str, X-Amzn-SageMaker-Custom-Attributes: str, X-Amzn-SageMaker-Target-Variant: str, X-Amzn-SageMaker-Target-Container-Hostname: str, X-Amzn-SageMaker-Inference-Id: str, X-Amzn-SageMaker-Inference-Component: str}\n@returns(200) {Body: ResponseStream{PayloadPart: PayloadPart?{Bytes: bytes?}, ModelStreamError: ModelStreamError?{Message: str?, ErrorCode: str?}, InternalStreamFailure: InternalStreamFailure?{Message: str?}}, ContentType: str?, InvokedProductionVariant: str?, CustomAttributes: str?}\n@errors {500: An error occurred while streaming the response body. This error can have the following error codes:  ModelInvocationTimeExceeded  The model failed to finish sending the response within the timeout period allowed by Amazon SageMaker.  StreamBroken  The Transmission Control Protocol (TCP) connection between the client and the model was reset or closed., 500: The stream processing failed because of an unknown error, exception or failure. Try your request again.}\n\n@end\n"}}