Skip to content

OpenCode Zen/Go API chat completions returning 500 Internal Server Error #35276

Description

@fangshijie99

Description

https://github.com/anomalyco/opencode/issues/new

Description

The OpenCode Zen/Go chat completions API is broken. All POST requests to /zen/v1/chat/completions return HTTP 500 Internal Server Error, regardless of model or API key used.

Steps to Reproduce

  1. Send POST request to https://opencode.ai/zen/v1/chat/completions
  2. Include a valid OpenCode Go subscription API key (sk-...) in the Authorization header
  3. Set body to any model (tested: deepseek-v4-flash-free, minimax-m2.7, gpt-4o-mini)
  4. Response: HTTP 500 with body {"type":"error","error":{"type":"error","message":"Internal server error"}}

What Works

  • GET https://opencode.ai/zen/v1/models — returns 200 with full model list (50 models)
  • GET https://opencode.ai/zen/go/v1/models — returns 200 with Go model list (20 models)
  • https://opencode.ai homepage — loads fine

What Doesn't Work

  • POST https://opencode.ai/zen/v1/chat/completions — returns HTTP 500 (all models, both API keys)
  • POST https://opencode.ai/zen/go/v1/chat/completions — returns HTTP 000 / connection failure
  • POST https://opencode.ai/v1/chat/completions — returns HTTP 404

Notes

  • Two different OpenCode Go subscription keys were tested, both produce the same 500 error
  • Even the free model (deepseek-v4-flash-free) returns 500
  • The model listing endpoints work fine, suggesting only the inference backend is affected
  • API keys format: correct (sk- prefix), freshly generated

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

https://github.com/anomalyco/opencode/issues/new

Operating System

Windows11

Terminal

Windows cmd PowerShell

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions