Cloudflare AI Gateway Not Working #3917

Closed
opened 2026-02-16 17:41:56 -05:00 by yindo · 1 comment
Owner

Originally created by @dylanellington on GitHub (Dec 27, 2025).

Originally assigned to: @rekram1-node on GitHub.

Description

Iv followed all the setup directions for Cloudflare AI Gateway but it does not seem to work.

On sending a message I always hit the following error:

TypeError: sdk.chat is not a function. (In 'sdk.chat(modelID)', 'sdk.chat' is undefined)

OpenCode version

1.0.203

Steps to reproduce

  1. Connect to Cloudflare AI Gateway.
  2. Send a message to any model.

Screenshot and/or share link

Image

Operating System

No response

Terminal

Ghostty

Originally created by @dylanellington on GitHub (Dec 27, 2025). Originally assigned to: @rekram1-node on GitHub. ### Description Iv followed all the setup directions for Cloudflare AI Gateway but it does not seem to work. On sending a message I always hit the following error: `TypeError: sdk.chat is not a function. (In 'sdk.chat(modelID)', 'sdk.chat' is undefined)` ### OpenCode version 1.0.203 ### Steps to reproduce 1. Connect to Cloudflare AI Gateway. 2. Send a message to any model. ### Screenshot and/or share link <img width="1608" height="1264" alt="Image" src="https://github.com/user-attachments/assets/b2cd6967-14a8-4dd7-9bb6-4b3364ce86d4" /> ### Operating System _No response_ ### Terminal Ghostty
yindo added the bug label 2026-02-16 17:41:56 -05:00
yindo closed this issue 2026-02-16 17:41:56 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Dec 27, 2025):

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

  • #4977: Issue with sdk.chat function: Undefined Error - Reports the same sdk.chat is not a function error when trying to use OpenCode

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Dec 27, 2025): This issue might be a duplicate of existing issues. Please check: - #4977: Issue with sdk.chat function: Undefined Error - Reports the same `sdk.chat is not a function` error when trying to use OpenCode Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3917