Amazon Bedrock CLI/SDK Guide: How to List Your Entitled Models

AWS Bedrock Essentials for RAG Implementation

Getting the most out of Amazon Bedrock starts with knowing which models you can actually use. This Amazon Bedrock CLI/SDK guide shows developers and AWS practitioners exactly how to list entitled models in your account and manage them effectively.

Many teams struggle to discover what Amazon Bedrock models they have access to or waste time trying to use models they’re not entitled to. The AWS Bedrock SDK and Amazon Bedrock CLI provide straightforward ways to check your model permissions and avoid these headaches.

This AWS Bedrock tutorial walks you through the practical steps you need. You’ll learn how to set up your environment for Bedrock CLI access and use specific AWS CLI Bedrock commands to discover available models. We’ll also cover how to leverage the Bedrock SDK for model discovery and show you ways to automate these processes with simple scripts.

By the end, you’ll have the tools to confidently manage your Bedrock model management workflow and integrate Amazon Bedrock API calls into your applications.

Understanding Amazon Bedrock Model Entitlements

What are model entitlements and why they matter

Model entitlements in Amazon Bedrock represent your account’s specific access rights to foundation models from various providers like Anthropic, AI21 Labs, and Cohere. Unlike having blanket access to all models, AWS implements a permission-based system where you must explicitly request access to each model family. This controlled approach helps AWS manage resource allocation, ensure compliance with provider agreements, and maintain cost predictability. Your entitlements determine which Amazon Bedrock models you can invoke through the AWS CLI or SDK, making it essential to understand your current permissions before building applications.

Difference between available and entitled models

The distinction between available and entitled models creates a crucial gatekeeping mechanism in the Bedrock ecosystem. Available models represent the complete catalog of foundation models offered through Amazon Bedrock, including Claude, Jurassic, and Command models. However, entitled models are the subset you can actually access based on your account’s approved requests. When you use AWS CLI Bedrock commands to list models, you’ll see only your entitled models, not the entire available catalog. This separation prevents billing surprises and ensures you work within your approved model scope.

How model access permissions work in AWS accounts

AWS Bedrock model access operates through a request-approval workflow integrated with your account’s IAM permissions. Account administrators must submit access requests through the AWS console for specific model families, often requiring business justification and use case details. Once approved, these entitlements become part of your account’s Bedrock service quotas and can be managed through standard AWS IAM policies. Your IAM user or role needs both the general Bedrock permissions and specific model entitlements to successfully invoke models via the Amazon Bedrock API or AWS CLI tools.

Setting Up Your Environment for Bedrock CLI Access

Installing and configuring AWS CLI with Bedrock support

Getting your AWS CLI ready for Amazon Bedrock CLI commands starts with downloading the latest version from the official AWS website. After installation, configure your CLI using aws configure to set your access key, secret key, default region, and output format. Amazon Bedrock requires AWS CLI version 2.13.0 or higher to access all Bedrock model management features. Update your CLI regularly to ensure compatibility with new Bedrock functionality and model releases.

Setting up proper IAM permissions for model listing

Your IAM user or role needs specific permissions to interact with Amazon Bedrock models effectively. Create a custom policy that includes bedrock:ListFoundationModels, bedrock:GetFoundationModel, and bedrock:ListModelCustomizationJobs permissions. Attach this policy to your IAM user or assume a role with these capabilities. Many organizations create dedicated Bedrock service roles to manage model access centrally while maintaining security best practices across teams.

Authenticating your credentials for secure access

Credential authentication for AWS Bedrock SDK and CLI operations supports multiple methods including IAM roles, access keys, and temporary credentials. Configure your credentials file located at ~/.aws/credentials or use environment variables AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY. For enhanced security in production environments, use IAM roles with temporary credentials through AWS STS. Multi-factor authentication adds another layer of protection when accessing sensitive model information.

Verifying your Bedrock service availability in your region

Amazon Bedrock availability varies across AWS regions, so check the AWS Regional Services page before starting your setup. Use aws bedrock list-foundation-models --region your-region to test connectivity and verify service access in your target region. Popular regions like us-east-1, us-west-2, and eu-west-1 typically offer the most comprehensive model selection. Some entitled models may only be available in specific regions due to compliance or capacity constraints.

Using AWS CLI to List Your Entitled Models

Basic command syntax for listing models

The Amazon Bedrock CLI command for discovering your entitled models uses a straightforward syntax: aws bedrock list-foundation-models. This AWS CLI Bedrock command connects to the Bedrock API and retrieves all models available to your account. You can execute this command directly from your terminal or command prompt once your AWS credentials are configured. The basic structure requires no additional parameters, making it perfect for quick model discovery tasks. For more targeted results, you can append various filtering options to narrow down the model list based on your specific requirements.

Essential parameters and filtering options

Amazon Bedrock CLI offers several powerful filtering parameters to refine your model search results. The --by-provider parameter lets you filter models by specific providers like Anthropic, Cohere, or Meta. Use --by-output-modality to find models supporting text, image, or embedding outputs, while --by-inference-type helps identify models optimized for on-demand or provisioned throughput. The --by-customization-type parameter filters for fine-tunable models, and --region specifies the AWS region for model availability. These Bedrock model management options significantly improve your workflow efficiency when working with specific model types or providers.

Understanding the JSON output format

The AWS Bedrock SDK returns model information in a structured JSON format containing essential metadata for each entitled model. The response includes key fields like modelId, modelName, providerName, inputModalities, outputModalities, responseStreamingSupported, and customizationsSupported. Each model entry provides comprehensive details about supported features, pricing tiers, and technical specifications. The modelLifecycle field indicates whether models are active, legacy, or deprecated. This Amazon Bedrock API response structure enables developers to programmatically process model information for automated workflows and integration purposes.

Handling common CLI errors and troubleshooting

Common Amazon Bedrock CLI errors include authentication failures, region mismatches, and insufficient permissions. When encountering “AccessDenied” errors, verify your IAM user has the bedrock:ListFoundationModels permission attached. “InvalidRegion” errors occur when specifying unsupported regions – check AWS documentation for current Bedrock availability. Network timeouts often resolve by increasing the CLI timeout setting using --cli-read-timeout. For debugging, enable verbose logging with --debug to capture detailed API requests and responses. Always ensure your AWS CLI version supports Bedrock commands by running aws --version and updating if necessary.

Leveraging Bedrock SDK for Model Discovery

Setting up SDK in your preferred programming language

The AWS Bedrock SDK offers robust support across Python, JavaScript, Java, Go, and .NET environments. Install the SDK using your language’s package manager – pip install boto3 for Python or npm install @aws-sdk/client-bedrock for Node.js. Configure your AWS credentials through environment variables, IAM roles, or the AWS credentials file. Python developers can quickly start with import boto3; client = boto3.client('bedrock') while JavaScript users initialize with import { BedrockClient } from "@aws-sdk/client-bedrock".

Writing code to retrieve entitled model information

The list_foundation_models() method in the Bedrock SDK returns comprehensive model data including availability, pricing tiers, and capability information. Python implementations require minimal code: create a Bedrock client, call the list method, and iterate through results. JavaScript developers use similar patterns with async/await syntax. Filter models by provider, output modality, or inference type using built-in parameters. Error handling becomes critical when dealing with region-specific model availability or temporary service limitations.

Parsing and displaying model metadata effectively

Model responses contain rich metadata including model IDs, provider names, input/output modalities, and supported inference types. Extract key properties like modelId, providerName, inputModalities, and outputModalities for meaningful displays. Create structured output using tables or JSON formatting to compare model capabilities side-by-side. Consider implementing caching mechanisms for frequently accessed model information to reduce API calls and improve application performance when building production model discovery tools.

Interpreting Model Information and Metadata

Decoding Model IDs and Naming Conventions

Amazon Bedrock model IDs follow a structured pattern that reveals key information about each model. The format typically includes the provider name (like anthropic, amazon, cohere), model family, and version number separated by periods. For example, anthropic.claude-3-sonnet-20240229-v1:0 indicates Anthropic’s Claude 3 Sonnet model with a specific release date and version. Understanding these naming conventions helps you quickly identify model capabilities and select the right one for your use case when using Amazon Bedrock CLI or AWS Bedrock SDK commands.

Understanding Model Capabilities and Limitations

Each Amazon Bedrock model comes with distinct capabilities and constraints that directly impact your application design. Text generation models like Claude and Titan Text support different context lengths, with some handling up to 200,000 tokens while others max out at 8,000 tokens. Image generation models such as Stable Diffusion have specific resolution limits and style parameters. When listing entitled models AWS through the API, pay attention to the modelArn and modelId fields which indicate supported modalities (text, image, embedding) and help you match models to your specific requirements.

Model Type Context Length Primary Use Cases Key Limitations
Claude 3 Sonnet 200K tokens Complex reasoning, analysis Higher latency for long contexts
Titan Text Express 8K tokens General text generation Limited context window
Stable Diffusion XL N/A Image generation 1024×1024 max resolution
Titan Embeddings 8K tokens Semantic search, RAG Text-only input

Identifying Pricing Tiers and Usage Constraints

Bedrock model management requires understanding the cost structure and usage limits associated with each model. Models are priced differently based on input and output tokens, with some charging per 1,000 tokens and others using different pricing models. Foundation models like GPT-4 and Claude 3 Opus typically cost more than lighter models like Jurassic-2 Mid. When using AWS CLI Bedrock commands to list models, check the pricing documentation alongside your entitlements, as costs can vary significantly between on-demand and provisioned throughput options.

  • On-Demand Pricing: Pay per token with no minimum commitments
  • Provisioned Throughput: Reserved capacity with hourly rates
  • Model-Specific Limits: Some models have daily or monthly usage caps
  • Regional Variations: Pricing and availability differ across AWS regions

Recognizing Model Versions and Update Statuses

Model versions in Amazon Bedrock API responses indicate the specific iteration of a foundation model you’re accessing. Version numbers typically follow semantic versioning or date-based formats, with newer versions often bringing improved performance, additional features, or bug fixes. When conducting Bedrock model discovery, you’ll notice that some models show multiple versions available simultaneously, allowing you to choose between stability (older versions) and latest features (newer versions). Monitor the modelLifecycleStatus field in API responses to identify deprecated models and plan migrations accordingly.

Automating Model Management with Scripts

Creating reusable scripts for regular model checks

Building Python scripts that leverage the Amazon Bedrock SDK streamlines model management workflows significantly. Create functions that call list_foundation_models() with error handling and logging capabilities. Store model metadata in JSON files for comparison between runs, enabling you to track changes in your entitled models AWS access. Schedule these scripts using cron jobs or AWS Lambda for automated execution, ensuring your Bedrock model management stays current without manual intervention.

Setting up automated alerts for new model access

Configure notification systems that monitor your Amazon Bedrock models entitlements and alert you when new access becomes available. Integrate AWS SNS with your model checking scripts to send email or Slack notifications whenever the AWS CLI Bedrock commands return additional models. Set up CloudWatch Events to trigger Lambda functions that compare current entitlements against baseline snapshots, automatically flagging new Amazon Bedrock API access for immediate evaluation and testing.

Building custom filtering for specific model types

Develop filtering mechanisms that categorize models based on your specific requirements using the Bedrock SDK. Create conditional logic that groups models by provider, capability, or pricing tier from the API responses. Build custom classes that parse model metadata and apply business rules for automatic selection. These filters help streamline Bedrock model discovery by presenting only relevant options, whether you need text generation, image processing, or conversational AI capabilities for your applications.

The Amazon Bedrock platform gives you access to powerful foundation models, but knowing which ones you can actually use requires checking your entitlements first. Both the AWS CLI and Bedrock SDK offer straightforward ways to discover your available models, each with its own advantages depending on your workflow and technical needs.

Getting your environment set up correctly is the foundation for everything else – make sure your credentials are configured and your CLI tools are updated before diving in. Once you start exploring your entitled models, pay close attention to the metadata returned with each model, as this information helps you choose the right tool for your specific use case. Consider building automated scripts to regularly check your model access, especially if you’re working in a team environment where entitlements might change over time.