cloudflare / cloudflare/ai

ai-gateway-provider amazon-bedrock export is missing Bedrock URL routing

Open Beginner friendly
#587 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
1.2k
Forks
345
Avg merge
13h 31m
Merged PRs (30d)
1

Description

### Summary

`ai-gateway-provider` exports `providers/amazon-bedrock`, but wrapping an `@ai-sdk/amazon-bedrock` model with `createAiGateway()` fails before the request reaches AI Gateway:

```text
Sorry, but provider "amazon-bedrock" is currently not supported, please open a issue in the github repo!
```

The package currently detects providers by matching the underlying SDK request URL in `packages/ai-gateway-provider/src/providers.ts`. That provider table includes OpenAI, Anthropic, Azure OpenAI, etc., but not Bedrock Runtime URLs such as:

```text
https://bedrock-runtime.us-east-1.amazonaws.com/model/us.anthropic.claude-haiku-4-5-20251001-v1:0/invoke
```

### Expected behavior

Since the package exports `ai-gateway-provider/providers/amazon-bedrock`, `createAiGateway(createAmazonBedrock(...)(model))` should translate Bedrock Runtime URLs to AI Gateway Bedrock endpoints:

```text
bedrock-runtime/{region}/{rest}
```

with provider slug `aws-bedrock`.

### Notes

The Cloudflare AI Gateway Bedrock docs already document this endpoint structure, and `packages/workers-ai-provider/src/gateway-providers.ts` appears to contain equivalent Bedrock URL transform logic.

Contributor guide

Open the contributing guide

Research direction

Start in packages/ai-gateway-provider/src/providers.ts and compare its provider URL table with the Bedrock transform logic in packages/workers-ai-provider/src/gateway-providers.ts. Verify the amazon-bedrock export is recognized, Bedrock Runtime URLs become bedrock-runtime/{region}/{rest}, and the provider slug is aws-bedrock.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
api
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
85/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.