Provider: AWS Bedrock

Call AWS Bedrock models through Respan Gateway with unified logs, cost, and latency.
This page is for Respan LLM Gateway users.

Use Respan Gateway to call AWS Bedrock models (Anthropic Claude on Bedrock, Meta Llama, Amazon Nova, and the rest) while keeping unified observability (logs, cost, latency, reliability) in Respan.

Quick setup

1

Get a Respan API key

Sign up and create a key on the API keys page.

Send your first request

Pick the integration that matches your stack. The base URL is https://api.respan.ai/api and the only key needed is your RESPAN_API_KEY.

Bedrock’s native AWS SDKs (boto3, AWS SDK for JS) talk to AWS endpoints directly. To route through Respan, point the OpenAI-compatible Chat Completions interface at the gateway. Install with pip install boto3 or npm install @aws-sdk/client-bedrock-runtime for native AWS calls, or pip install openai / npm install openai for the gateway path shown below.

1from openai import OpenAI
2
3client = OpenAI(
4 api_key="YOUR_RESPAN_API_KEY",
5 base_url="https://api.respan.ai/api",
6)
7
8response = client.chat.completions.create(
9 model="bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0",
10 messages=[{"role": "user", "content": "Hello, Bedrock!"}],
11)
12print(response.choices[0].message.content)

More integrations

Bedrock models work with every Respan gateway integration:

Switch models

Change the model parameter to call any supported model through the same client. Use the bedrock/ prefix to disambiguate when routing across providers. Browse the full list on the Models page.

1client.chat.completions.create(model="bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0", messages=messages)
2client.chat.completions.create(model="bedrock/anthropic.claude-3-5-haiku-20241022-v1:0", messages=messages)
3client.chat.completions.create(model="bedrock/amazon.nova-pro-v1:0", messages=messages)
4client.chat.completions.create(model="openai/gpt-5.5", messages=messages)
5client.chat.completions.create(model="anthropic/claude-sonnet-4-5-20250929", messages=messages)

Use your own AWS Bedrock key (BYOK)

Credits are the default path. If you’d rather bill AWS directly, attach your own IAM credentials.

1

Open Providers

Go to the Providers page.

2

Add AWS Bedrock

Select AWS Bedrock and fill in the required credential fields:

  • aws_access_key_id (your AWS access key ID)
  • aws_secret_access_key (your AWS secret access key)
  • aws_region_name (the AWS region where Bedrock is enabled)
3

Load balancing (Optional)

Add multiple credential sets and use Load balancing weight to distribute traffic across them.

Override credentials per model (Optional)

Use credential_override when one model on a request should use a different AWS account or region than the default.

1{
2 "customer_credentials": {
3 "bedrock": {
4 "aws_access_key_id": "YOUR_AWS_ACCESS_KEY_ID",
5 "aws_secret_access_key": "YOUR_AWS_SECRET_ACCESS_KEY",
6 "aws_region_name": "us-east-1"
7 }
8 },
9 "credential_override": {
10 "bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0": {
11 "aws_access_key_id": "ANOTHER_AWS_ACCESS_KEY_ID",
12 "aws_secret_access_key": "ANOTHER_AWS_SECRET_ACCESS_KEY",
13 "aws_region_name": "us-west-2"
14 }
15 }
16}

Log without proxying (Optional)

Already calling Bedrock directly? Send logs to Respan asynchronously to track cost, latency, and performance for those external calls.

1import requests
2
3requests.post(
4 "https://api.respan.ai/api/request-logs/create/",
5 headers={
6 "Authorization": "Bearer YOUR_RESPAN_API_KEY",
7 "Content-Type": "application/json",
8 },
9 json={
10 "model": "bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0",
11 "prompt_messages": [{"role": "user", "content": "Hello, how are you?"}],
12 "completion_message": {"role": "assistant", "content": "Hello from Bedrock through Respan."},
13 "cost": 0.001,
14 "generation_time": 1.2,
15 "customer_params": {"customer_identifier": "user_123"},
16 },
17)

See the logging guide for the full setup.