Skip to content
AI GatewayAI Gateway Manual

Connect AWS Bedrock

How organization administrators add an AWS Bedrock Provider and choose a region and model IDs, the principles AI Gateway uses for prices and token limits that AWS does not state, and how to use embedding and image generation models.

This guide explains how organization administrators connect models on AWS Bedrock, such as Claude, to AI Gateway. Users then call these models through AI Gateway like models of any other Provider. The flow shared by every Provider is in Connect model Providers.

Request typeAWS BedrockAWS Bedrock Mantle
ChatSupportedSupported
EmbeddingsTitan Text, Cohere Embed, Nova Embeddings text mode. See EmbeddingsNot supported
Image generationThree Stability models. See Image generationNot supported

Embeddings and image generation need no setting to turn on and no endpoint path. They use the existing Provider’s base URL, authentication, and network settings.

  • Permission: only organization administrators (org-admin) can add Providers.
  • Region: choose the AWS region whose models you will use. Each region offers different models, so check this first (see Choose model IDs).
  • AWS credentials: decide how AI Gateway signs in to Bedrock (see Authentication methods). The identity, or the role it assumes, needs bedrock:InvokeModel, bedrock:InvokeModelWithResponseStream, bedrock:ListFoundationModels, bedrock:ListInferenceProfiles in that region. To assume a role, the identity also needs sts:AssumeRole on that role. A request that calls a GPT model through the Responses API, such as one from Codex, goes to the Bedrock Responses API, which also checks bedrock:InvokeModel on your account’s default project. If your policy limits Resource to model or inference profile ARNs, add arn:aws:bedrock:<region>:<account-id>:project/default. Every AWS account already has this default project. To also serve token-counting requests from clients, grant bedrock:CountTokens (see Token counting).

Open the admin console from the Organization settings tab at the top of the screen. Paths such as AI resources → Model Providers below are groups and items in the admin console’s left menu.

  1. In AI resources → Model Providers, click Add provider.
  2. Enter a Name. It becomes the prefix of every model users call, for example bedrock-us/us.anthropic.claude-sonnet-5-5.
  3. Set Provider type to AWS Bedrock.
  4. Base URL is prefilled with https://bedrock-runtime.us-east-1.amazonaws.com. For another region, change it to https://bedrock-runtime.<region>.amazonaws.com. A URL you enter that differs from the default is preserved when you change Provider type. No other address format is accepted.
  5. Choose the Authentication method and enter its values. Secrets are stored write-only.
  6. Click Save provider.

AI Gateway checks the credentials by reading the region’s model list. If they are rejected, the form says so and the Provider is not created.

MethodWhat to enterWhen to use
API keyA Bedrock API key in CredentialTrying Bedrock out. A short-term key stops working when it expires (after 12 hours at most), so choose another method for lasting use.
IAM access keyAccess key ID and Secret access key; Session token only for temporary credentialsInstallations outside AWS.
Server default credentialsNothing: AI Gateway uses the AWS credentials of its serverInstallations on EC2 with an instance role. See Amazon Bedrock with the host’s AWS credentials for the conditions.

IAM access key and Server default credentials can also assume a role. Enter its Role ARN, and the External ID if the role’s trust policy requires one. Session name defaults to ai-gateway. Requests then use the role’s temporary credentials, which AI Gateway renews.

With Server default credentials, every administrator who can manage Providers calls Bedrock with the server’s AWS permissions, and can assume any role the server may assume. Limit the server role to calling Bedrock and to the roles it needs.

On the Provider’s General page you can switch the method or replace its values. Stored secrets are never shown.

  • To replace an API key, enter the new key in Credential. Leave it blank to keep the stored key. Switching to API key from another method needs a key.
  • Any change to an IAM access key Provider, its role included, needs the Access key ID and Secret access key again, and the Session token if the key is temporary.
  • Switching to Server default credentials deletes the stored key.

AI Gateway checks the new settings by reading the model list before saving. If they are rejected, nothing is saved and the Provider keeps its previous settings.

To keep traffic inside your VPC, create interface VPC endpoints for both bedrock-runtime (requests) and bedrock (model list) in the same region, with private DNS enabled. The Base URL stays https://bedrock-runtime.<region>.amazonaws.com; private DNS resolves it to the endpoint. Endpoint-specific host names are not accepted.

A VPC endpoint resolves to private addresses, so turn on Allow private network in the Provider’s Network section. See Provider network settings.

Keep requests in one region with Bedrock Mantle

Section titled “Keep requests in one region with Bedrock Mantle”

The inference profiles that the AWS Bedrock type uses (jp., us., global.) can send a request to several regions. When requests must stay in one region, add another Provider of the AWS Bedrock Mantle type, which uses the Bedrock Mantle endpoint. For example, a jp. profile spreads requests across Tokyo and Osaka, while a Tokyo Mantle Provider processes them only in Tokyo.

Add it as in Add the Provider, with these differences:

  • Provider type is AWS Bedrock Mantle.
  • Base URL is prefilled with https://bedrock-mantle.ap-northeast-1.api.aws. For another region, change it to https://bedrock-mantle.<region>.api.aws. A URL you enter that differs from the default is preserved when you change Provider type. An address with a path or a bedrock-runtime address is not accepted.
  • IAM permissions differ. Mantle does not check bedrock:* permissions. Grant the account or the role it assumes bedrock-mantle:CreateInference and bedrock-mantle:ListModels, and bedrock-mantle:CallWithBearerToken as well if you authenticate with an API key. To also serve token-counting requests, grant bedrock-mantle:CountTokens.

The authentication methods and changing the authentication work as for the AWS Bedrock type.

The Models page lists every model that Mantle serves, with IDs that have no geography prefix, for example anthropic.claude-haiku-4-5, openai.gpt-5.6-sol, and qwen.qwen3-32b. Models other than Claude (GPT, gpt-oss, Gemma, Qwen, and others) can be called through Chat Completions, Responses, or Messages, as Claude can. Each region offers different models; as of November 2026, Tokyo offers Claude Haiku 4.5, Opus 4.7, and Opus 4.8 along with gpt-oss, Qwen, Gemma 3, and others, while GPT-5.x and 6.x are only in us-east-1. A Mantle Provider added before this feature has only Claude models; to add the rest, click Check for model updates on the Models page.

The built-in price is the regional rate of the same model. For Claude it is 10% above the Global profile rate and the same in Tokyo and us-east-1. For other models the Tokyo rate is about 20% higher, so the default is the us-east-1 rate and a Tokyo Provider overrides it with the Tokyo rate. To override it, follow Override with this Provider’s rates.

When the Provider is created, its Models page lists two kinds of IDs from the region:

KindExampleUse
Inference profileus.anthropic.claude-sonnet-5-5, global.anthropic.claude-sonnet-5-5Use these. Current Claude models are called through a profile.
Foundation modelanthropic.claude-sonnet-5-5Usually cannot be called directly; Bedrock rejects the request as unsupported for on-demand use.
  • Profiles differ by region. A profile’s prefix names where it runs: us., eu., jp., au., ca., in. for a geography, and global. for any region. A region lists only the profiles it serves. For example, us-east-1 lists all current Claude models, ap-northeast-1 lists some, and Seoul (ap-northeast-2) has no current Claude profiles. To use those models from Korea, add a Provider for us-east-1 or ap-northeast-1.
  • Blocked profiles look like authentication failures. If your organization’s AWS service control policy (SCP) denies a profile, such as every global. profile, the request fails as if the key were rejected. Open the request in Activity → Model Logs and read Provider error message to see the denial.
  • New models. To pick up models AWS adds later, click Check for model updates on the Models page and choose the changes to apply.

Capabilities in Model details shows each model’s Context window, Max input tokens, and Max output tokens. Your users’ clients receive the same values. Some coding clients use Max input tokens to decide when to compact a conversation, and leave out models that do not have it.

AWS model cards state a context window and a maximum output, but no maximum input. AI Gateway sets Max input tokens by these principles:

ModelMax input tokensWhy
ClaudeThe model card’s context windowAnthropic defines the maximum input as the maximum input context window.
OpenAI GPT (such as us.openai.gpt-5.6-sol; not gpt-oss)The value of the same model on an OpenAI Provider (for example, 922,000 for GPT-5.6 Sol)It follows OpenAI’s limit, so both routes report the same value.
Other modelsThe model card’s context windowThe card gives no other limit.

Other values missing from a model card, such as some models’ maximum output, stay empty. For a model whose real input limit is smaller than its context window, a client may compact a little later than it should. To use a different value, open Model details, click Edit capabilities, and change Max input tokens. The change applies to this Provider only.

Clients such as Claude Code may ask how many input tokens a request has before sending it. AI Gateway sends that request to AWS’s token-counting API and returns the real count. AWS does not charge for these calls, and AI Gateway does not add them to Project usage or budgets.

Provider typeModels countedIAM permission
AWS BedrockModels for which AWS supports token counting on bedrock-runtime. As of November 2026, Claude Haiku 4.5 is counted, and Claude Opus 4.7, Haiku 5.5, Sonnet 5.5, and Opus 5.5 are not. GPT models are not counted.bedrock:CountTokens
AWS Bedrock MantleThe Claude models Mantle provides. Other models are not counted.bedrock-mantle:CountTokens

A request for a model that is not counted, or to a Provider without the permission, fails, and Claude Code uses its own estimate instead. If you need exact counts for the latest Claude models, call them through a Bedrock Mantle Provider. Check each model’s support under Count tokens on its AWS model card.

AWS bills a request at the rate of the region the request starts from, even for the same model ID. us. and global. profiles are billed at the Provider’s region rate too. AI Gateway, however, keeps one built-in price per model ID, so it reviews the AWS Price List and sets that price by these principles. The price shows as Built-in on the Models page, and Version on the Pricing tab tells you which review it comes from.

CaseBuilt-in price
The rate is the same in every region that can call the IDThat rate
The rate differs by regionThe us-east-1 rate. If the ID cannot be called from us-east-1 or the Price List has no us-east-1 rate for it, the lowest rate among the regions that can call it
The Price List has no Bedrock Runtime rate, only a Bedrock Mantle rateThe same model’s Mantle rate, chosen the same way
No reviewed commercial-region rate (OpenAI GPT-5.x and GLM 5.3 on the AWS Bedrock type, GLM 4.6 on Mantle)None

Flex, Priority, and Batch rates are not used. Built-in prices are reviewed again when AI Gateway is updated.

A Provider outside us-east-1 can have a built-in price below its real rate. For example, deepseek.v3-v1:0 input costs $0.70 per million tokens in Tokyo, while the built-in price is $0.58. A rate you negotiated with AWS can also differ from the built-in price.

  1. On the Models page, click View pricing for the model to open the Pricing tab. For a model with no built-in price, click Set price.
  2. If the model has a built-in price, Input and Output start with its rates. Change them to this Provider’s regional or negotiated rates.
  3. Leave Cached input and Cache write blank to keep the built-in cache rates. Without a built-in cache rate, cached input is charged at the input rate, and a request with cache writes records its cost as Unavailable.
  4. Click Save price. Pricing source changes to Custom, and new requests to this Provider use the new rates.

The override belongs to this Provider only, so two Providers in different regions can price the same ID differently. Clear price returns the model to its built-in price. An overridden input and output rate applies to every request size, so the built-in price’s long-input rates no longer apply.

A model with no built-in price can still be called before you set a price, but its cost is recorded as Unavailable and adds $0 to project Budgets. The accounting rules shared by every Provider are in Model pricing and costs.

Embeddings use the input rate saved for this Provider and model first. Without a saved price, they use only an exact match in the Bedrock built-in prices. OpenAI or direct Cohere prices are never substituted. If no input rate applies, save one as in Override with this Provider’s rates.

The following models have built-in fixed per-image rates, reviewed on 2026-11-16 against their AWS Marketplace Amazon Bedrock Edition price lists. Every row of both price lists shows the same rate, so the rates are not split by region.

ModelBuilt-in rate per image
stability.stable-image-core-v1:10.04 USD
stability.stable-image-ultra-v1:10.14 USD

stability.sd3-5-large-v1:0 has no built-in price because its official Bedrock rate could not be confirmed. Its cost remains Unavailable until an administrator saves a fixed per-image rate.

The current Stability conversion does not send size or quality to AWS, so these fields cannot be price conditions. Set the rate with Fixed per image, which has no size or quality conditions.

  1. Open the model’s price from the Models list. Under Image pricing, Pricing source shows Built-in and “This Provider can override the built-in price below.” Fixed per image is selected, and the USD per image field holds the built-in rate.
  2. If this Provider’s actual rate differs, such as a negotiated rate, change the value and select Save image price. Pricing source changes to Custom, and the price applies to this Provider only.
  3. To return to the built-in price, select Clear image price. Pricing source shows Built-in again.

AI Gateway does not synchronize AWS prices automatically. If AWS changes its rates, override the price on the Provider or use the re-reviewed prices included in an AI Gateway update. The image pricing modes are described in Image prices.

Bedrock does not fetch files by URL, so AI Gateway sends images and documents to Bedrock as file contents:

  • Base64 data URI: sent as is.
  • Public http(s) URL: AI Gateway downloads the file, up to 25 MiB and 20 seconds per URL. Private addresses and cloud metadata addresses are refused, and the request fails without reaching Bedrock.
  • s3:// reference: passed to Bedrock for models that read S3 objects.

An existing Bedrock Provider accepts POST /v1/embeddings. No embedding-specific Provider or endpoint path is needed. The Provider’s existing authentication method (API key, IAM access key, or Server default credentials, with any assumed role) applies. The AWS Bedrock Mantle type does not support embeddings.

  1. Find the embedding model you want in the Models list. Examples include amazon.titan-embed-text-v2:0, cohere.embed-english-v3, and amazon.nova-2-multimodal-embeddings-v1:0. Availability and model access depend on the AWS region and account.
  2. If needed, save an embedding model price.
  3. Add <Provider name>/<model ID> to the project’s model allow policy. Users call it with a Gateway Key from that project.
Model familyAccepted inputConstraint
Titan TextA string or a one-element string arrayTwo or more inputs return 400
Cohere EmbedA string or a non-empty string arraySends the batch in one AWS request
Nova Embeddings text modeA string or a one-element string arrayTwo or more inputs return 400

Token arrays, images, audio, and video are not accepted. AI Gateway does not split input into multiple AWS requests, so call Titan and Nova separately for each text. Application inference profile ARNs that do not identify a model family are also unsupported. Size limits are in Request size limits.

Input usage comes from Titan’s inputTextTokenCount response field or the X-Amzn-Bedrock-Input-Token-Count header for Cohere and Nova. Titan uses the header only when its field is absent. An explicit zero is valid usage; missing or invalid values remain Unavailable. A failed response that reports valid usage also settles that input once.

The AWS Bedrock type accepts POST /v1/images/generations for the following Bedrock Runtime models. AWS lists all three as Active in us-west-2. The AWS Bedrock Mantle type does not support image generation.

  • Stable Image Core (stability.stable-image-core-v1:1)
  • Stable Image Ultra (stability.stable-image-ultra-v1:1)
  • Stable Diffusion 3.5 Large (stability.sd3-5-large-v1:0)

Titan Image Generator v1/v2, Nova Canvas, Stable Image Core/Ultra v1:0, and Stable Diffusion 3 Large have reached end of life and are unsupported. AI Gateway does not automatically replace retired IDs with current models. Check the AWS model cards for availability and retirement status. Opaque application profile ARNs and other image models are not treated as supported based on their names alone.

  1. In Model Providers, open the Bedrock Provider and check that its base URL is https://bedrock-runtime.us-west-2.amazonaws.com. Its authentication settings need bedrock:InvokeModel permission for the model. Permission to list models is separate from permission to generate images.
  2. Check that a supported model, such as stability.stable-image-core-v1:1, appears in Models, then allow it in the project’s model policy.
  3. Call the official OpenAI SDK’s images.generate with a Gateway Key from that project. AI Gateway converts the request to Bedrock’s InvokeModel format and sends it once.

Bedrock returns b64_json. Even with response_format="url", AI Gateway does not create URLs or host images. Filtered results and results containing Provider errors are not returned as successful images. Prices are in Image model prices.