Skip to content

Add opencode: provider for the OpenCode Console gateway - #80

Merged
linted merged 1 commit into
mainfrom
opencode-provider
Nov 18, 2026
Merged

linted merged 1 commit into
mainfrom
opencode-provider

Conversation

@linted

@linted linted commented Nov 18, 2026

Copy link
Copy Markdown
Owner

OpenCode's model gateway (OpenCode Console, formerly Zen) has no LangChain integration, but it serves each model family over that family's native protocol, so opencode:<model> builds the stock class against it, keyed by OPENCODE_API_KEY (OPENCODE_API_URL overrides the base):

  • claude-*: ChatAnthropic on the Anthropic Messages endpoint, keeping prompt caching and thinking blocks native.
  • gpt-, grok-, muse-*: ChatOpenAI with the Responses API, the endpoint OpenCode lists for those families.
  • everything else (DeepSeek, GLM, Kimi, Qwen, MiniMax, Gemini): _ChatDeepSeekFixed on Chat Completions, which is ChatOpenAI plus reasoning_content round-trip; thinking models 400 without it.

max_tokens threads through all three routes. Endpoint paths and the model ids in the docs were checked against the live gateway; no completion has been run yet (no key here).

OpenCode's model gateway (OpenCode Console, formerly Zen) has no LangChain
integration, but it serves each model family over that family's native
protocol, so `opencode:<model>` builds the stock class against it, keyed by
OPENCODE_API_KEY (OPENCODE_API_URL overrides the base):

- claude-*: ChatAnthropic on the Anthropic Messages endpoint, keeping
  prompt caching and thinking blocks native.
- gpt-*, grok-*, muse-*: ChatOpenAI with the Responses API, the endpoint
  OpenCode lists for those families.
- everything else (DeepSeek, GLM, Kimi, Qwen, MiniMax, Gemini):
  _ChatDeepSeekFixed on Chat Completions, which is ChatOpenAI plus
  reasoning_content round-trip; thinking models 400 without it.

max_tokens threads through all three routes. Endpoint paths and the
model ids in the docs were checked against the live gateway; no
completion has been run yet (no key here).
@linted
linted merged commit fbc3eb0 into main Nov 18, 2026
2 checks passed
@linted
linted deleted the opencode-provider branch November 18, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant