createAI: Azure OpenAI v1 URLs (the @ai-sdk/azure default) are not routed · Issue #2629 · cloudflare/agents · GitHub
Skip to content

createAI: Azure OpenAI v1 URLs (the @ai-sdk/azure default) are not routed #2629

Open

Description

@mattzcarey

@ai-sdk/azure builds v1 URLs by default (useDeploymentBasedUrls: false), e.g. https://<resource>.openai.azure.com/openai/v1/responses. createAI only maps the deployment form (/openai/deployments/<d>/...), so a default Azure model can't be routed:

const azure = createAzure({ resourceName: "acme" });
const ai = createAI({ binding: env.AI, id: "gw" });
await generateText({ model: ai(azure("gpt-5")), prompt });
// TypeError: AI Gateway has no provider for acme.openai.azure.com. ... the supported providers are ..., azure-openai, ...

azureEndpoint in packages/agents/src/models/core/gateway-providers.ts returns undefined for anything but the deployment path, and the error then claims the host itself is unsupported while listing azure-openai. cloudflare/ai#604 maps /openai/v1/responses to the gateway's <resource>/openai/responses endpoint and leaves other v1 paths unmatched. At minimum the error should say to use useDeploymentBasedUrls: true.

From cloudflare/ai#604.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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