multi-router.aidocs

Providers & Models

AWS Bedrock

Connect an AWS account to Multi-Router and route requests to the models AWS Bedrock serves.

AWS Bedrock is Amazon's managed model platform, serving models from Anthropic, Amazon, Meta, Mistral, DeepSeek, Qwen, OpenAI, Moonshot, Nvidia and Z.ai in AWS regions under your AWS account. Multi-Router calls Bedrock with a provider key that holds AWS credentials and a default region. AWS bills usage to the account that owns the credentials, and Multi-Router records the cost of each request at the catalog price of the region and inference scope that served it.

Preparing your AWS account

The AWS account that serves requests needs model access and an IAM identity whose credentials Multi-Router uses:

  1. Bedrock enables serverless models automatically on first use. Before the first call to an Anthropic model, submit Anthropic's one-time use-case form in the Bedrock console. Models sold through AWS Marketplace subscribe on first use, so the identity that makes the first call needs aws-marketplace:Subscribe and aws-marketplace:ViewSubscriptions, or an administrator with those permissions calls each model once.
  2. Create an IAM user for Multi-Router and attach a policy that allows bedrock:InvokeModel and bedrock:InvokeModelWithResponseStream, such as the policy below. To use a Bedrock API key, also allow bedrock:CallWithBearerToken.
  3. Create the credential Multi-Router will use: an access key for the IAM user, or a long-term Bedrock API key.

These actions cover every request Multi-Router sends to Bedrock, including streaming. Requests through geo inference profiles are authorized against the profile and against the foundation model in every region of the geography, and requests through global profiles are also authorized against the region-less foundation model resource, which the policy lists. A service control policy that limits aws:RequestedRegion must allow every region of the geography for geo profiles, and the value unspecified for global profiles.

IAM policy for Multi-Routerjson
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Sid": "MultiRouterBedrockInvoke",
      "Effect": "Allow",
      "Action": [
        "bedrock:InvokeModel",
        "bedrock:InvokeModelWithResponseStream"
      ],
      "Resource": [
        "arn:aws:bedrock:*::foundation-model/*",
        "arn:aws:bedrock:::foundation-model/*",
        "arn:aws:bedrock:*:<ACCOUNT_ID>:inference-profile/*"
      ]
    },
    {
      "Sid": "MultiRouterBedrockApiKey",
      "Effect": "Allow",
      "Action": "bedrock:CallWithBearerToken",
      "Resource": "*"
    }
  ]
}

Adding a Bedrock provider key

A Bedrock provider key holds one set of AWS credentials and the AWS region requests go to by default. To add one, open LLM Provider Keys in the dashboard, add a key, select AWS Bedrock, and choose Access key (SigV4) or API key (bearer) at the top of the form:

LLM Provider Keys

Upstream credentials used to call providers. The default key for each provider is what gets used when a request reaches that provider without a router preset overriding it. Secrets are encrypted at rest; the value can’t be retrieved after creation.

B
AWS Bedrock
2 keys · default Bedrock production
Add AWS Bedrock key

New AWS Bedrock key

Access key (SigV4)API key (bearer)
CancelSave key
Name
bedrock-analytics

Short dashboard handle. Lowercase, hyphens.

AWS Region
us-east-1
US East (N. Virginia)

Bedrock runtime endpoint is region-scoped. Pick the region your model access is enabled in.

AWS Access Key ID
AKIAIOSFODNN7EXAMPLE

The Access Key ID half of your IAM credentials.

Secret access key
••••••••••••••••••••••••••••••••••••••••

Encrypted at rest. Can’t be retrieved later.

Description
Analytics team's Bedrock access in us-east-1. Owner: data platform. Rotate every 90 days.
Make this the default AWS Bedrock key(use “Make default” on the new key’s row after creation to promote it)
The New AWS Bedrock key form in Access key (SigV4) mode. Select to enlarge.
FieldDescription
NameRequired, up to 80 characters.
AWS RegionThe region requests go to when the router names none.
AWS Access Key IDFor Access key (SigV4): the access key id of the IAM user, 16 to 128 letters and digits.
Secret access keyFor Access key (SigV4): the secret access key of the IAM user. For API key (bearer), the field reads Bedrock API key and holds the API key.
Session tokenOptional, for Access key (SigV4) with temporary AWS credentials, up to 4,096 bytes.
DescriptionOptional.

The key's region is one of us-east-1, us-east-2, us-west-2, ca-central-1, sa-east-1, eu-central-1, eu-west-1, eu-west-2, eu-west-3, eu-north-1, eu-south-1, ap-south-1, ap-southeast-1, ap-southeast-2, ap-northeast-1, ap-northeast-2 and ap-northeast-3, and a router can name any region the catalog lists for its variant. When the key is saved, Multi-Router checks the region, the access key id format and the session token length, and AWS checks the credentials on the first request. Multi-Router uses a Bedrock API key only in the key's region.

Temporary credentials with a session token expire, and AWS short-term Bedrock API keys last at most 12 hours, so long-running routers use an IAM user access key or a long-term Bedrock API key. The region and credentials of a saved key are fixed, and changing them means adding a new key; see Provider Key.

Regions and inference scopes

Each Bedrock request goes to one AWS region, which is the router's region or, when the router names none, the provider key's region. The router's variant then sets where inference runs: in_region keeps it in that region, geo keeps it in that region's geography, and global lets AWS run it in any region. A model not offered in the selected region and variant returns region_not_served with the regions where it is available. See Regions & Variants.

Models and features

Bedrock features depend on the model's publisher:

FeatureClaude modelsOther publishers
StreamingYesYes, for models whose catalog entry lists streaming
System promptsYesYes
ToolsYesYes, for models whose catalog entry lists tools
Tool choiceYesYes, for models whose catalog entry lists tools
ImagesYesModels whose catalog entry lists image input, such as Amazon Nova, Llama 4 and Qwen3 VL
ReasoningYes, with thinking and budget_tokens on the Messages APINo
Prompt cachingYes, with cache_control on the Messages APINo
Structured outputNoNo
Samplingtemperature, top_p, top_k, stop sequencestemperature, top_p, stop sequences

A request with a json_object or json_schema response format returns an error for every Bedrock model. Multi-Router downloads images sent as URLs and passes them to Bedrock as image data: an image URL must use HTTPS and return HTTP 200, with a PNG, JPEG, GIF or WebP content type, and an image of at most 5 MiB, within 10 seconds.

Errors and retries

Bedrock errors reach the caller as Multi-Router errors, with the AWS error in the response's upstream object. Multi-Router retries HTTP 429, 500, 502, 503, 504 and 529 responses, timeouts and connection failures, with exponential backoff and any whole-second retry delay AWS sends, within five minutes of the first attempt. Each attempt must receive a response within 120 seconds, so long outputs use streaming. When retries are exhausted, the request returns 429 upstream_rate_limit, or 502 upstream_server_error when the last attempt failed with a server error, with the upstream code max_attempts_exceeded.

AWS errorMulti-Router errorCommon cause
ThrottlingException429 upstream_rate_limit after retriesRequests exceed the account quota for the model and region.
ModelNotReadyException429 upstream_rate_limit after retriesThe model is not yet ready to serve requests.
InternalServerException502 upstream_server_error after retriesBedrock had an internal error.
ServiceUnavailableException502 upstream_server_error after retriesBedrock is temporarily unavailable.
ServiceQuotaExceededException402 upstream_insufficient_quotaThe account has reached a Bedrock service quota.
AccessDeniedException502 upstream_invalid_credentialsThe IAM policy does not allow the action, or the model has not been enabled for the account.
UnrecognizedClientException502 upstream_invalid_credentialsThe access key or Bedrock API key is invalid.
ExpiredTokenException502 upstream_invalid_credentialsThe temporary credentials or session token have expired.
ValidationException400 upstream_invalid_requestBedrock rejected the request, such as a parameter the model does not accept or a prompt longer than its context window.
ResourceNotFoundException400 upstream_model_not_foundThe model or inference profile is not available in the region.
ModelTimeoutException408 upstream_otherThe model timed out while processing the request.
ModelErrorException424 upstream_otherThe model failed while processing the request.

Errors that occur after a streaming response has started are returned as an error event in the stream.

Pricing

Bedrock prices differ by region and inference scope. Multi-Router records the cost of each request at the price of the region and variant that served it, including separate rates for prompt cache reads and cache writes on Claude models, and sends requests on Bedrock's standard on-demand tier. See Model Catalog.

Claude Code on Bedrock

A Claude Proxy on a Bedrock route serves Claude Code in its Bedrock mode. The Claude Proxy routes are Bedrock (Global), Bedrock (Geo) and Bedrock (In-region), each with a region set on the Claude Proxy, and the route and region decide where inference runs, whatever inference profile prefix the client sends. Multi-Router forwards the request body unchanged, replaces the model id with the route's id for the proxy's region, and signs the request with the organization's Bedrock key. Claude Proxy requests are sent to Bedrock once, without retries, and Bedrock's status and error body are returned to the client unchanged. The dashboard generates the environment for each developer:

Claude Code environmentbash
export CLAUDE_CODE_USE_BEDROCK=1
export CLAUDE_CODE_SKIP_BEDROCK_AUTH=1
export ANTHROPIC_BEDROCK_BASE_URL='https://api.multi-router.ai/bedrock'
export ANTHROPIC_AUTH_TOKEN='<Multi-Router API key>'
export ANTHROPIC_CUSTOM_HEADERS='X-MR-Router: <router id>'

See Agents & Editors.

Regions & VariantsGoogle Vertex
Was this helpful?