Amazon Bedrock provider

Related Documentation
Minimum Version
AI Gateway - 2.0
Incompatible with
on-prem
Tags
#ai
Previous Versions of this page

You can proxy requests to Amazon Bedrock AI models through AI Gateway by creating AI Model Provider and AI Model entities. This reference documents all supported AI capabilities, configuration requirements, and provider-specific details needed for proper integration.

Upstream paths

AI Gateway automatically routes requests to the appropriate Amazon Bedrock API endpoints. The following table shows the upstream paths used for each capability.

Capability

Path template

Description

Upstream path or API

Generate /chat/completions, /completions, or /responses Text generation for chat completions and responses Uses the Converse and ConverseStream API
Embeddings /embeddings Vector embeddings from text input Uses the InvokeModel and InvokeWithResponseStream API
Image /images/generations or /images/edits Image generation and editing Uses the InvokeModel API
Video /videos Video generation Uses the StartAsyncInvoke API
Batches /batches Batch processing of requests Uses the ModelInvocationJob API
Files /files File management and storage /openai/files

Supported capabilities

The following tables show the AI capabilities supported by the Amazon Bedrock provider when configuring AI Models.

By default, AI Gateway uses the path templates shown in the tables below (e.g., /chat/completions, /embeddings, etc.). To customize these paths, configure the config.paths field in your AI Model entity. Custom paths take the form {configured_path}/{template_path} — for example, if you set a custom path of /v2, requests to /embeddings would be routed to /v2/embeddings.

Text generation

Support for Amazon Bedrock text generation capabilities:

Capability

Streaming

Model example

Path template

Min version

generate Supported Use the model name for the specific LLM provider /chat/completions, /completions, or /responses 2.0

Embeddings

Support for Amazon Bedrock embeddings generation:

Capability

Model example

Path template

Min version

embeddings Use the model name for the specific LLM provider /embeddings 2.0

Image

Support for Amazon Bedrock image generation and editing capabilities:

Capability

Model example

Path template

Min version

image Use the model name for the specific LLM provider /images/generations or /images/edits 2.0

For requests with large payloads, consider increasing config.max_request_body_size on your AI Model entity to three times the raw binary size.

Supported image sizes and formats vary by model. Refer to your provider’s documentation for allowed dimensions and requirements.

Video

Support for Amazon Bedrock video generation capabilities:

Capability

Model example

Path template

Min version

video Use the model name for the specific LLM provider /videos 2.0

For requests with large payloads (video generation), consider increasing config.max_request_body_size on your AI Model entity to three times the raw binary size.

Batches

Support for Amazon Bedrock batch processing capabilities:

Capability

Model example

Path template

Min version

batches1 n/a /batches 2.0

1 Batches processing for Bedrock is supported in the native format from SDK only

Batches are configured on a separate AI Model with type: "api", distinct from regular models that handle synchronous capabilities like generate and embeddings. Create a dedicated AI Model exclusively for batches and files, as each model must be either a regular model or an API model, not both.

Files

Support for Amazon Bedrock file management capabilities:

Capability

Model example

Path template

Min version

files2 n/a /files 2.0

2 Amazon Bedrock does not have a dedicated files API. File storage uses Google Cloud Storage, similar to AWS S3.

Batches are configured on a separate AI Model with type: "api", distinct from regular models that handle synchronous capabilities like generate and embeddings. Create a dedicated AI Model exclusively for batches and files, as each model must be either a regular model or an API model, not both.## Amazon Bedrock base URL

The base URL is https://bedrock-runtime.{region}.amazonaws.com.

AI Gateway uses this URL automatically. You only need to configure a URL if you’re using a self-hosted or Amazon Bedrock-compatible endpoint, in which case set the upstream_url option in your AI Model configuration.

Supported native LLM formats for Amazon Bedrock

By default, AI Gateway uses OpenAI-compatible request formats. Configure a native format in your AI Model to use Amazon Bedrock-specific APIs and features.

The following native Amazon Bedrock formats are supported:

LLM format

Supported APIs

bedrock
  • /model/{model_name}/converse
  • /model/{model_name}/converse-stream
  • /model/{model_name}/invoke
  • /model/{model_name}/invoke-with-response-stream
  • /model/{model_name}/retrieveAndGenerate
  • /model/{model_name}/retrieveAndGenerateStream
  • /model/{model_name}/rerank
  • /model/{model_name}/async-invoke
  • /model-invocations

Statistics logging limitations for native formats

  • Statistics logging is not available for image generation or editing APIs for Amazon Bedrock

Configure Amazon Bedrock

To use Amazon Bedrock with AI Gateway, configure a new AI Model Provider. You can then access supported AI Models from Amazon Bedrock.

Here’s a minimal configuration for chat completions:

Authentication with AWS

You can also use Amazon Bedrock with AWS credentials by setting auth to aws and specifying:

  • access_key_id (optional): AWS access key ID for static IAM user credentials. If omitted, the default AWS credentials provider chain is used (EC2 instance profiles, environment variables, etc.).
  • secret_access_key (optional): AWS secret access key paired with access_key_id. Required if access_key_id is set.
  • assume_role_arn (optional): IAM role ARN to assume for temporary credentials. Useful for cross-account access.
  • role_session_name (optional): Session name for the assumed role. Required if assume_role_arn is set.
  • sts_endpoint_url (optional): Custom STS endpoint for role assumption. Defaults to https://sts.amazonaws.com.
  • batch_role_arn (optional): Separate role ARN for Bedrock batch API calls.

FAQs

For cross-region inference with Amazon Bedrock, prefix the model ID with a geographic identifier in your AI Model configuration:

{geography-prefix}.{provider}.{model-name}...

For example: us.anthropic.claude-sonnet-4-5-20250929-v1:0

Prefix

Geography

us. United States
eu. European Union
apac. Asia-Pacific
global. All commercial regions

For a full list of supported cross-region inference profiles, see Supported Regions and models for inference profiles in the AWS documentation.

Use the extra_body feature when sending requests to an AI Model that proxies Amazon Bedrock video generation in OpenAI format:

    curl http://localhost:8000 \
    -H "Authorization: Bearer $OPENAI_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
        "model": "amazon.nova-reel-v1:0",
        "prompt": "A large red square that is rotating",
        "extra_body": {
        "fps": 24
        }
    }'

Add a guardrailConfig object to your request body when calling an AI Model that proxies Amazon Bedrock:

      {
          "messages": [
              {
                  "role": "system",
                  "content": "You are a scientist."
              },
              {
                  "role": "user",
                  "content": "What is the Boltzmann equation?"
              }
          ],
          "guardrailConfig": {
              "guardrailIdentifier": "$GUARDRAIL-IDENTIFIER",
              "guardrailVersion": "1",
              "trace": "enabled"
          }
      }

For more details, see Guardrails and content safety and the AWS Bedrock guardrails documentation.

Configure an AI Model with a Bedrock AI Model Provider and set up AWS authentication using IAM credentials or assumed roles.

Help us make these docs great!

Kong Developer docs are open source. If you find these useful and want to make them better, contribute today!