{ "version":"2.0", "metadata":{ "apiVersion":"2023-09-30", "endpointPrefix":"bedrock-runtime", "jsonVersion":"1.1", "protocol":"rest-json", "serviceFullName":"Amazon Bedrock Runtime", "serviceId":"Bedrock Runtime", "signatureVersion":"v4", "signingName":"bedrock", "uid":"bedrock-runtime-2023-09-30" }, "operations":{ "InvokeModel":{ "name":"InvokeModel", "http":{ "method":"POST", "requestUri":"/model/{modelId}/invoke", "responseCode":200 }, "input":{"shape":"InvokeModelRequest"}, "output":{"shape":"InvokeModelResponse"}, "errors":[ {"shape":"AccessDeniedException"}, {"shape":"ResourceNotFoundException"}, {"shape":"ThrottlingException"}, {"shape":"ModelTimeoutException"}, {"shape":"InternalServerException"}, {"shape":"ValidationException"}, {"shape":"ModelNotReadyException"}, {"shape":"ServiceQuotaExceededException"}, {"shape":"ModelErrorException"} ], "documentation":"

Invokes the specified Bedrock model to run inference using the input provided in the request body. You use InvokeModel to run inference for text models, image models, and embedding models.

For more information, see Run inference in the Bedrock User Guide.

For example requests, see Examples (after the Errors section).

" }, "InvokeModelWithResponseStream":{ "name":"InvokeModelWithResponseStream", "http":{ "method":"POST", "requestUri":"/model/{modelId}/invoke-with-response-stream", "responseCode":200 }, "input":{"shape":"InvokeModelWithResponseStreamRequest"}, "output":{"shape":"InvokeModelWithResponseStreamResponse"}, "errors":[ {"shape":"AccessDeniedException"}, {"shape":"ResourceNotFoundException"}, {"shape":"ThrottlingException"}, {"shape":"ModelTimeoutException"}, {"shape":"InternalServerException"}, {"shape":"ModelStreamErrorException"}, {"shape":"ValidationException"}, {"shape":"ModelNotReadyException"}, {"shape":"ServiceQuotaExceededException"}, {"shape":"ModelErrorException"} ], "documentation":"

Invoke the specified Bedrock model to run inference using the input provided. Return the response in a stream.

For more information, see Run inference in the Bedrock User Guide.

For an example request and response, see Examples (after the Errors section).

" } }, "shapes":{ "AccessDeniedException":{ "type":"structure", "members":{ "message":{"shape":"NonBlankString"} }, "documentation":"

The request is denied because of missing access permissions.

", "error":{ "httpStatusCode":403, "senderFault":true }, "exception":true }, "Body":{ "type":"blob", "max":25000000, "min":0, "sensitive":true }, "InternalServerException":{ "type":"structure", "members":{ "message":{"shape":"NonBlankString"} }, "documentation":"

An internal server error occurred. Retry your request.

", "error":{"httpStatusCode":500}, "exception":true, "fault":true }, "InvokeModelIdentifier":{ "type":"string", "max":2048, "min":1, "pattern":"(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:(([0-9]{12}:custom-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}/[a-z0-9]{12})|(:foundation-model/[a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|([0-9]{12}:provisioned-model/[a-z0-9]{12})))|([a-z0-9-]{1,63}[.]{1}[a-z0-9-]{1,63}([.:]?[a-z0-9-]{1,63}))|(([0-9a-zA-Z][_-]?)+)" }, "InvokeModelRequest":{ "type":"structure", "required":[ "body", "modelId" ], "members":{ "body":{ "shape":"Body", "documentation":"

Input data in the format specified in the content-type request header. To see the format and content of this field for different models, refer to Inference parameters.

" }, "contentType":{ "shape":"MimeType", "documentation":"

The MIME type of the input data in the request. The default value is application/json.

", "location":"header", "locationName":"Content-Type" }, "accept":{ "shape":"MimeType", "documentation":"

The desired MIME type of the inference body in the response. The default value is application/json.

", "location":"header", "locationName":"Accept" }, "modelId":{ "shape":"InvokeModelIdentifier", "documentation":"

Identifier of the model.

", "location":"uri", "locationName":"modelId" } }, "payload":"body" }, "InvokeModelResponse":{ "type":"structure", "required":[ "body", "contentType" ], "members":{ "body":{ "shape":"Body", "documentation":"

Inference response from the model in the format specified in the content-type header field. To see the format and content of this field for different models, refer to Inference parameters.

" }, "contentType":{ "shape":"MimeType", "documentation":"

The MIME type of the inference result.

", "location":"header", "locationName":"Content-Type" } }, "payload":"body" }, "InvokeModelWithResponseStreamRequest":{ "type":"structure", "required":[ "body", "modelId" ], "members":{ "body":{ "shape":"Body", "documentation":"

Inference input in the format specified by the content-type. To see the format and content of this field for different models, refer to Inference parameters.

" }, "contentType":{ "shape":"MimeType", "documentation":"

The MIME type of the input data in the request. The default value is application/json.

", "location":"header", "locationName":"Content-Type" }, "accept":{ "shape":"MimeType", "documentation":"

The desired MIME type of the inference body in the response. The default value is application/json.

", "location":"header", "locationName":"X-Amzn-Bedrock-Accept" }, "modelId":{ "shape":"InvokeModelIdentifier", "documentation":"

Id of the model to invoke using the streaming request.

", "location":"uri", "locationName":"modelId" } }, "payload":"body" }, "InvokeModelWithResponseStreamResponse":{ "type":"structure", "required":[ "body", "contentType" ], "members":{ "body":{ "shape":"ResponseStream", "documentation":"

Inference response from the model in the format specified by Content-Type. To see the format and content of this field for different models, refer to Inference parameters.

" }, "contentType":{ "shape":"MimeType", "documentation":"

The MIME type of the inference result.

", "location":"header", "locationName":"X-Amzn-Bedrock-Content-Type" } }, "payload":"body" }, "MimeType":{"type":"string"}, "ModelErrorException":{ "type":"structure", "members":{ "message":{"shape":"NonBlankString"}, "originalStatusCode":{ "shape":"StatusCode", "documentation":"

The original status code.

" }, "resourceName":{ "shape":"NonBlankString", "documentation":"

The resource name.

" } }, "documentation":"

The request failed due to an error while processing the model.

", "error":{ "httpStatusCode":424, "senderFault":true }, "exception":true }, "ModelNotReadyException":{ "type":"structure", "members":{ "message":{"shape":"NonBlankString"} }, "documentation":"

The model specified in the request is not ready to serve inference requests.

", "error":{ "httpStatusCode":429, "senderFault":true }, "exception":true }, "ModelStreamErrorException":{ "type":"structure", "members":{ "message":{"shape":"NonBlankString"}, "originalStatusCode":{ "shape":"StatusCode", "documentation":"

The original status code.

" }, "originalMessage":{ "shape":"NonBlankString", "documentation":"

The original message.

" } }, "documentation":"

An error occurred while streaming the response.

", "error":{ "httpStatusCode":424, "senderFault":true }, "exception":true }, "ModelTimeoutException":{ "type":"structure", "members":{ "message":{"shape":"NonBlankString"} }, "documentation":"

The request took too long to process. Processing time exceeded the model timeout length.

", "error":{ "httpStatusCode":408, "senderFault":true }, "exception":true }, "NonBlankString":{ "type":"string", "pattern":"[\\s\\S]*" }, "PartBody":{ "type":"blob", "max":1000000, "min":0, "sensitive":true }, "PayloadPart":{ "type":"structure", "members":{ "bytes":{ "shape":"PartBody", "documentation":"

Base64-encoded bytes of payload data.

" } }, "documentation":"

Payload content included in the response.

", "event":true, "sensitive":true }, "ResourceNotFoundException":{ "type":"structure", "members":{ "message":{"shape":"NonBlankString"} }, "documentation":"

The specified resource ARN was not found. Check the ARN and try your request again.

", "error":{ "httpStatusCode":404, "senderFault":true }, "exception":true }, "ResponseStream":{ "type":"structure", "members":{ "chunk":{ "shape":"PayloadPart", "documentation":"

Content included in the response.

" }, "internalServerException":{"shape":"InternalServerException"}, "modelStreamErrorException":{"shape":"ModelStreamErrorException"}, "validationException":{"shape":"ValidationException"}, "throttlingException":{"shape":"ThrottlingException"}, "modelTimeoutException":{"shape":"ModelTimeoutException"} }, "documentation":"

Definition of content in the response stream.

", "eventstream":true }, "ServiceQuotaExceededException":{ "type":"structure", "members":{ "message":{"shape":"NonBlankString"} }, "documentation":"

The number of requests exceeds the service quota. Resubmit your request later.

", "error":{ "httpStatusCode":400, "senderFault":true }, "exception":true }, "StatusCode":{ "type":"integer", "box":true, "max":599, "min":100 }, "ThrottlingException":{ "type":"structure", "members":{ "message":{"shape":"NonBlankString"} }, "documentation":"

The number of requests exceeds the limit. Resubmit your request later.

", "error":{ "httpStatusCode":429, "senderFault":true }, "exception":true }, "ValidationException":{ "type":"structure", "members":{ "message":{"shape":"NonBlankString"} }, "documentation":"

Input validation failed. Check your request parameters and retry the request.

", "error":{ "httpStatusCode":400, "senderFault":true }, "exception":true } }, "documentation":"

Describes the API operations for running inference using Bedrock models.

" }