- Anthropic Messages: send requests to
/v1/messages. They reach Claude Haiku 4.5, Claude Sonnet 4.6, Claude Opus 4.5, and Claude Opus 4.6 through InvokeModel, streaming included. - Bedrock InvokeModel: send requests to
/model/<MODEL_ID>/invoke, or to/model/<MODEL_ID>/invoke-with-response-streamfor a stream. - Bedrock Converse: send requests to
/model/<MODEL_ID>/converse, or to/model/<MODEL_ID>/converse-streamfor a stream. - OpenAI Chat Completions and Responses: send requests to
/v1/chat/completionsor/v1/responses. They reach Gemma 4.
Even though Amazon Bedrock is a built-in provider, it still requires you to bring your own key because you can’t pay for it with credits at this time.
Setup
Create an access key
Follow the quickstart to create an access key in app.ngrok.ai.
Turn on model access
In commercial AWS regions, AWS turns on access to most models the first time your account calls them.
For a model sold through AWS Marketplace, that first call starts a Marketplace subscription, which can take up to 15 minutes.
The identity that makes the call needs
aws-marketplace:Subscribe, aws-marketplace:Unsubscribe, and aws-marketplace:ViewSubscriptions.
The GPT OSS models and the Amazon, MiniMax, Mistral, Moonshot AI, Qwen, and Z.ai models don’t need a subscription.Before you call a Claude model, complete the Anthropic First Time Use (FTU) form.
AWS requires it for Anthropic models earlier than Claude Opus 4.7, which covers every Claude model on this page.
Open the Anthropic model in Model catalog in the Amazon Bedrock console to find it.
You submit the form once per AWS account, or once in your AWS organization’s management account.
See Access Amazon Bedrock foundation models.Create a Bedrock API key
In the Amazon Bedrock console, open API keys and choose the Long-term API keys tab.
Click Generate long-term API keys, choose a time in API key expiration, and click Generate.
AWS shows the key only once, so copy it now.Use a long-term key.
A short-term key expires with your console session, after 12 hours at most, and works only in the region that made it.AWS attaches the
AmazonBedrockLimitedAccess managed policy to the IAM user behind the key.
That policy already has the permissions the gateway needs.
AWS recommends API keys for exploration and short-term credentials for production.
See Generate Amazon Bedrock API keys.Add the key to ngrok
Add a provider key for Amazon Bedrock.
A key you add in the dashboard uses the The API refuses a region where Bedrock doesn’t run.
See Regions for how the region picks where requests go.
us-east-1 region.
To use another region, add the key with the Provider Keys API and set aws.region:Create a configuration
Create an access key configuration with a
bedrock routing rule and allow Amazon Bedrock in the access scope.Scope down the key’s IAM policy
The defaultAmazonBedrockLimitedAccess policy covers every call the gateway makes.
If you replace it with a narrower policy, the key’s IAM user needs at least these permissions:
bedrock:CallWithBearerToken lets the key call Bedrock as a bearer token.
Converse requests use the same two invoke permissions as InvokeModel requests.
An inference profile can run a request in any region of its geography, so the policy covers every region.
The bedrock-mantle statement covers Gemma 4, which runs on the bedrock-mantle endpoint.
To accept only long-term keys, add a condition on bedrock:BearerTokenType with the value LONG_TERM.
A deny on bedrock:CallWithBearerToken alone doesn’t block API keys on bedrock-mantle.
To block them there too, also deny bedrock-mantle:CallWithBearerToken.
See Revoke Amazon Bedrock API keys.
See Actions defined by Amazon Bedrock.
Regions
Each Bedrock key sends requests to one AWS region. A key with no region usesus-east-1.
The key’s region picks the AWS endpoint and the model ID the gateway sends.
The endpoint is bedrock-runtime.<REGION>.amazonaws.com, or bedrock-mantle.<REGION>.api.aws for Gemma 4.
The gateway sends the model’s in-region ID when the model runs in that region, and the inference profile for the region’s geography otherwise.
The key’s region wins over the us. in a model ID.
For example, a key in eu-west-1 sends a request for us.anthropic.claude-haiku-4-5-20251001-v1:0 through the eu. inference profile.
A model ID with a different geography prefix, such as eu.anthropic.claude-haiku-4-5-20251001-v1:0, uses only keys in that geography.
Gemma 4 runs in-region only, with no inference profile.
Keys in us-east-1, us-east-2, us-west-2, and eu-central-1 serve it.
GLM-4.7, GLM-5, Ministral 3B, and Qwen3 Coder 30B A3B Instruct serve us-east-1 keys only.
The gateway doesn’t support global. model IDs.
When none of your keys is in a region that serves the model, the gateway returns a 400 error with ERR_NGROK_AI_GATEWAY_MODEL_REGION_UNSUPPORTED:
Native Bedrock requests
Point an AWS SDK athttps://gateway.ngrok.ai and send your ngrok access key as the bearer token.
The AWS SDKs read the bearer token from the AWS_BEARER_TOKEN_BEDROCK environment variable.
When AWS_BEARER_TOKEN_BEDROCK is set, boto3 sends the bearer token even if your shell also sets AWS_PROFILE.
The gateway returns errors in the Bedrock error format.
Name the model by its Bedrock model ID, such as us.anthropic.claude-haiku-4-5-20251001-v1:0.
Send an InvokeModel request to a Claude model:
Stream responses
Send stream requests to/model/<MODEL_ID>/converse-stream or /model/<MODEL_ID>/invoke-with-response-stream.
The gateway returns the stream as AWS event stream frames, which the AWS SDKs read.
Gemma 4
Amazon Bedrock serves Gemma 4 through its OpenAI-compatible API. Send Chat Completions or Responses requests withbedrock:google/gemma-4-31b-it or bedrock:google/gemma-4-26b-a4b-it:
bedrock: prefix keeps the request on Amazon Bedrock.
Bedrock keeps Responses output by default.
The gateway sends store: false, so Bedrock doesn’t keep it.
The gateway removes store and previous_response_id from a Responses request to Gemma 4 and lists them in the Ngrok-AIG-Removed-Params response header, so a request can’t continue an earlier response on Bedrock.
Try Amazon Bedrock before Anthropic
A bare Claude model ID, such asanthropic/claude-haiku-4-5, goes to Anthropic first.
The bedrock: prefix pins a request to Amazon Bedrock, with no fallback to another provider.
To try Amazon Bedrock first and fall back to Anthropic, create a virtual model that lists both:
claude-haiku-bedrock-first as the model in a Messages request.
In an access key configuration, a model rule names the catalog ID with the provider prefix, such as
bedrock:anthropic/claude-haiku-4-5.
A rule that names a Bedrock model ID, such as us.anthropic.claude-haiku-4-5-20251001-v1:0, doesn’t match requests yet.Available models
See the model catalog. The gateway sends Amazon Bedrock only the models in the catalog. Each model takes these request formats:- Claude Haiku 4.5, Claude Sonnet 4.6, Claude Opus 4.5, and Claude Opus 4.6: Messages and Bedrock InvokeModel.
- Gemma 4 31B and Gemma 4 26B A4B: Chat Completions and Responses.
- Every other model: Bedrock Converse. This page calls them the Converse models.