Describe the bug
Seems like there is no way to get a binding directly to the AI Gateway so I can use other models outside of Cloudflare with the ai-gateway-provider when using AI SDK v5.
workers-ai-provider works:
const workersAI = createWorkersAI({
binding: hubAI(),
gateway: {
id: process.env.CLOUDFLARE_AI_GATEWAY_ID!,
},
});
However ai-gateway-provider I see no way to get just the gateway binding:
const aiGateway = createAiGateway({
binding: hubAI().gateway(process.env.CLOUDFLARE_AI_GATEWAY_ID!), // TODO: How to get this binding?
options: {
skipCache: true, // Optional request-level settings
},
});
const anthropic = createAnthropic({ apiKey: process.env.ANTHROPIC_API_KEY! });
const model = aiGateway([
anthropic('claude-3-7-sonnet-latest'),
]);