2026/02/27 - Amazon Bedrock - 5 updated api methods
Changes Added four new model lifecycle date fields, startOfLifeTime, endOfLifeTime, legacyTime, and publicExtendedAccessTime. Adds support for using the Converse API with Bedrock Batch inference jobs.
{'modelInvocationType': 'InvokeModel | Converse'}
Creates a batch inference job to invoke a model on multiple prompts. Format your data according to Format your inference data and upload it to an Amazon S3 bucket. For more information, see Process multiple prompts with batch inference.
The response returns a jobArn that you can use to stop or get details about the job.
See also: AWS API Documentation
Request Syntax
client.create_model_invocation_job(
jobName='string',
roleArn='string',
clientRequestToken='string',
modelId='string',
inputDataConfig={
's3InputDataConfig': {
's3InputFormat': 'JSONL',
's3Uri': 'string',
's3BucketOwner': 'string'
}
},
outputDataConfig={
's3OutputDataConfig': {
's3Uri': 'string',
's3EncryptionKeyId': 'string',
's3BucketOwner': 'string'
}
},
vpcConfig={
'subnetIds': [
'string',
],
'securityGroupIds': [
'string',
]
},
timeoutDurationInHours=123,
tags=[
{
'key': 'string',
'value': 'string'
},
],
modelInvocationType='InvokeModel'|'Converse'
)
string
[REQUIRED]
A name to give the batch inference job.
string
[REQUIRED]
The Amazon Resource Name (ARN) of the service role with permissions to carry out and manage batch inference. You can use the console to create a default service role or follow the steps at Create a service role for batch inference.
string
A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.
This field is autopopulated if not provided.
string
[REQUIRED]
The unique identifier of the foundation model to use for the batch inference job.
dict
[REQUIRED]
Details about the location of the input to the batch inference job.
s3InputDataConfig (dict) --
Contains the configuration of the S3 location of the input data.
s3InputFormat (string) --
The format of the input data.
s3Uri (string) -- [REQUIRED]
The S3 location of the input data.
s3BucketOwner (string) --
The ID of the Amazon Web Services account that owns the S3 bucket containing the input data.
dict
[REQUIRED]
Details about the location of the output of the batch inference job.
s3OutputDataConfig (dict) --
Contains the configuration of the S3 location of the output data.
s3Uri (string) -- [REQUIRED]
The S3 location of the output data.
s3EncryptionKeyId (string) --
The unique identifier of the key that encrypts the S3 location of the output data.
s3BucketOwner (string) --
The ID of the Amazon Web Services account that owns the S3 bucket containing the output data.
dict
The configuration of the Virtual Private Cloud (VPC) for the data in the batch inference job. For more information, see Protect batch inference jobs using a VPC.
subnetIds (list) -- [REQUIRED]
An array of IDs for each subnet in the VPC to use.
(string) --
securityGroupIds (list) -- [REQUIRED]
An array of IDs for each security group in the VPC to use.
(string) --
integer
The number of hours after which to force the batch inference job to time out.
list
Any tags to associate with the batch inference job. For more information, see Tagging Amazon Bedrock resources.
(dict) --
Definition of the key/value pair for a tag.
key (string) -- [REQUIRED]
Key for the tag.
value (string) -- [REQUIRED]
Value for the tag.
string
The invocation endpoint for ModelInvocationJob
dict
Response Syntax
{
'jobArn': 'string'
}
Response Structure
(dict) --
jobArn (string) --
The Amazon Resource Name (ARN) of the batch inference job.
{'modelDetails': {'modelLifecycle': {'endOfLifeTime': 'timestamp',
'legacyTime': 'timestamp',
'publicExtendedAccessTime': 'timestamp',
'startOfLifeTime': 'timestamp'}}}
Get details about a Amazon Bedrock foundation model.
See also: AWS API Documentation
Request Syntax
client.get_foundation_model(
modelIdentifier='string'
)
string
[REQUIRED]
The model identifier.
dict
Response Syntax
{
'modelDetails': {
'modelArn': 'string',
'modelId': 'string',
'modelName': 'string',
'providerName': 'string',
'inputModalities': [
'TEXT'|'IMAGE'|'EMBEDDING',
],
'outputModalities': [
'TEXT'|'IMAGE'|'EMBEDDING',
],
'responseStreamingSupported': True|False,
'customizationsSupported': [
'FINE_TUNING'|'CONTINUED_PRE_TRAINING'|'DISTILLATION',
],
'inferenceTypesSupported': [
'ON_DEMAND'|'PROVISIONED',
],
'modelLifecycle': {
'status': 'ACTIVE'|'LEGACY',
'startOfLifeTime': datetime(2015, 1, 1),
'endOfLifeTime': datetime(2015, 1, 1),
'legacyTime': datetime(2015, 1, 1),
'publicExtendedAccessTime': datetime(2015, 1, 1)
}
}
}
Response Structure
(dict) --
modelDetails (dict) --
Information about the foundation model.
modelArn (string) --
The model Amazon Resource Name (ARN).
modelId (string) --
The model identifier.
modelName (string) --
The model name.
providerName (string) --
The model's provider name.
inputModalities (list) --
The input modalities that the model supports.
(string) --
outputModalities (list) --
The output modalities that the model supports.
(string) --
responseStreamingSupported (boolean) --
Indicates whether the model supports streaming.
customizationsSupported (list) --
The customization that the model supports.
(string) --
inferenceTypesSupported (list) --
The inference types that the model supports.
(string) --
modelLifecycle (dict) --
Contains details about whether a model version is available or deprecated
status (string) --
Specifies whether a model version is available ( ACTIVE) or deprecated ( LEGACY.
startOfLifeTime (datetime) --
Launch time when the model first becomes available
endOfLifeTime (datetime) --
Time when the model is no longer available for use
legacyTime (datetime) --
Time when the model enters legacy state. Models in legacy state can still be used, but users should plan to transition to an Active model before the end of life time
publicExtendedAccessTime (datetime) --
Public extended access portion of the legacy period, when users should expect higher pricing
{'modelInvocationType': 'InvokeModel | Converse'}
Gets details about a batch inference job. For more information, see Monitor batch inference jobs
See also: AWS API Documentation
Request Syntax
client.get_model_invocation_job(
jobIdentifier='string'
)
string
[REQUIRED]
The Amazon Resource Name (ARN) of the batch inference job.
dict
Response Syntax
{
'jobArn': 'string',
'jobName': 'string',
'modelId': 'string',
'clientRequestToken': 'string',
'roleArn': 'string',
'status': 'Submitted'|'InProgress'|'Completed'|'Failed'|'Stopping'|'Stopped'|'PartiallyCompleted'|'Expired'|'Validating'|'Scheduled',
'message': 'string',
'submitTime': datetime(2015, 1, 1),
'lastModifiedTime': datetime(2015, 1, 1),
'endTime': datetime(2015, 1, 1),
'inputDataConfig': {
's3InputDataConfig': {
's3InputFormat': 'JSONL',
's3Uri': 'string',
's3BucketOwner': 'string'
}
},
'outputDataConfig': {
's3OutputDataConfig': {
's3Uri': 'string',
's3EncryptionKeyId': 'string',
's3BucketOwner': 'string'
}
},
'vpcConfig': {
'subnetIds': [
'string',
],
'securityGroupIds': [
'string',
]
},
'timeoutDurationInHours': 123,
'jobExpirationTime': datetime(2015, 1, 1),
'modelInvocationType': 'InvokeModel'|'Converse'
}
Response Structure
(dict) --
jobArn (string) --
The Amazon Resource Name (ARN) of the batch inference job.
jobName (string) --
The name of the batch inference job.
modelId (string) --
The unique identifier of the foundation model used for model inference.
clientRequestToken (string) --
A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.
roleArn (string) --
The Amazon Resource Name (ARN) of the service role with permissions to carry out and manage batch inference. You can use the console to create a default service role or follow the steps at Create a service role for batch inference.
status (string) --
The status of the batch inference job.
The following statuses are possible:
Submitted – This job has been submitted to a queue for validation.
Validating – This job is being validated for the requirements described in Format and upload your batch inference data. The criteria include the following:
Your IAM service role has access to the Amazon S3 buckets containing your files.
Your files are .jsonl files and each individual record is a JSON object in the correct format. Note that validation doesn't check if the modelInput value matches the request body for the model.
Your files fulfill the requirements for file size and number of records. For more information, see Quotas for Amazon Bedrock.
Scheduled – This job has been validated and is now in a queue. The job will automatically start when it reaches its turn.
Expired – This job timed out because it was scheduled but didn't begin before the set timeout duration. Submit a new job request.
InProgress – This job has begun. You can start viewing the results in the output S3 location.
Completed – This job has successfully completed. View the output files in the output S3 location.
PartiallyCompleted – This job has partially completed. Not all of your records could be processed in time. View the output files in the output S3 location.
Failed – This job has failed. Check the failure message for any further details. For further assistance, reach out to the Amazon Web Services Support Center.
Stopped – This job was stopped by a user.
Stopping – This job is being stopped by a user.
message (string) --
If the batch inference job failed, this field contains a message describing why the job failed.
submitTime (datetime) --
The time at which the batch inference job was submitted.
lastModifiedTime (datetime) --
The time at which the batch inference job was last modified.
endTime (datetime) --
The time at which the batch inference job ended.
inputDataConfig (dict) --
Details about the location of the input to the batch inference job.
s3InputDataConfig (dict) --
Contains the configuration of the S3 location of the input data.
s3InputFormat (string) --
The format of the input data.
s3Uri (string) --
The S3 location of the input data.
s3BucketOwner (string) --
The ID of the Amazon Web Services account that owns the S3 bucket containing the input data.
outputDataConfig (dict) --
Details about the location of the output of the batch inference job.
s3OutputDataConfig (dict) --
Contains the configuration of the S3 location of the output data.
s3Uri (string) --
The S3 location of the output data.
s3EncryptionKeyId (string) --
The unique identifier of the key that encrypts the S3 location of the output data.
s3BucketOwner (string) --
The ID of the Amazon Web Services account that owns the S3 bucket containing the output data.
vpcConfig (dict) --
The configuration of the Virtual Private Cloud (VPC) for the data in the batch inference job. For more information, see Protect batch inference jobs using a VPC.
subnetIds (list) --
An array of IDs for each subnet in the VPC to use.
(string) --
securityGroupIds (list) --
An array of IDs for each security group in the VPC to use.
(string) --
timeoutDurationInHours (integer) --
The number of hours after which batch inference job was set to time out.
jobExpirationTime (datetime) --
The time at which the batch inference job times or timed out.
modelInvocationType (string) --
The invocation endpoint for ModelInvocationJob
{'modelSummaries': {'modelLifecycle': {'endOfLifeTime': 'timestamp',
'legacyTime': 'timestamp',
'publicExtendedAccessTime': 'timestamp',
'startOfLifeTime': 'timestamp'}}}
Lists Amazon Bedrock foundation models that you can use. You can filter the results with the request parameters. For more information, see Foundation models in the Amazon Bedrock User Guide.
See also: AWS API Documentation
Request Syntax
client.list_foundation_models(
byProvider='string',
byCustomizationType='FINE_TUNING'|'CONTINUED_PRE_TRAINING'|'DISTILLATION',
byOutputModality='TEXT'|'IMAGE'|'EMBEDDING',
byInferenceType='ON_DEMAND'|'PROVISIONED'
)
string
Return models belonging to the model provider that you specify.
string
Return models that support the customization type that you specify. For more information, see Custom models in the Amazon Bedrock User Guide.
string
Return models that support the output modality that you specify.
string
Return models that support the inference type that you specify. For more information, see Provisioned Throughput in the Amazon Bedrock User Guide.
dict
Response Syntax
{
'modelSummaries': [
{
'modelArn': 'string',
'modelId': 'string',
'modelName': 'string',
'providerName': 'string',
'inputModalities': [
'TEXT'|'IMAGE'|'EMBEDDING',
],
'outputModalities': [
'TEXT'|'IMAGE'|'EMBEDDING',
],
'responseStreamingSupported': True|False,
'customizationsSupported': [
'FINE_TUNING'|'CONTINUED_PRE_TRAINING'|'DISTILLATION',
],
'inferenceTypesSupported': [
'ON_DEMAND'|'PROVISIONED',
],
'modelLifecycle': {
'status': 'ACTIVE'|'LEGACY',
'startOfLifeTime': datetime(2015, 1, 1),
'endOfLifeTime': datetime(2015, 1, 1),
'legacyTime': datetime(2015, 1, 1),
'publicExtendedAccessTime': datetime(2015, 1, 1)
}
},
]
}
Response Structure
(dict) --
modelSummaries (list) --
A list of Amazon Bedrock foundation models.
(dict) --
Summary information for a foundation model.
modelArn (string) --
The Amazon Resource Name (ARN) of the foundation model.
modelId (string) --
The model ID of the foundation model.
modelName (string) --
The name of the model.
providerName (string) --
The model's provider name.
inputModalities (list) --
The input modalities that the model supports.
(string) --
outputModalities (list) --
The output modalities that the model supports.
(string) --
responseStreamingSupported (boolean) --
Indicates whether the model supports streaming.
customizationsSupported (list) --
Whether the model supports fine-tuning or continual pre-training.
(string) --
inferenceTypesSupported (list) --
The inference types that the model supports.
(string) --
modelLifecycle (dict) --
Contains details about whether a model version is available or deprecated.
status (string) --
Specifies whether a model version is available ( ACTIVE) or deprecated ( LEGACY.
startOfLifeTime (datetime) --
Launch time when the model first becomes available
endOfLifeTime (datetime) --
Time when the model is no longer available for use
legacyTime (datetime) --
Time when the model enters legacy state. Models in legacy state can still be used, but users should plan to transition to an Active model before the end of life time
publicExtendedAccessTime (datetime) --
Public extended access portion of the legacy period, when users should expect higher pricing
{'invocationJobSummaries': {'modelInvocationType': 'InvokeModel | Converse'}}
Lists all batch inference jobs in the account. For more information, see View details about a batch inference job.
See also: AWS API Documentation
Request Syntax
client.list_model_invocation_jobs(
submitTimeAfter=datetime(2015, 1, 1),
submitTimeBefore=datetime(2015, 1, 1),
statusEquals='Submitted'|'InProgress'|'Completed'|'Failed'|'Stopping'|'Stopped'|'PartiallyCompleted'|'Expired'|'Validating'|'Scheduled',
nameContains='string',
maxResults=123,
nextToken='string',
sortBy='CreationTime',
sortOrder='Ascending'|'Descending'
)
datetime
Specify a time to filter for batch inference jobs that were submitted after the time you specify.
datetime
Specify a time to filter for batch inference jobs that were submitted before the time you specify.
string
Specify a status to filter for batch inference jobs whose statuses match the string you specify.
The following statuses are possible:
Submitted – This job has been submitted to a queue for validation.
Validating – This job is being validated for the requirements described in Format and upload your batch inference data. The criteria include the following:
Your IAM service role has access to the Amazon S3 buckets containing your files.
Your files are .jsonl files and each individual record is a JSON object in the correct format. Note that validation doesn't check if the modelInput value matches the request body for the model.
Your files fulfill the requirements for file size and number of records. For more information, see Quotas for Amazon Bedrock.
Scheduled – This job has been validated and is now in a queue. The job will automatically start when it reaches its turn.
Expired – This job timed out because it was scheduled but didn't begin before the set timeout duration. Submit a new job request.
InProgress – This job has begun. You can start viewing the results in the output S3 location.
Completed – This job has successfully completed. View the output files in the output S3 location.
PartiallyCompleted – This job has partially completed. Not all of your records could be processed in time. View the output files in the output S3 location.
Failed – This job has failed. Check the failure message for any further details. For further assistance, reach out to the Amazon Web Services Support Center.
Stopped – This job was stopped by a user.
Stopping – This job is being stopped by a user.
string
Specify a string to filter for batch inference jobs whose names contain the string.
integer
The maximum number of results to return. If there are more results than the number that you specify, a nextToken value is returned. Use the nextToken in a request to return the next batch of results.
string
If there were more results than the value you specified in the maxResults field in a previous ListModelInvocationJobs request, the response would have returned a nextToken value. To see the next batch of results, send the nextToken value in another request.
string
An attribute by which to sort the results.
string
Specifies whether to sort the results by ascending or descending order.
dict
Response Syntax
{
'nextToken': 'string',
'invocationJobSummaries': [
{
'jobArn': 'string',
'jobName': 'string',
'modelId': 'string',
'clientRequestToken': 'string',
'roleArn': 'string',
'status': 'Submitted'|'InProgress'|'Completed'|'Failed'|'Stopping'|'Stopped'|'PartiallyCompleted'|'Expired'|'Validating'|'Scheduled',
'message': 'string',
'submitTime': datetime(2015, 1, 1),
'lastModifiedTime': datetime(2015, 1, 1),
'endTime': datetime(2015, 1, 1),
'inputDataConfig': {
's3InputDataConfig': {
's3InputFormat': 'JSONL',
's3Uri': 'string',
's3BucketOwner': 'string'
}
},
'outputDataConfig': {
's3OutputDataConfig': {
's3Uri': 'string',
's3EncryptionKeyId': 'string',
's3BucketOwner': 'string'
}
},
'vpcConfig': {
'subnetIds': [
'string',
],
'securityGroupIds': [
'string',
]
},
'timeoutDurationInHours': 123,
'jobExpirationTime': datetime(2015, 1, 1),
'modelInvocationType': 'InvokeModel'|'Converse'
},
]
}
Response Structure
(dict) --
nextToken (string) --
If there are more results than can fit in the response, a nextToken is returned. Use the nextToken in a request to return the next batch of results.
invocationJobSummaries (list) --
A list of items, each of which contains a summary about a batch inference job.
(dict) --
A summary of a batch inference job.
jobArn (string) --
The Amazon Resource Name (ARN) of the batch inference job.
jobName (string) --
The name of the batch inference job.
modelId (string) --
The unique identifier of the foundation model used for model inference.
clientRequestToken (string) --
A unique, case-sensitive identifier to ensure that the API request completes no more than one time. If this token matches a previous request, Amazon Bedrock ignores the request, but does not return an error. For more information, see Ensuring idempotency.
roleArn (string) --
The Amazon Resource Name (ARN) of the service role with permissions to carry out and manage batch inference. You can use the console to create a default service role or follow the steps at Create a service role for batch inference.
status (string) --
The status of the batch inference job.
The following statuses are possible:
Submitted – This job has been submitted to a queue for validation.
Validating – This job is being validated for the requirements described in Format and upload your batch inference data. The criteria include the following:
Your IAM service role has access to the Amazon S3 buckets containing your files.
Your files are .jsonl files and each individual record is a JSON object in the correct format. Note that validation doesn't check if the modelInput value matches the request body for the model.
Your files fulfill the requirements for file size and number of records. For more information, see Quotas for Amazon Bedrock.
Scheduled – This job has been validated and is now in a queue. The job will automatically start when it reaches its turn.
Expired – This job timed out because it was scheduled but didn't begin before the set timeout duration. Submit a new job request.
InProgress – This job has begun. You can start viewing the results in the output S3 location.
Completed – This job has successfully completed. View the output files in the output S3 location.
PartiallyCompleted – This job has partially completed. Not all of your records could be processed in time. View the output files in the output S3 location.
Failed – This job has failed. Check the failure message for any further details. For further assistance, reach out to the Amazon Web Services Support Center.
Stopped – This job was stopped by a user.
Stopping – This job is being stopped by a user.
message (string) --
If the batch inference job failed, this field contains a message describing why the job failed.
submitTime (datetime) --
The time at which the batch inference job was submitted.
lastModifiedTime (datetime) --
The time at which the batch inference job was last modified.
endTime (datetime) --
The time at which the batch inference job ended.
inputDataConfig (dict) --
Details about the location of the input to the batch inference job.
s3InputDataConfig (dict) --
Contains the configuration of the S3 location of the input data.
s3InputFormat (string) --
The format of the input data.
s3Uri (string) --
The S3 location of the input data.
s3BucketOwner (string) --
The ID of the Amazon Web Services account that owns the S3 bucket containing the input data.
outputDataConfig (dict) --
Details about the location of the output of the batch inference job.
s3OutputDataConfig (dict) --
Contains the configuration of the S3 location of the output data.
s3Uri (string) --
The S3 location of the output data.
s3EncryptionKeyId (string) --
The unique identifier of the key that encrypts the S3 location of the output data.
s3BucketOwner (string) --
The ID of the Amazon Web Services account that owns the S3 bucket containing the output data.
vpcConfig (dict) --
The configuration of the Virtual Private Cloud (VPC) for the data in the batch inference job. For more information, see Protect batch inference jobs using a VPC.
subnetIds (list) --
An array of IDs for each subnet in the VPC to use.
(string) --
securityGroupIds (list) --
An array of IDs for each security group in the VPC to use.
(string) --
timeoutDurationInHours (integer) --
The number of hours after which the batch inference job was set to time out.
jobExpirationTime (datetime) --
The time at which the batch inference job times or timed out.
modelInvocationType (string) --
The invocation endpoint for ModelInvocationJob