AWS Bedrock is Amazon’s managed service for running large language models in your own AWS account. Instead of calling OpenAI or Anthropic’s APIs directly, you call Bedrock — and the model runs within your AWS environment. That means your data stays within your AWS region, you use your existing IAM permissions model, and costs go through your AWS bill alongside your other infrastructure. This guide walks through getting from zero to your first Bedrock API call.
What models are available on Bedrock
Bedrock offers models from multiple providers through a unified API. As of 2026, the main options include:
| Provider | Models | Best for |
|---|---|---|
| Anthropic | Claude 3.5 Sonnet, Claude 3 Haiku, Claude 3 Opus | Complex reasoning, coding, long context |
| Amazon | Titan Text, Titan Embeddings | Embeddings, general text tasks |
| Meta | Llama 3.1, Llama 3.2 | Open-weight tasks, cost-sensitive workloads |
| Mistral | Mistral 7B, Mixtral 8x7B | Fast inference, code |
| Cohere | Command R+ | RAG, enterprise search |
Step 1: Enable model access in the AWS Console
Bedrock models are not enabled by default — you need to explicitly request access. Go to the AWS Console → Bedrock → Model access (left sidebar). Click “Manage model access”, check the models you want, and submit. Most models are approved instantly; Anthropic’s Claude models require a brief use case description and are usually approved within minutes.
Important: model availability varies by AWS region. Claude models are available in us-east-1, us-west-2, eu-west-1, and ap-southeast-1 among others. Check the Bedrock documentation for the current region list — it updates frequently.
Step 2: Set up IAM permissions
Your IAM user or role needs Bedrock invoke permissions. The minimum policy for calling models:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"bedrock:InvokeModel",
"bedrock:InvokeModelWithResponseStream"
],
"Resource": "arn:aws:bedrock:*::foundation-model/*"
}
]
}
Attach this to your IAM user, role, or the EC2/Lambda instance profile that will be calling Bedrock. For tighter security, replace the wildcard resource with the specific model ARNs you are using.
Step 3: Install the AWS SDK and configure credentials
# Python
pip install boto3
# Node.js
npm install @aws-sdk/client-bedrock-runtime
Configure credentials using the standard AWS approach — environment variables, an ~/.aws/credentials file, or an IAM role attached to your compute resource:
# Environment variables (simplest for local dev)
export AWS_ACCESS_KEY_ID=your-key-id
export AWS_SECRET_ACCESS_KEY=your-secret-key
export AWS_DEFAULT_REGION=us-east-1
# Or use the AWS CLI to configure
aws configure
Step 4: Make your first Bedrock API call
import boto3
import json
client = boto3.client('bedrock-runtime', region_name='us-east-1')
# Call Claude on Bedrock
response = client.invoke_model(
modelId='anthropic.claude-3-5-sonnet-20241022-v2:0',
body=json.dumps({
"anthropic_version": "bedrock-2023-05-31",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Explain the difference between SQL and NoSQL in 3 bullet points"
}
]
})
)
result = json.loads(response['body'].read())
print(result['content'][0]['text'])
// Node.js / TypeScript
import { BedrockRuntimeClient, InvokeModelCommand } from "@aws-sdk/client-bedrock-runtime";
const client = new BedrockRuntimeClient({ region: "us-east-1" });
const payload = {
anthropic_version: "bedrock-2023-05-31",
max_tokens: 1024,
messages: [{ role: "user", content: "Write a function to validate an email address in JavaScript" }]
};
const command = new InvokeModelCommand({
modelId: "anthropic.claude-3-5-sonnet-20241022-v2:0",
body: JSON.stringify(payload),
contentType: "application/json",
});
const response = await client.send(command);
const result = JSON.parse(new TextDecoder().decode(response.body));
console.log(result.content[0].text);
Streaming responses
For long responses, streaming gives you tokens as they are generated rather than waiting for the full response:
import boto3, json
client = boto3.client('bedrock-runtime', region_name='us-east-1')
response = client.invoke_model_with_response_stream(
modelId='anthropic.claude-3-5-sonnet-20241022-v2:0',
body=json.dumps({
"anthropic_version": "bedrock-2023-05-31",
"max_tokens": 2048,
"messages": [{"role": "user", "content": "Write a detailed plan for a REST API"}]
})
)
for event in response['body']:
chunk = json.loads(event['chunk']['bytes'])
if chunk['type'] == 'content_block_delta':
print(chunk['delta']['text'], end='', flush=True)
Cost considerations
Bedrock pricing is per token, similar to calling the providers directly — but you may be able to negotiate enterprise pricing through AWS if you have an existing large account. For Australian businesses, running Bedrock in ap-southeast-2 (Sydney) keeps data onshore and reduces latency. The Sydney region has a growing model selection; check availability before committing to a region in production.
If you are building on AWS infrastructure already, Bedrock simplifies the security model significantly — one set of IAM policies covers both your infrastructure and your AI calls, and VPC endpoints mean model traffic never leaves the AWS network.