Skip to content

cloudflare-ai-gateway: non-OpenAI/Anthropic providers fail with 'Invalid provider' #44827

Description

@superhighfives

Description

On the cloudflare-ai-gateway provider, every model that isn't OpenAI or Anthropic fails with Bad Request: Invalid provider — Google, xAI, Alibaba, DeepSeek, Moonshot.

The loader routes anything that isn't openai/, anthropic/, or workers-ai/ through ai-gateway-provider's unified (compat) route, which posts to the gateway's universal compat endpoint. That endpoint only fronts a few upstreams, so the rest come back "Invalid provider". Cloudflare's catalog-aware REST API (/accounts/{id}/ai/v1/chat/completions) does serve them.

Plugins

None.

OpenCode version

1.18.22

Steps to reproduce

  1. Configure the cloudflare-ai-gateway provider (CLOUDFLARE_ACCOUNT_ID, CLOUDFLARE_API_TOKEN, CLOUDFLARE_GATEWAY_ID).
  2. Run: opencode run "hello" --model cloudflare-ai-gateway/xai/grok-4.5
  3. It fails with Bad Request: Invalid provider. Same for any google/*, alibaba/*, deepseek/*, moonshotai/* model. openai/* and anthropic/* work.

Operating System

macOS 26.5.2

Terminal

Zed

Metadata

Metadata

Assignees

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