Skip to content

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

Description

@financialvice

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:

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:

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions