Bedrock provider summary
Bifrost routes AWS Bedrock models with full OpenAI compatibility. Support includes multiple model families (Anthropic Claude, Meta Llama, Mistral, Cohere, Amazon Titan) with extensive parameter conversion and flexible authentication.
Supported model families:
- Anthropic Claude - Claude 3.5 Sonnet, Opus, Haiku
- Meta Llama - Llama 3.1, 3, 2
- Mistral - Mistral Large, 7B
- Cohere - Command R+, Command R
- Amazon Titan - Embeddings, Text, Image
| Property | Details |
|---|---|
| Description | AWS Bedrock fully managed service for accessing foundation models. |
| Provider route on Bifrost | bedrock/<model> |
| Provider doc | AWS Bedrock |
| AWS Region | Configurable per API key |
| Supported endpoints | /v1/chat/completions, /v1/responses, /v1/embeddings, /v1/images/*, /v1/batches, /v1/files |
Supported operations
Bedrock supports comprehensive operations across chat, embeddings, and image generation. Text completion streaming not supported by upstream Bedrock API.
| Operation | Non-streaming | Streaming | Upstream endpoint |
|---|---|---|---|
| Chat Completions | Yes | Yes | /v1/chat/completions |
| Responses API | Yes | Yes | /v1/responses |
| Text Completions | Yes (Claude/Mistral) | No | /v1/completions |
| Embeddings | Yes (Titan, Cohere) | No | /v1/embeddings |
| Image Generation | Yes | No | /v1/images/generations |
| Image Edit | Yes | No | /v1/images/edits |
| Image Variation | Yes | No | /v1/images/variations |
| Batch | Yes | No | /v1/batches |
| Files | Yes (S3-backed) | No | /v1/files |
Supported OpenAI parameters
Quick reference of OpenAI parameters accepted when routing through Bedrock via Bifrost.
[ "stream", "temperature", "top_p", "top_k", "max_tokens", "max_completion_tokens", "stop", "response_format", "tools", "tool_choice", "user", "reasoning" ]
Supported Bedrock models
Use the provider prefix bedrock/ in Bifrost model routes for deterministic provider targeting.
| Family | Model ID | Bifrost route | Typical usage |
|---|---|---|---|
| Claude 3.5 Sonnet | anthropic.claude-3-5-sonnet-20241022-v2:0 | bedrock/claude-3-5-sonnet | Latest Claude |
| Claude 3 Opus | anthropic.claude-3-opus-20240229-v1:0 | bedrock/claude-3-opus | High capability |
| Claude 3 Haiku | anthropic.claude-3-haiku-20240307-v1:0 | bedrock/claude-3-haiku | Fast, low-cost |
| Llama 3.1 70B | meta.llama3-1-70b-instruct-v1:0 | bedrock/llama-3-1-70b | Meta model |
| Mistral Large | mistral.mistral-large-2402-v1:0 | bedrock/mistral-large | Mistral model |
| Titan Embeddings | amazon.titan-embed-text-v2:0 | bedrock/titan-embed-text | Embeddings |
Setup & configuration
Bedrock supports SigV4 signing and direct API-key (Bearer) authentication. Choose the flow that matches your deployment. Bifrost signs every Bedrock request with AWS Signature Version 4; STS AssumeRole can layer on top of explicit or inherited credentials. See Setup & configuration in Bifrost docs.
Aliases vs deployments
The top-level aliases field (mapping model names to inference profile IDs, ARNs, or deployment identifiers) requires v1.5.0-prerelease2 or later. On v1.4.x, use deployments inside bedrock_key_config instead.
1. Explicit credentials
Provide access_key and secret_key in bedrock_key_config. Optionally set session_token for temporary credentials.
Web UI
- Go to Model Providers → Configurations → AWS Bedrock
- Click Add Key (or edit an existing key)
- Under Authentication Method, select Explicit Credentials
- Set Access Key, Secret Key, optional Session Token, and Region (e.g.
us-east-1) - Configure Aliases to map model names to inference profile IDs
- Save
Gateway API
# Step 1: Create the provider
curl -X POST http://localhost:8080/api/providers \
-H "Content-Type: application/json" \
-d '{"provider": "bedrock"}'
# Step 2: Create a key (explicit credentials)
curl -X POST http://localhost:8080/api/providers/bedrock/keys \
-H "Content-Type: application/json" \
-d '{
"name": "bedrock-key",
"models": ["*"],
"weight": 1.0,
"aliases": {
"claude-3-5-sonnet": "us.anthropic.claude-3-5-sonnet-20241022-v2:0"
},
"bedrock_key_config": {
"access_key": "env.AWS_ACCESS_KEY_ID",
"secret_key": "env.AWS_SECRET_ACCESS_KEY",
"session_token": "env.AWS_SESSION_TOKEN",
"region": "us-east-1"
}
}'config.json
{
"providers": {
"bedrock": {
"keys": [
{
"name": "bedrock-key",
"models": ["*"],
"weight": 1.0,
"aliases": {
"claude-3-5-sonnet": "us.anthropic.claude-3-5-sonnet-20241022-v2:0"
},
"bedrock_key_config": {
"access_key": "env.AWS_ACCESS_KEY_ID",
"secret_key": "env.AWS_SECRET_ACCESS_KEY",
"session_token": "env.AWS_SESSION_TOKEN",
"region": "us-east-1"
}
}
]
}
}
}2. Inherited AWS credentials / IAM role
When static credentials are omitted, Bifrost uses the AWS default credential chain: IAM roles (IRSA on EKS, ECS task role, EC2 instance profile), environment variables, and shared credential files.
Web UI
- Go to Model Providers → Configurations → AWS Bedrock
- Click Add Key
- Select IAM Role (Inherited)
- Set Region and optional Aliases
- Optional: Assume Role ARN, External ID, Session Name (default
bifrost-session) - Save — for system identity, leave Assume Role fields blank and attach a Bedrock-capable IAM role to the workload
Gateway API — system identity
curl -X POST http://localhost:8080/api/providers/bedrock/keys \
-H "Content-Type: application/json" \
-d '{
"name": "bedrock-iam",
"models": ["*"],
"weight": 1.0,
"aliases": {
"claude-3-5-sonnet": "us.anthropic.claude-3-5-sonnet-20241022-v2:0"
},
"bedrock_key_config": {
"region": "us-east-1"
}
}'Gateway API — STS AssumeRole
curl -X POST http://localhost:8080/api/providers/bedrock/keys \
-H "Content-Type: application/json" \
-d '{
"name": "bedrock-assume-role",
"models": ["*"],
"weight": 1.0,
"bedrock_key_config": {
"region": "us-east-1",
"role_arn": "env.AWS_ROLE_ARN",
"external_id": "env.AWS_EXTERNAL_ID",
"session_name": "bifrost-session"
}
}'3. API key
Set the key-level value to a Bearer token for direct API key auth. This path does not use SigV4 or STS AssumeRole.
Web UI
- Go to Model Providers → Configurations → AWS Bedrock
- Click Add Key
- Select API Key
- Set API Key (Bearer token) and Region
- Configure Aliases if needed, then save
curl -X POST http://localhost:8080/api/providers/bedrock/keys \
-H "Content-Type: application/json" \
-d '{
"name": "bedrock-api-key",
"value": "env.BEDROCK_API_KEY",
"models": ["*"],
"weight": 1.0,
"bedrock_key_config": {
"region": "us-east-1"
}
}'bedrock_key_config fields
| Field | Required | Default | Description |
|---|---|---|---|
| region | Yes | - | AWS region (e.g., us-east-1) |
| access_key | No | - | AWS access key ID |
| secret_key | No | - | AWS secret access key |
| session_token | No | - | Session token for temporary credentials |
| arn | No | - | ARN prefix for inference profile URLs (not the full model ARN) |
| role_arn | No | - | IAM role ARN for STS AssumeRole |
| external_id | No | - | External ID when required by trust policy |
| session_name | No | bifrost-session | AssumeRole session name for CloudTrail |
Key-level fields
| Field | Required | Description |
|---|---|---|
| aliases | No | Map model names to inference profile IDs or Bedrock model IDs (v1.5.0-prerelease2+) |
| models | Yes | Models this key serves; use ["*"] for all |
For application or cross-region inference profiles, put the ARN prefix in bedrock_key_config.arn and only the resource ID or model identifier in aliases — not the full ARN. See Inference profiles & ARN configuration.
API reference
OpenAI-compatible gateway endpoints routed to AWS Bedrock (Converse, Invoke, and control-plane APIs). Content aligned with Bifrost Bedrock provider docs.
1) Chat Completions
Primary path for Claude, Nova, Mistral, Llama, Cohere, and Titan chat models. Bifrost maps OpenAI parameters to Bedrock converse. Upstream: Converse API. Images must be base64 or data URI (remote URLs are not supported).
| Parameter | Bedrock handling | Notes |
|---|---|---|
| max_completion_tokens | → inferenceConfig.maxTokens | Required in Bedrock converse |
| temperature, top_p | Direct pass-through | inferenceConfig |
| stop | → inferenceConfig.stopSequences | Array of strings |
| response_format | → Structured output tool | Creates bf_so_* tool |
| tools / tool_choice | Bedrock ToolConfig | Schema restructured |
| reasoning | Model-specific thinking config | Claude vs Nova mapping |
| user | → metadata.userID | When provided |
| top_k | Via extra_params | Model-specific sampling |
Silently dropped: frequency_penalty, presence_penalty, logit_bias, logprobs, seed, parallel_tool_calls.
curl -X POST http://localhost:8080/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0",
"messages": [{"role": "user", "content": "Hello"}],
"max_completion_tokens": 1024,
"temperature": 0.7
}'2) Responses API
Uses the same underlying converse endpoint with conversion between OpenAI Responses format and Bedrock messages. Gateway: POST /v1/responses.
| Parameter | Transformation | Notes |
|---|---|---|
| max_output_tokens | → maxTokens via inferenceConfig | Renamed for Bedrock |
| temperature, top_p | Direct pass-through | |
| instructions | Becomes system message | Same as chat extraction |
| tools / tool_choice | Same as Chat Completions | |
| reasoning | Thinking/reasoning config | Model-family specific |
| stop | Via extra_params | Renamed to stopSequences |
- String
inputwraps as a user message; arrays convert to messages stopReasonmaps to responsestatus(completed / incomplete)- Streaming:
response.created→content_part.delta→output_item.done
curl -X POST http://localhost:8080/v1/responses \
-H "Content-Type: application/json" \
-d '{
"model": "bedrock/anthropic.claude-3-5-sonnet-20241022-v2:0",
"input": "Hello, how are you?",
"instructions": "You are a helpful assistant",
"max_output_tokens": 1024
}'3) Text Completions
Legacy completions via Bedrock invoke. Streaming is not supported. Only Claude (Anthropic) and Mistral models are supported.
- Claude: prompt wrapped as
\n\nHuman: {prompt}\n\nAssistant:;max_tokens→max_tokens_to_sample - Mistral: standard mapping; multiple outputs in
choices[] - Response:
choices[].text;stopReason→finish_reason
curl -X POST http://localhost:8080/v1/completions \
-H "Content-Type: application/json" \
-d '{
"model": "bedrock/anthropic.claude-3-haiku-20240307-v1:0",
"prompt": "The capital of France is",
"max_tokens": 64
}'4) Embeddings
Titan and Cohere embedding models via invoke. Gateway: POST /v1/embeddings. Non-streaming only.
| Parameter | Handling | Notes |
|---|---|---|
| input | Direct pass-through | Text or array of texts |
| dimensions | Not supported (Titan) | Fixed size per model |
| encoding_format | Via extra_params | base64 or float |
curl -X POST http://localhost:8080/v1/embeddings \
-H "Content-Type: application/json" \
-d '{
"model": "bedrock/amazon.titan-embed-text-v2:0",
"input": "Hello world"
}'5) Image Generation
Titan Image Generator v1/v2, Nova Canvas, and Stability AI models (flat JSON when model ID contains stability.). Upstream: invoke. Non-streaming.
| Parameter | Bedrock field | Notes |
|---|---|---|
| prompt | textToImageParams.text | |
| n | imageGenerationConfig.numberOfImages | |
| negative_prompt | textToImageParams.negativeText | |
| size | width & height | Parsed from WxH |
| quality | imageGenerationConfig.quality | low/medium → standard, high → premium |
curl -X POST http://localhost:8080/v1/images/generations \
-H "Content-Type: application/json" \
-d '{
"model": "bedrock/amazon.nova-canvas-v1:0",
"prompt": "A futuristic cityscape with a flying car",
"size": "1024x1024",
"n": 1
}'6) Image Edit
multipart/form-data (not JSON). Titan / Nova Canvas task types:
| type | Bedrock taskType | Notes |
|---|---|---|
| inpainting | INPAINTING | prompt + image; optional mask |
| outpainting | OUTPAINTING | prompt + image; optional mask |
| background_removal | BACKGROUND_REMOVAL | image only |
Stability AI edit models (model ID contains stability.) support inpaint, outpaint, remove-background, upscale, and more. See Image Edit.
curl -X POST http://localhost:8080/v1/images/edits \ -F "model=bedrock/amazon.nova-canvas-v1:0" \ -F "type=inpainting" \ -F "image[]=@photo.png;type=image/png" \ -F "mask=@mask.png;type=image/png" \ -F "prompt=Replace the masked area with a garden"
7) Image Variation
multipart/form-data. Titan Image Generator and Nova Canvas models. Task type IMAGE_VARIATION. Optional similarityStrength (0.2–1.0) via extra params. Non-streaming.
curl -X POST http://localhost:8080/v1/images/variations \ -F "model=bedrock/amazon.nova-canvas-v1:0" \ -F "image[]=@source.png;type=image/png" \ -F "n=2" \ -F "size=1024x1024"
8) Files API
S3-backed file operations integrated with Bedrock. Upload uses multipart/form-data. File purpose is always batch; status is always processed.
POST /v1/files— multipart upload (file required, filename optional)GET /v1/files— list (cursor pagination)GET /v1/files/{file_id}— retrieve metadataDELETE /v1/files/{file_id}— deleteGET /v1/files/{file_id}/content— download content
curl -X POST http://localhost:8080/v1/files \ -F "file=@document.pdf" \ -F "filename=report.pdf"
9) List Models
Lists foundation models via Bedrock control plane (listFoundationModels). No request body. Results respect region, aliases/deployments, and per-key models allowlists; multi-key configs aggregate results.
curl http://localhost:8080/v1/models
id— model name (with deployment prefix when configured)display_name→name- Pagination via
NextPageToken
10) Error handling
Bedrock HTTP errors map to Bifrost error types. Special cases: context cancellation → RequestCancelled; timeouts → ErrProviderRequestTimedOut; streaming errors sent on the stream channel.
| HTTP status | Bifrost error type | Notes |
|---|---|---|
| 400 | invalid_request_error | Bad request parameters |
| 401 | authentication_error | Invalid or expired credentials |
| 403 | permission_denied_error | Access denied to model or resource |
| 404 | not_found_error | Model or resource not found |
| 429 | rate_limit_error | Rate limit exceeded |
| 500 | api_error | Server error |
| 529 | overloaded_error | Service overloaded |
Implementation caveats
| Caveat | Impact | Severity |
|---|---|---|
| Image format limitation | Only base64/data URI supported; remote URLs not accepted | High |
| Reasoning budget minimum | Claude reasoning requires minimum 1024-token budget | High |
| Text completion streaming | Not supported by upstream Bedrock API | Medium |
| System message extraction | System messages removed from array, placed in separate field | High |
| Tool message grouping | Consecutive tool messages merged into single user message | Medium |
| Model-specific parameters | Aliases required v1.5.0+; earlier versions use deployments config | Medium |
Authoritative references
- Bifrost Bedrock provider reference: docs.getbifrost.ai/providers/supported-providers/bedrock
- AWS Bedrock documentation: docs.aws.amazon.com/bedrock
- Bifrost provider support overview: docs.getbifrost.ai/providers/supported-providers/overview