Streamlining Developer Experience with Amazon Bedrock API Keys
Introduction to Amazon Bedrock API Keys
Today, we’re excited to announce a significant improvement to the developer experience of Amazon Bedrock: API keys. API keys provide quick access to the Amazon Bedrock APIs, streamlining the authentication process so that developers can focus on building rather than configuration.
Leveraging CamelAI for Intelligent Systems
CamelAI is an open-source, modular framework for building intelligent multi-agent systems for data generation, world simulation, and task automation.
Enhancing Customer Onboarding with API Keys
“As a startup with limited resources, streamlined customer onboarding is critical to our success. The Amazon Bedrock API keys enable us to onboard enterprise customers in minutes rather than hours. With Bedrock, our customers can quickly provision access to leading AI models and seamlessly integrate them into CamelAI,” said Miguel Salinas, CTO, CamelAI.
Overview of API Key Authentication in Amazon Bedrock
In this post, explore how API keys work and how you can start using them today.
Simplifying Integration with API Key Access
Amazon Bedrock now provides API key access to streamline integration with tools and frameworks that expect API key-based authentication.
How API Key Authentication Works
The diagram compares the default authentication process to Amazon Bedrock (in orange) with the API keys approach (in blue).
Types of API Keys: Long-term vs Short-term
You can generate API keys in the Amazon Bedrock console, choosing between two types: long-term and short-term API keys.
Making Your First API Call
Once you have access to foundation models, getting started with Amazon Bedrock API key is straightforward.
Steps to Generate an API Key
Setting Your API Key as an Environment Variable
Making Your First API Call
You can now make API calls to Amazon Bedrock in multiple ways:
Bridging Developer Experience and Enterprise Security Requirements
Enterprise administrators can now streamline their user onboarding to Amazon Bedrock foundation models.
Conclusion: Try API Keys in Amazon Bedrock Today
Amazon Bedrock API keys are available in 20 AWS Regions. To learn more about API keys in Amazon Bedrock, visit the API Keys documentation in the Amazon Bedrock user guide.
About the Authors
Meet the team behind Amazon Bedrock, featuring a diverse range of experts in technology and product management.
Unlocking Developer Potential: Introducing API Keys for Amazon Bedrock
Today marks an exciting milestone for developers using Amazon Bedrock! We’re thrilled to announce the introduction of API keys—a substantial enhancement designed to simplify authentication processes. With this new feature, developers can spend less time configuring and more time creating innovative solutions.
CamelAI: A Case Study in Accelerated Onboarding
CamelAI is an open-source, modular framework tailored for building intelligent multi-agent systems that can efficiently handle data generation, world simulation, and task automation. For startups like CamelAI, time is of the essence. CTO Miguel Salinas noted,
“As a startup with limited resources, streamlined customer onboarding is critical to our success. The Amazon Bedrock API keys enable us to onboard enterprise customers in minutes rather than hours. With Bedrock, our customers can quickly provision access to leading AI models and seamlessly integrate them into CamelAI.”
This statement perfectly encapsulates the transformative nature of Amazon Bedrock’s new API keys feature.
How API Keys Work
With this update, Amazon Bedrock now offers API key authentication, which simplifies integration with various tools and frameworks that rely on API keys. The Amazon Bedrock runtime SDKs support several methods, including on-demand inference, model fine-tuning, and evaluation.
The traditional authentication process can be cumbersome:
- Create an identity in AWS IAM Identity Center or IAM.
- Attach IAM policies and generate credentials.
- Make API calls using those credentials.
In contrast, with our new API keys, developers can bypass much of this complexity. You can now quickly authenticate and access Amazon Bedrock APIs with minimal setup.
Generating API Keys
You can generate API keys easily through the Amazon Bedrock console. You have two options:
-
Long-term API keys: These keys can have expiration times ranging from 1 day to indefinite. They’re associated with an IAM user created automatically by Amazon Bedrock, which simplifies permissions management.
-
Short-term API keys: These keys utilize your existing IAM permissions and expire when your session ends or can last up to 12 hours. They incorporate AWS Signature Version 4 for enhanced security.
Making Your First API Call
Getting started with your first API call using Amazon Bedrock and API keys can be done in a few simple steps.
Step 1: Generate an API Key
- Sign in to the AWS Management Console and navigate to the Amazon Bedrock console.
- Click on API Keys in the left navigation panel.
- Choose to generate either a short-term or long-term API key.
- For long-term keys, set your desired expiration time and configure additional permissions as needed.
- Click Generate and copy your API key.
Step 2: Set Your API Key as an Environment Variable
Make sure your API key is easily accessible by setting it as an environment variable:
export AWS_BEARER_TOKEN_BEDROCK=${api-key}
Step 3: Make Your API Call
You can utilize various methods to make API calls. Here’s an example using the AWS SDK for Python (Boto3):
import boto3
client = boto3.client(
service_name="bedrock-runtime",
region_name="us-east-1"
)
model_id = "us.anthropic.claude-3-5-haiku-20241022-v1:0"
messages = [{"role": "user", "content": [{"text": "Hello"}]}]
response = client.converse(
modelId=model_id,
messages=messages,
)
print(response['output']['message']['content'][0]['text'])
Alternatively, you can make a call using curl or native libraries like Python Requests, with similar easy-to-follow commands.
Enhancing Security for Enterprises
Enterprise administrators can now streamline user onboarding for Amazon Bedrock foundation models. Short-term API keys offer a higher level of security as they use existing IAM permissions while maintaining established access controls.
For compliance and auditing purposes, all API calls made are logged in AWS CloudTrail, ensuring traceability without compromising sensitive information as API keys are passed as authorization headers and are not logged.
Conclusion
Amazon Bedrock API keys are now available across 20 AWS regions, making it easier than ever for developers to access leading AI models. These keys pave the way for quicker onboarding and enhanced integration capabilities, thus accelerating innovation.
Ready to try the new API keys feature? Visit the Amazon Bedrock console today and don’t hesitate to provide feedback through AWS re:Post or your usual AWS Support contacts.
About the Authors
Meet the minds behind this transformation:
- Sofian Hamiti: A tech leader passionate about empowering diverse talents in AI solutions.
- Ajit Mahareddy: A seasoned Product Manager focused on generative AI advancements.
- Nakul Vankadari Ramesh: A Software Engineer dedicated to enhancing generative AI capabilities at Amazon.
- Huong Nguyen: A Principal Product Manager committed to democratizing responsible AI and enhancing customer experiences.
- Massimiliano Angelino: An expert in IoT and edge computing solutions.
Explore the power of Amazon Bedrock and take your development experience to the next level!