Invokes the specified Amazon Bedrock model to run inference using the prompt and inference parameters provided in the request body. You use model inference to generate text, images, and embeddings.
For example code, see Invoke model code examples in the Amazon Bedrock User Guide.
This operation requires permission for the bedrock:InvokeModel 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 InvokeModel 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