Interacting with Amazon Bedrock Foundation Models using APIs

2m 53s

This lesson is going to explain how to use Amazon Bedrock runtime APIs to interact with foundation models hosted on Amazon Bedrock.

Learning Objectives

By the end of this lesson, you will have a greater understanding of interacting with Amazon Bedrock Foundation Models using APIs. We’ll cover the following learning objectives: 

  • Learn how to use Python and the Boto3 SDK to interact with the Bedrock API 
  • Learn how to run single prompt inference using code for both image and text generation 
  • Learn how to switch between Foundation Models using code 
  • Understand the invocation options for the Bedrock Runtime

Intended Audience

  • Those who are implementing Amazon Bedrock into applications
  • Users in roles such as software engineers or machine learning engineers


  • To get the most out of this lesson you should have a basic understanding of Amazon Bedrock, including what the service does and the different foundation models available for it
  • This lesson will use Python code and the Boto3 SDK, so some familiarity will be required for those subjects as well
  • If you plan to follow along with demos, you will also need to work with either your own IDE for this, or AWS Cloud9
  • You should feel comfortable installing Python Pillow, which is a Python imaging library, and AWS SDKs such as boto3
  • For more information on these services please see our existing content titled:
About the Author
Alana Layton, opens in a new tab
Sr. AWS Content Creator
Learning paths

Alana Layton is an experienced technical trainer, technical content developer, and cloud engineer living out of Seattle, Washington. Her career has included teaching about AWS all over the world, creating AWS content that is fun, and working in consulting. She currently holds six AWS certifications. Outside of Cloud Academy, you can find her testing her knowledge in bar trivia, reading, or training for a marathon.

Covered Topics