AWS bedrock documentation change
Summary
Completely restructured documentation for model information retrieval. Added details about bedrock-mantle endpoint with code examples (OpenAI SDK, Anthropic SDK, curl). Updated bedrock-runtime documentation and added curl examples.
Security assessment
Changes focus on API usage patterns and code examples for model listing. While authentication methods (API keys, AWS credentials) are mentioned, this is standard operational documentation without addressing specific vulnerabilities or security features.
Diff
diff --git a/bedrock/latest/userguide/models-get-info.md b/bedrock/latest/userguide/models-get-info.md index 86210defa..6e3a2dee9 100644 --- a//bedrock/latest/userguide/models-get-info.md +++ b//bedrock/latest/userguide/models-get-info.md @@ -7 +7 @@ -# Get information about foundation models +# Get list of models @@ -9 +9 @@ -In the Amazon Bedrock console, you can find overarching information about Amazon Bedrock foundation model providers and the models they provide in the **Providers** and **Base models** sections. +Amazon Bedrock provides two separate inference endpoints, each with its own API for listing the models available on it. For an overview of the endpoints, see [Endpoints supported by Amazon Bedrock](./endpoints.html). @@ -11 +11 @@ In the Amazon Bedrock console, you can find overarching information about Amazon -Use the API to retrieve information about Amazon Bedrock foundation model, including its ARN, model ID, modalities and features it supports, and whether it is deprecated or not, in a [FoundationModelSummary](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_FoundationModelSummary.html) object. + * **`bedrock-mantle`** – Use the OpenAI-compatible `/models` endpoint (for example, `client.models.list()` with the OpenAI SDK) to list the models available on `bedrock-mantle`. @@ -13 +13 @@ Use the API to retrieve information about Amazon Bedrock foundation model, inclu - * To return information about all the foundation models that Amazon Bedrock provides, send a [ListFoundationModels](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_ListFoundationModels.html) request. + * **`bedrock-runtime`** – Use the AWS-native [ListFoundationModels](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_ListFoundationModels.html) API. The response returns a [FoundationModelSummary](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_FoundationModelSummary.html) object for each model, including its ARN, model ID, supported modalities and features, and deprecation status. To get details for a specific model, use [GetFoundationModel](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetFoundationModel.html), specifying the [model ID](./models-supported.html). @@ -17,3 +17 @@ Use the API to retrieve information about Amazon Bedrock foundation model, inclu -The response also returns model IDs that aren't in the [base model ID](./models-supported.html) or base model IDs for Provisioned Throughput charts. These model IDs are deprecated or for backwards compability. - - * To return information about a specific foundation model, send a [GetFoundationModel](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_GetFoundationModel.html) request, specifying the [model ID](./models-supported.html). +The response also returns model IDs that aren't in the [base model ID](./models-supported.html) or base model IDs for Provisioned Throughput charts. These model IDs are deprecated or for backwards compatibility. @@ -25,0 +24,48 @@ Choose a tab to see code examples in an interface or language. +**List models on`bedrock-mantle`** + +OpenAI SDK (Python) + + + + # List all available models using the OpenAI SDK + # Requires OPENAI_API_KEY and OPENAI_BASE_URL environment variables + + from openai import OpenAI + + client = OpenAI() + + models = client.models.list() + + for model in models.data: + print(model.id) + + +Anthropic SDK (Python) + + + + from anthropic import AnthropicBedrockMantle + + client = AnthropicBedrockMantle(aws_region="us-east-1") + models = client.models.list() + + for model in models.data: + print(model.id) + +###### Note + +The `bedrock-mantle` `/v1/models` endpoint returns OpenAI-shaped model entries. Only `model.id` is reliable when using the Anthropic SDK; other fields on `ModelInfo` may be empty. + +curl + + + + # List all available models + # Requires OPENAI_API_KEY and OPENAI_BASE_URL environment variables + + curl -X GET $OPENAI_BASE_URL/models \ + -H "Authorization: Bearer $OPENAI_API_KEY" + + +**List and get models on`bedrock-runtime`** + @@ -57,0 +104,17 @@ Get information about Anthropic Claude v2. +curl + + +List the Amazon Bedrock foundation models. Requires AWS credentials in the environment (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, and optionally `AWS_SESSION_TOKEN`) and curl 7.75.0 or later for `--aws-sigv4` support. + + + curl -X GET "https://bedrock.us-east-1.amazonaws.com/foundation-models" \ + --aws-sigv4 "aws:amz:us-east-1:bedrock" \ + --user "$AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY" + +Get information about Anthropic Claude v2. + + + curl -X GET "https://bedrock.us-east-1.amazonaws.com/foundation-model/anthropic.claude-sonnet-4-20250514-v1:0" \ + --aws-sigv4 "aws:amz:us-east-1:bedrock" \ + --user "$AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY" + @@ -64 +127 @@ To use the Amazon Web Services Documentation, Javascript must be enabled. Please -Using models with Bedrock +Regional availability @@ -66 +129 @@ Using models with Bedrock -Supported models +Model lifecycle