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.
Supported request types
Section titled “Supported request types”| Request type | AWS Bedrock | AWS Bedrock Mantle |
|---|---|---|
| Chat | Supported | Supported |
| Embeddings | Titan Text, Cohere Embed, Nova Embeddings text mode. See Embeddings | Not supported |
| Image generation | Three Stability models. See Image generation | Not 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.
Before you start
Section titled “Before you start”- 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:ListInferenceProfilesin that region. To assume a role, the identity also needssts:AssumeRoleon 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 checksbedrock:InvokeModelon your account’s default project. If your policy limitsResourceto model or inference profile ARNs, addarn:aws:bedrock:<region>:<account-id>:project/default. Every AWS account already has this default project. To also serve token-counting requests from clients, grantbedrock: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. Add the Provider
Section titled “1. Add the Provider”- In AI resources → Model Providers, click Add provider.
- Enter a Name. It becomes the prefix of every model users call, for example
bedrock-us/us.anthropic.claude-sonnet-5-5. - Set Provider type to AWS Bedrock.
- Base URL is prefilled with
https://bedrock-runtime.us-east-1.amazonaws.com. For another region, change it tohttps://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. - Choose the Authentication method and enter its values. Secrets are stored write-only.
- 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.
Authentication methods
Section titled “Authentication methods”| Method | What to enter | When to use |
|---|---|---|
| API key | A Bedrock API key in Credential | Trying 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 key | Access key ID and Secret access key; Session token only for temporary credentials | Installations outside AWS. |
| Server default credentials | Nothing: AI Gateway uses the AWS credentials of its server | Installations 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.
Change the authentication
Section titled “Change the authentication”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.
Reach Bedrock through a VPC endpoint
Section titled “Reach Bedrock through a VPC endpoint”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 tohttps://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 abedrock-runtimeaddress is not accepted. - IAM permissions differ. Mantle does not check
bedrock:*permissions. Grant the account or the role it assumesbedrock-mantle:CreateInferenceandbedrock-mantle:ListModels, andbedrock-mantle:CallWithBearerTokenas well if you authenticate with an API key. To also serve token-counting requests, grantbedrock-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.
2. Choose model IDs
Section titled “2. Choose model IDs”When the Provider is created, its Models page lists two kinds of IDs from the region:
| Kind | Example | Use |
|---|---|---|
| Inference profile | us.anthropic.claude-sonnet-5-5, global.anthropic.claude-sonnet-5-5 | Use these. Current Claude models are called through a profile. |
| Foundation model | anthropic.claude-sonnet-5-5 | Usually 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, andglobal.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.
Token limits
Section titled “Token limits”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:
| Model | Max input tokens | Why |
|---|---|---|
| Claude | The model card’s context window | Anthropic 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 models | The model card’s context window | The 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.
Token counting
Section titled “Token counting”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 type | Models counted | IAM permission |
|---|---|---|
| AWS Bedrock | Models 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 Mantle | The 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.
3. Prices
Section titled “3. Prices”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.
| Case | Built-in price |
|---|---|
| The rate is the same in every region that can call the ID | That rate |
| The rate differs by region | The 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 rate | The 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.
Override with this Provider’s rates
Section titled “Override with this Provider’s rates”- 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.
- 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.
- 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.
- 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.
Embedding model prices
Section titled “Embedding model prices”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.
Image model prices
Section titled “Image model prices”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.
| Model | Built-in rate per image |
|---|---|
stability.stable-image-core-v1:1 | 0.04 USD |
stability.stable-image-ultra-v1:1 | 0.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.
- 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.
- 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.
- 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.
4. Images and documents in requests
Section titled “4. Images and documents in requests”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.
Embeddings
Section titled “Embeddings”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.
- Find the embedding model you want in the Models list. Examples include
amazon.titan-embed-text-v2:0,cohere.embed-english-v3, andamazon.nova-2-multimodal-embeddings-v1:0. Availability and model access depend on the AWS region and account. - If needed, save an embedding model price.
- Add
<Provider name>/<model ID>to the project’s model allow policy. Users call it with a Gateway Key from that project.
| Model family | Accepted input | Constraint |
|---|---|---|
| Titan Text | A string or a one-element string array | Two or more inputs return 400 |
| Cohere Embed | A string or a non-empty string array | Sends the batch in one AWS request |
| Nova Embeddings text mode | A string or a one-element string array | Two 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.
Image generation
Section titled “Image generation”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.
- 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 needbedrock:InvokeModelpermission for the model. Permission to list models is separate from permission to generate images. - 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. - Call the official OpenAI SDK’s
images.generatewith a Gateway Key from that project. AI Gateway converts the request to Bedrock’sInvokeModelformat 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.