AWS Bedrock Integration
Connect AWS Bedrock to LLM Gateway for access to foundation models
AWS Bedrock is Amazon's fully managed service that provides access to foundation models from leading AI companies. This guide shows how to create AWS Bedrock Long-Term API Keys and integrate them with LLM Gateway.
Prerequisites
- An AWS account with Bedrock access enabled
- LLM Gateway account or self-hosted instance
Overview
AWS Bedrock supports Long-Term API Keys for simplified authentication. These keys provide direct API access without requiring IAM credentials or complex authentication flows.
Create AWS Bedrock Long-Term API Key
Enable Model Access in Bedrock
- Log into the AWS Console
- Navigate to AWS Bedrock service
- Go to Model access in the left sidebar
- Click Manage model access
- Enable the models you want to use (e.g., Claude Sonnet 4.6, Llama 4)
- Wait for access to be granted (usually instant for most models)
Create Long-Term API Key
- In AWS Bedrock console, navigate to API Keys in the left sidebar
- Click Create Long-Term API Key
- Set expiry date ("Never expires" is recommended)
- Click Generate
- Important: Copy the API key immediately - it's only shown once!
Add to LLM Gateway
Navigate to Provider Keys
- Log into LLM Gateway Dashboard
- Select your organization and project
- Go to Provider Keys in the sidebar
Add AWS Bedrock Provider Key
- Click Add for AWS Bedrock
- Paste your Long-Term API Key
- Select Region Prefix based on where you want to use your models:
- us. - For US regions (
us-east-1,us-west-2) - eu. - For European regions (
eu-central-1,eu-west-1) - global. - For global/cross-region endpoints
- us. - For US regions (
- Click Add Key
The system will validate your key and confirm the connection.
Test the Integration
Test your integration with a simple API call:
curl -X POST https://api.llmgateway.io/v1/chat/completions \
-H "Authorization: Bearer YOUR_LLMGATEWAY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "aws-bedrock/claude-sonnet-4-6",
"messages": [
{
"role": "user",
"content": "Hello from AWS Bedrock!"
}
]
}'Replace YOUR_LLMGATEWAY_API_KEY with your LLM Gateway API key.
Available Models
Once configured, you can access all AWS Bedrock models through LLM Gateway:
- Anthropic Claude:
aws-bedrock/claude-sonnet-4-6,aws-bedrock/claude-haiku-4-5 - Meta Llama:
aws-bedrock/llama-4-maverick-17b-instruct,aws-bedrock/llama-4-scout-17b-instruct - xAI Grok:
aws-bedrock/grok-4-3 - And more...
Browse all available models at llmgateway.io/models
Claude models
Claude models are sent to Bedrock's Anthropic Messages API (/anthropic/v1/messages on bedrock-runtime) with the same request body as Anthropic's own API, so prompt caching (including the 1-hour TTL), adaptive thinking with effort, structured outputs (response_format: json_schema) and server-side tool search work as they do on Anthropic. Older Claude models that Bedrock serves only through its Converse API still use Converse. The selected region decides the inference profile (global., us., eu., …) sent as the model.
No new IAM permission is needed: like Converse, it uses bedrock:InvokeModel and, for streaming, bedrock:InvokeModelWithResponseStream.
Bedrock does not offer Anthropic's web search, web fetch or programmatic tool calling for Claude. Requests with web search route to another provider when one can serve the model; a request pinned to aws-bedrock/ with web search is rejected. web fetch tools and allowed_callers are dropped from Bedrock requests, so pin a provider that supports them (such as anthropic/) when you need them.
Some Claude models on Bedrock reject a forced tool_choice (required or a named function). When a request routes by model, the gateway excludes a Bedrock mapping that cannot honor the forced choice. On other routes, the gateway prefers a provider that honors it and otherwise sends tool_choice: auto. The models page shows what each model supports.
OpenAI Models and Web Search
OpenAI models on Bedrock use the separate AWS Bedrock (OpenAI) provider key. Add the same Long-Term API Key there to use them.
Those models support native web search through Bedrock Web Search, which AWS serves only for in-region routes in its commercial US regions. Requests sent through a cross-region route (global or us) cannot search, and a few in-region routes are excluded; the models page lists which routes support web search. Bedrock bills each search query separately.
Web search needs IAM permissions beyond AmazonBedrockFullAccess, which lacks external web access. Attach the AmazonBedrockExternalWebSearchReadOnly managed policy to the key's IAM user, or grant bedrock-websearch:InvokeSearch, bedrock-websearch:InvokeFetch and bedrock-websearch:ExternalWebAccess. When the key's region offers web search, LLM Gateway checks for these permissions when you add the key and rejects a key that lacks them.
Troubleshooting
"Web search is not authorized for this identity"
The key is missing the web search permissions above. Attach the policy in the IAM console and add the key again.
"Model not available" error
- Verify you've enabled model access in AWS Bedrock console
- Check that the region where you created your key has access to the model
- Some models are only available in specific regions
Rate limiting
- AWS Bedrock has request quotas per model and region
- Monitor usage in AWS Bedrock console
- Consider requesting quota increases for high-volume workloads
How is this guide?
Last updated on