Invoke the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. The response is returned in a stream.
To see if a model supports streaming, call GetFoundationModel and check the responseStreamingSupported field in the response.
The CLI doesn't support streaming operations in Amazon Bedrock, including InvokeModelWithResponseStream.
For example code, see Invoke model with streaming code example in the Amazon Bedrock User Guide.
This operation requires permissions to perform the bedrock:InvokeModelWithResponseStream action.
To deny all inference access to resources that you specify in the modelId field, you need to deny access to the bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream actions. Doing this also denies access to the resource through the Converse API actions (Converse and ConverseStream). For more information see Deny access for inference on specific models.
For troubleshooting some of the common errors you might encounter when using the InvokeModelWithResponseStream API, see Troubleshooting Amazon Bedrock API Error Codes in the Amazon Bedrock User Guide
Path parameters
Headers
The MIME type of the input data in the request. You must specify <code>application/json</code>.
The desired MIME type of the inference body in the response. The default value is <code>application/json</code>.
Specifies whether to enable or disable the Bedrock trace. If enabled, you can see the full Bedrock trace.
The version number for the guardrail. The value can also be <code>DRAFT</code>.
Model performance settings for the request.
Specifies the processing tier type used for serving the request.
Key-value pairs that you can use to filter invocation logs.
Request body
Response
Success