Skip to main content
Obiguard provides a robust and secure gateway to facilitate the integration of various Large Language Models (LLMs) into your applications, including models hosted on AWS Bedrock. With Obiguard, you can take advantage of features like fast AI gateway access, observability, prompt management, and more, all while ensuring the secure management of your LLM API keys through a virtual key system.
Provider Slug. bedrock

Obiguard SDK Integration with AWS Bedrock

Obiguard provides a consistent API to interact with models from various providers. To integrate Bedrock with Obiguard:

1. Install the Obiguard SDK

Add the Obiguard SDK to your application to interact with Anthropic’s API through Obiguard’s gateway.

2. Initialize Obiguard with the Virtual Key

There are two ways to integrate AWS Bedrock with Obiguard:

AWS Access Key


Use your AWS Secret Access Key, AWS Access Key Id, and AWS Region to create your Virtual key.

Integration Guide

AWS Assumed Role


Take your AWS Assumed Role ARN and AWS Region to create the virtaul key.


Integration Guide

Using Virtual Key with AWS STS

If you’re using AWS Security Token Service, you can pass your aws_session_token along with the Virtual key:

Not using Virtual Keys?

Check out this example on how you can directly use your AWS details to make a Bedrock request through Obiguard.

3. Invoke Chat Completions with AWS bedrock

Use the Obiguard instance to send requests to Bedrock. You can also override the virtual key directly in the API call if needed.

Using Vision Models

Obiguard’s multimodal Gateway fully supports Bedrock’s vision models anthropic.claude-3-sonnet, anthropic.claude-3-haiku, and anthropic.claude-3-opus For more info, check out this guide: Vision

Extended Thinking (Reasoning Models) (Beta)

The assistants thinking response is returned in the response_chunk.choices[0].delta.content_blocks array, not the response.choices[0].message.content string.
Models like us.anthropic.claude-3-7-sonnet-20250219-v1:0 support extended thinking. This is similar to openai thinking, but you get the model’s reasoning as it processes the request as well. Note that you will have to set strict_open_ai_compliance=False in the headers to use this feature.

Single turn conversation

Python

Multi turn conversation

Python

Inference Profiles

Inference profiles are a resource in Amazon Bedrock that define a model and one or more Regions to which the inference profile can route model invocation requests. To use inference profiles, your IAM role needs to additionally have the following permissions:
This is a pre-requisite for using inference profiles, as the gateway needs to fetch the foundation model to process the request. For reference, see the following documentation: https://docs.aws.amazon.com/bedrock/latest/userguide/inference-profiles-prereq.html

Bedrock Converse API

Obiguard uses the AWS Converse API internally for making chat completions requests. If you need to pass additional input fields or parameters like anthropic_beta, top_k, frequency_penalty etc. that are specific to a model, you can pass it with this key:
If you require the model to respond with certain fields that are specific to a model, you need to pass this key:

Making Requests without Virtual Keys

If you do not want to add your AWS details to Obiguard vault, you can also directly pass them while instantiating the Obiguard client.

Mapping the Bedrock Details

Example


Supported Models

List of supported Amazon Bedrock model IDs


How to Find Your AWS Credentials

Navigate here in the AWS Management Console to obtain your AWS Access Key ID and AWS Secret Access Key.
  • In the console, you’ll find the ‘Access keys’ section. Click on ‘Create access key’.
  • Copy the Secret Access Key once it is generated, and you can view the Access Key ID along with it.
acess
  • On the same page under the ‘Access keys’ section, where you created your Secret Access key, you will also find your Access Key ID.
retrieve
  • And lastly, get Your AWS Region from the Home Page of AWS Bedrock as shown in the image below.
bedrock

Next Steps

The complete list of features supported in the SDK are available on the link below.

SDK