ListFoundationModelsCommand

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 .

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { BedrockClient, ListFoundationModelsCommand } from "@aws-sdk/client-bedrock"; // ES Modules import
// const { BedrockClient, ListFoundationModelsCommand } = require("@aws-sdk/client-bedrock"); // CommonJS import
const client = new BedrockClient(config);
const input = { // ListFoundationModelsRequest
  byProvider: "STRING_VALUE",
  byCustomizationType: "FINE_TUNING" || "CONTINUED_PRE_TRAINING" || "DISTILLATION",
  byOutputModality: "TEXT" || "IMAGE" || "EMBEDDING",
  byInferenceType: "ON_DEMAND" || "PROVISIONED",
};
const command = new ListFoundationModelsCommand(input);
const response = await client.send(command);
// { // ListFoundationModelsResponse
//   modelSummaries: [ // FoundationModelSummaryList
//     { // FoundationModelSummary
//       modelArn: "STRING_VALUE", // required
//       modelId: "STRING_VALUE", // required
//       modelName: "STRING_VALUE",
//       providerName: "STRING_VALUE",
//       inputModalities: [ // ModelModalityList
//         "TEXT" || "IMAGE" || "EMBEDDING",
//       ],
//       outputModalities: [
//         "TEXT" || "IMAGE" || "EMBEDDING",
//       ],
//       responseStreamingSupported: true || false,
//       customizationsSupported: [ // ModelCustomizationList
//         "FINE_TUNING" || "CONTINUED_PRE_TRAINING" || "DISTILLATION",
//       ],
//       inferenceTypesSupported: [ // InferenceTypeList
//         "ON_DEMAND" || "PROVISIONED",
//       ],
//       modelLifecycle: { // FoundationModelLifecycle
//         status: "ACTIVE" || "LEGACY", // required
//       },
//     },
//   ],
// };

ListFoundationModelsCommand Input

Parameter
Type
Description
byCustomizationType
ModelCustomization | undefined

Return models that support the customization type that you specify. For more information, see Custom models  in the Amazon Bedrock User Guide .

byInferenceType
InferenceType | undefined

Return models that support the inference type that you specify. For more information, see Provisioned Throughput  in the Amazon Bedrock User Guide .

byOutputModality
ModelModality | undefined

Return models that support the output modality that you specify.

byProvider
string | undefined

Return models belonging to the model provider that you specify.

ListFoundationModelsCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
modelSummaries
FoundationModelSummary[] | undefined

A list of Amazon Bedrock foundation models.

Throws

Name
Fault
Details
AccessDeniedException
client

The request is denied because of missing access permissions.

InternalServerException
server

An internal server error occurred. Retry your request.

ThrottlingException
client

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

ValidationException
client

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

BedrockServiceException
Base exception class for all service exceptions from Bedrock service.