

There are more AWS SDK examples available in the [AWS Doc SDK Examples](https://github.com/awsdocs/aws-doc-sdk-examples) GitHub repo.

# Code examples for Amazon Bedrock Runtime using AWS SDKs
<a name="bedrock-runtime_code_examples"></a>

The following code examples show you how to use Amazon Bedrock Runtime with an AWS software development kit (SDK).

*Scenarios* are code examples that show you how to accomplish specific tasks by calling multiple functions within a service or combined with other AWS services.

**More resources**
+  **[ Amazon Bedrock Runtime User Guide](https://docs.aws.amazon.com/bedrock/latest/userguide/what-is-bedrock.html)** – More information about Amazon Bedrock Runtime.
+ **[Amazon Bedrock Runtime API Reference](https://docs.aws.amazon.com/bedrock/latest/APIReference/welcome.html)** – Details about all available Amazon Bedrock Runtime actions.
+ **[AWS Developer Center](https://aws.amazon.com/developer/code-examples/?awsf.sdk-code-examples-product=product%23bedrock)** – Code examples that you can filter by category or full-text search.
+ **[AWS SDK Examples](https://github.com/awsdocs/aws-doc-sdk-examples)** – GitHub repo with complete code in preferred languages. Includes instructions for setting up and running the code.

**Contents**
+ [Basics](bedrock-runtime_code_examples_basics.md)
  + [Hello Amazon Bedrock](bedrock-runtime_example_bedrock-runtime_Hello_section.md)
+ [Scenarios](bedrock-runtime_code_examples_scenarios.md)
  + [Create a playground application to interact with Amazon Bedrock foundation models](bedrock-runtime_example_cross_FMPlayground_section.md)
  + [Create and invoke a managed prompt](bedrock-runtime_example_bedrock-agent_GettingStartedWithBedrockPrompts_section.md)
  + [Generate videos from text prompts using Amazon Bedrock](bedrock-runtime_example_bedrock-runtime_Scenario_GenerateVideos_NovaReel_section.md)
  + [Invoke multiple foundation models on Amazon Bedrock](bedrock-runtime_example_bedrock-runtime_Scenario_InvokeModels_section.md)
  + [Orchestrate generative AI applications with Step Functions](bedrock-runtime_example_cross_ServerlessPromptChaining_section.md)
  + [Tool use with the Converse API](bedrock-runtime_example_bedrock-runtime_Scenario_ToolUse_section.md)
+ [Amazon Nova](bedrock-runtime_code_examples_amazon_nova.md)
  + [Converse](bedrock-runtime_example_bedrock-runtime_Converse_AmazonNovaText_section.md)
  + [ConverseStream](bedrock-runtime_example_bedrock-runtime_ConverseStream_AmazonNovaText_section.md)
  + [Document understanding](bedrock-runtime_example_bedrock-runtime_DocumentUnderstanding_AmazonNova_section.md)
  + [Scenario: Tool use with the Converse API](bedrock-runtime_example_bedrock-runtime_Scenario_ToolUseDemo_AmazonNova_section.md)
+ [Amazon Nova Canvas](bedrock-runtime_code_examples_amazon_nova_canvas.md)
  + [InvokeModel](bedrock-runtime_example_bedrock-runtime_InvokeModel_AmazonNovaImageGeneration_section.md)
+ [Amazon Nova Reel](bedrock-runtime_code_examples_amazon_nova_reel.md)
  + [Text-to-video](bedrock-runtime_example_bedrock-runtime_Scenario_AmazonNova_TextToVideo_section.md)
+ [Amazon Titan Image Generator](bedrock-runtime_code_examples_amazon_titan_image_generator.md)
  + [InvokeModel](bedrock-runtime_example_bedrock-runtime_InvokeModel_TitanImageGenerator_section.md)
+ [Amazon Titan Text](bedrock-runtime_code_examples_amazon_titan_text.md)
  + [InvokeModel](bedrock-runtime_example_bedrock-runtime_InvokeModel_TitanText_section.md)
+ [Amazon Titan Text Embeddings](bedrock-runtime_code_examples_amazon_titan_text_embeddings.md)
  + [InvokeModel](bedrock-runtime_example_bedrock-runtime_InvokeModelWithResponseStream_TitanTextEmbeddings_section.md)
+ [Anthropic Claude](bedrock-runtime_code_examples_anthropic_claude.md)
  + [Converse](bedrock-runtime_example_bedrock-runtime_Converse_AnthropicClaude_section.md)
  + [ConverseStream](bedrock-runtime_example_bedrock-runtime_ConverseStream_AnthropicClaude_section.md)
  + [Document understanding](bedrock-runtime_example_bedrock-runtime_DocumentUnderstanding_AnthropicClaude_section.md)
  + [InvokeModel](bedrock-runtime_example_bedrock-runtime_InvokeModel_AnthropicClaude_section.md)
  + [InvokeModelWithResponseStream](bedrock-runtime_example_bedrock-runtime_InvokeModelWithResponseStream_AnthropicClaude_section.md)
  + [Reasoning](bedrock-runtime_example_bedrock-runtime_Converse_AnthropicClaudeReasoning_section.md)
  + [Reasoning with a streaming response](bedrock-runtime_example_bedrock-runtime_ConverseStream_AnthropicClaudeReasoning_section.md)
  + [Scenario: Tool use with the Converse API](bedrock-runtime_example_bedrock-runtime_Scenario_ToolUseDemo_AnthropicClaude_section.md)
+ [Cohere Command](bedrock-runtime_code_examples_cohere_command.md)
  + [Converse](bedrock-runtime_example_bedrock-runtime_Converse_CohereCommand_section.md)
  + [ConverseStream](bedrock-runtime_example_bedrock-runtime_ConverseStream_CohereCommand_section.md)
  + [Document understanding](bedrock-runtime_example_bedrock-runtime_DocumentUnderstanding_CohereCommand_section.md)
  + [InvokeModel: Command R and R\+](bedrock-runtime_example_bedrock-runtime_InvokeModel_CohereCommandR_section.md)
  + [InvokeModelWithResponseStream: Command R and R\+](bedrock-runtime_example_bedrock-runtime_InvokeModelWithResponseStream_CohereCommandR_section.md)
  + [Scenario: Tool use with the Converse API](bedrock-runtime_example_bedrock-runtime_Scenario_ToolUseDemo_CohereCommand_section.md)
+ [DeepSeek](bedrock-runtime_code_examples_deepseek.md)
  + [Document understanding](bedrock-runtime_example_bedrock-runtime_DocumentUnderstanding_DeepSeek_section.md)
+ [Meta Llama](bedrock-runtime_code_examples_meta_llama.md)
  + [Converse](bedrock-runtime_example_bedrock-runtime_Converse_MetaLlama_section.md)
  + [ConverseStream](bedrock-runtime_example_bedrock-runtime_ConverseStream_MetaLlama_section.md)
  + [Document understanding](bedrock-runtime_example_bedrock-runtime_DocumentUnderstanding_MetaLlama_section.md)
  + [InvokeModel](bedrock-runtime_example_bedrock-runtime_InvokeModel_MetaLlama3_section.md)
  + [InvokeModelWithResponseStream](bedrock-runtime_example_bedrock-runtime_InvokeModelWithResponseStream_MetaLlama3_section.md)
+ [Mistral AI](bedrock-runtime_code_examples_mistral_ai.md)
  + [Converse](bedrock-runtime_example_bedrock-runtime_Converse_Mistral_section.md)
  + [ConverseStream](bedrock-runtime_example_bedrock-runtime_ConverseStream_Mistral_section.md)
  + [Document understanding](bedrock-runtime_example_bedrock-runtime_DocumentUnderstanding_Mistral_section.md)
  + [InvokeModel](bedrock-runtime_example_bedrock-runtime_InvokeModel_MistralAi_section.md)
  + [InvokeModelWithResponseStream](bedrock-runtime_example_bedrock-runtime_InvokeModelWithResponseStream_MistralAi_section.md)
+ [Stable Diffusion](bedrock-runtime_code_examples_stable_diffusion.md)
  + [InvokeModel](bedrock-runtime_example_bedrock-runtime_InvokeModel_StableDiffusion_section.md)