Error using cloudflare AI gateway models #9412

Closed
opened 2026-02-16 18:12:23 -05:00 by yindo · 5 comments
Owner

Originally created by @zhabiba24 on GitHub (Feb 15, 2026).

Originally assigned to: @rekram1-node on GitHub.

Description

Get this error TypeError: sdk.languageModel is not a function. (In 'sdk.languageModel(model.api.id)', 'sdk.languageModel' is undefined) when trying to use workers-ai/@cf/openai/gpt-oss-120b after conencting with cloudflare AI gateway

Plugins

No response

OpenCode version

1.1.48

Steps to reproduce

  1. Hit /connect
  2. Follow steps to authenticate to cloudflare AI gateway
  3. Select GPT OSS 120B
  4. Type something and hit return to start flow

Screenshot and/or share link

No response

Operating System

Mac OS

Terminal

iterm2

Originally created by @zhabiba24 on GitHub (Feb 15, 2026). Originally assigned to: @rekram1-node on GitHub. ### Description Get this error `TypeError: sdk.languageModel is not a function. (In 'sdk.languageModel(model.api.id)', 'sdk.languageModel' is undefined)` when trying to use `workers-ai/@cf/openai/gpt-oss-120b` after conencting with cloudflare AI gateway ### Plugins _No response_ ### OpenCode version 1.1.48 ### Steps to reproduce 1. Hit /connect 2. Follow steps to authenticate to cloudflare AI gateway 3. Select GPT OSS 120B 4. Type something and hit return to start flow ### Screenshot and/or share link _No response_ ### Operating System Mac OS ### Terminal iterm2
yindo added the bug label 2026-02-16 18:12:23 -05:00
yindo closed this issue 2026-02-16 18:12:23 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 15, 2026):


This issue might be a duplicate of an existing issue. Please check:

  • #5235: Exact same error with Cloudflare Workers AI models - "sdk.languageModel is not a function" when selecting any Cloudflare model
@github-actions[bot] commented on GitHub (Feb 15, 2026): --- This issue might be a duplicate of an existing issue. Please check: - #5235: Exact same error with Cloudflare Workers AI models - "sdk.languageModel is not a function" when selecting any Cloudflare model
Author
Owner

@zhabiba24 commented on GitHub (Feb 15, 2026):

Not a duplicate, similar looking but different error and in a newer version since that was relased

@zhabiba24 commented on GitHub (Feb 15, 2026): Not a duplicate, similar looking but different error and in a newer version since that was relased
Author
Owner

@rekram1-node commented on GitHub (Feb 15, 2026):

You are on an old version of opencode, if you upgrade this is resolved

@rekram1-node commented on GitHub (Feb 15, 2026): You are on an old version of opencode, if you upgrade this is resolved
Author
Owner

@zhabiba24 commented on GitHub (Feb 15, 2026):

Thanks, went away. I think I actually had a seaparte issue - I was running opencode upgrade and while it said method brew, it didn't actually upgrade the binary (got same version after running it). So thought I was on latest.

Then when I ran brew upgrade opencode just now the version got bumped and it's all working

@zhabiba24 commented on GitHub (Feb 15, 2026): Thanks, went away. I think I actually had a seaparte issue - I was running `opencode upgrade` and while it said method brew, it didn't actually upgrade the binary (got same version after running it). So thought I was on latest. Then when I ran `brew upgrade opencode` just now the version got bumped and it's all working
Author
Owner

@rekram1-node commented on GitHub (Feb 15, 2026):

Yeah that's also an old bug, should also be fixed.

Also make sure u use our tap:
brew install anomalyco/tap/opencode

@rekram1-node commented on GitHub (Feb 15, 2026): Yeah that's also an old bug, should also be fixed. Also make sure u use our tap: brew install anomalyco/tap/opencode
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9412