StartAsyncInvoke
Starts an asynchronous invocation.
This operation requires permission for the bedrock:InvokeModel
action.
Important
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.
Request Syntax
POST /async-invoke HTTP/1.1
Content-type: application/json
{
"clientRequestToken": "string
",
"modelId": "string
",
"modelInput": JSON value
,
"outputDataConfig": { ... },
"tags": [
{
"key": "string
",
"value": "string
"
}
]
}
URI Request Parameters
The request does not use any URI parameters.
Request Body
The request accepts the following data in JSON format.
- clientRequestToken
-
Specify idempotency token to ensure that requests are not duplicated.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 256.
Pattern:
^[!-~]*$
Required: No
- modelId
-
The model to invoke.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 256.
Pattern:
^[a-zA-Z_\.\-/0-9:]+$
Required: Yes
- modelInput
-
Input to send to the model.
Type: JSON value
Required: Yes
- outputDataConfig
-
Where to store the output.
Type: AsyncInvokeOutputDataConfig object
Note: This object is a Union. Only one member of this object can be specified or returned.
Required: Yes
-
Tags to apply to the invocation.
Type: Array of Tag objects
Array Members: Minimum number of 0 items. Maximum number of 200 items.
Required: No
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"invocationArn": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- invocationArn
-
The ARN of the invocation.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 2048.
Pattern:
^arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:async-invoke/[a-z0-9]{12}$
Errors
For information about the errors that are common to all actions, see Common Errors.
- AccessDeniedException
-
The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error, see AccessDeniedException in the Amazon Bedrock User Guide
HTTP Status Code: 403
- ConflictException
-
Error occurred because of a conflict while performing an operation.
HTTP Status Code: 400
- InternalServerException
-
An internal server error occurred. For troubleshooting this error, see InternalFailure in the Amazon Bedrock User Guide
HTTP Status Code: 500
- ResourceNotFoundException
-
The specified resource ARN was not found. For troubleshooting this error, see ResourceNotFound in the Amazon Bedrock User Guide
HTTP Status Code: 404
- ServiceQuotaExceededException
-
Your request exceeds the service quota for your account. You can view your quotas at Viewing service quotas. You can resubmit your request later.
HTTP Status Code: 400
- ServiceUnavailableException
-
The service isn't currently available. For troubleshooting this error, see ServiceUnavailable in the Amazon Bedrock User Guide
HTTP Status Code: 503
- ThrottlingException
-
Your request was denied due to exceeding the account quotas for Amazon Bedrock. For troubleshooting this error, see ThrottlingException in the Amazon Bedrock User Guide
HTTP Status Code: 429
- ValidationException
-
The input fails to satisfy the constraints specified by Amazon Bedrock. For troubleshooting this error, see ValidationError in the Amazon Bedrock User Guide
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: