[PR #12014] fix(opencode): use official ai-gateway-provider package for Cloudflare AI Gateway #14025

Closed
opened 2026-02-16 18:18:50 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/12014

State: closed
Merged: Yes


Switches the Cloudflare AI Gateway custom loader from manual @ai-sdk/openai-compatible configuration to the official ai-gateway-provider package.

  • uses ai-gateway-provider@2.3.1 (v2.x required for AI SDK v5 compatibility)
  • uses createAiGateway + createUnified composition pattern per Cloudflare docs
  • requires CLOUDFLARE_API_TOKEN or CF_AIG_TOKEN - errors early if missing
  • model IDs use Unified API format: {provider}/{model} (e.g. anthropic/claude-sonnet-4-5)

Depends on: https://github.com/anomalyco/models.dev/pull/787 (models.dev PR must merge first)

See: https://developers.cloudflare.com/ai-gateway/integrations/vercel-ai-sdk/

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/12014 **State:** closed **Merged:** Yes --- Switches the Cloudflare AI Gateway custom loader from manual `@ai-sdk/openai-compatible` configuration to the official `ai-gateway-provider` package. - uses `ai-gateway-provider@2.3.1` (v2.x required for AI SDK v5 compatibility) - uses `createAiGateway` + `createUnified` composition pattern per Cloudflare docs - requires `CLOUDFLARE_API_TOKEN` or `CF_AIG_TOKEN` - errors early if missing - model IDs use Unified API format: `{provider}/{model}` (e.g. `anthropic/claude-sonnet-4-5`) **Depends on**: https://github.com/anomalyco/models.dev/pull/787 (models.dev PR must merge first) See: https://developers.cloudflare.com/ai-gateway/integrations/vercel-ai-sdk/
yindo added the pull-request label 2026-02-16 18:18:50 -05:00
yindo closed this issue 2026-02-16 18:18:50 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#14025