What is Amazon Bedrock?
Amazon Bedrock is a fully managed service providing access to foundation models from Anthropic, Meta, Mistral, Cohere, and Amazon via a single API. No infrastructure to manage.
Enable Model Access
In the AWS Console → Bedrock → Model access, request access to your desired models. Claude 3 Haiku is available immediately on the free tier.
First API Call (Python)
```python
import boto3
import json
bedrock = boto3.client("bedrock-runtime", region_name="us-east-1")
response = bedrock.invoke_model(
modelId="anthropic.claude-3-haiku-20240307-v1:0",
body=json.dumps({
"anthropic_version": "bedrock-2023-05-31",
"messages": [{"role": "user", "content": "Hello!"}],
"max_tokens": 256,
})
)
result = json.loads(response["body"].read())
print(result["content"][0]["text"])
```
Knowledge Bases
Bedrock Knowledge Bases provide a managed RAG pipeline. Upload documents to S3, create a knowledge base, and query it with any foundation model.
Pricing
Claude 3 Haiku: $0.00025/1K input tokens. Use the Bedrock Pricing Calculator for estimates.