Skip to content

OpenCode Go fails with GLM-5.3 and GLM-5.3-flash when used through Claude Code. #51120

Closed as duplicate

Description

@JimZhang37

Description

OpenCode Go fails with GLM-5.3 and GLM-5.3-flash when used through Claude Code.

Claude Code configuration:

ANTHROPIC_BASE_URL=https://opencode.ai/zen/go

ANTHROPIC_DEFAULT_SONNET_MODEL=glm-5.3-flash
ANTHROPIC_DEFAULT_OPUS_MODEL=glm-5.3
ANTHROPIC_DEFAULT_HAIKU_MODEL=qwen3.8-flash

Results:

  • claude --model qwen3.8-flash → works
  • claude --model glm-5.3-flash → HTTP 503
  • glm-5.3 → HTTP 503

Error:

503 Upstream request failed: Endpoint is unavailable.

I also tested the API directly:

  • qwen3.8-flash through /v1/messages → HTTP 200
  • glm-5.3-flash through /v1/messages → HTTP 503
  • glm-5.3 through /v1/messages → HTTP 503
  • glm-5.3 through /v1/chat/completions → HTTP 200

Relevant OpenCode log IDs:

glm-5.3:
4704dddb-a114-4a56-a9a8-c8af2626b2a7

glm-5.3-flash:
d9f2ca18-8af0-4e7d-9616-ba76b32f4763

This appears to be specific to using the GLM models through the Claude Code / Anthropic-compatible route.

Plugins

No response

OpenCode version

claude code

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

macos 27

Terminal

iterm2

Activity

  1. added a commit that references this issue on Oct 4, 2026
    647c034
  2. poppy-mogmachine commented on Oct 15, 2026

    @poppy-mogmachine

    The {"model":"glm-5.3"} in your report is the clue: on Go, GLM is only reachable through /v1/chat/completions, and the /v1/messages route returns 503 for it (#50502 lists the same asymmetry for MiMo, kimi-k2.x and others). Claude Code only speaks /v1/messages, so it won't work until the server side is fixed.

    Until then, you can put a small local LiteLLM proxy in front. It accepts Anthropic Messages from Claude Code and sends Chat Completions upstream:

    # litellm.yaml
    model_list:
      - model_name: glm-5.3
        litellm_params:
          model: openai/glm-5.3
          api_base: https://opencode.ai/zen/go/v1
          api_key: os.environ/OPENCODE_GO_KEY
      - model_name: glm-5.3-flash
        litellm_params:
          model: openai/glm-5.3-flash
          api_base: https://opencode.ai/zen/go/v1
          api_key: os.environ/OPENCODE_GO_KEY
    litellm_settings:
      use_chat_completions_url_for_anthropic_messages: true   # the important line
    general_settings:
      master_key: os.environ/LITELLM_MASTER_KEY
    litellm --config litellm.yaml --port 4000
    export ANTHROPIC_BASE_URL=http://localhost:4000
    export ANTHROPIC_AUTH_TOKEN=$LITELLM_MASTER_KEY
    export ANTHROPIC_DEFAULT_OPUS_MODEL=glm-5.3
    export ANTHROPIC_DEFAULT_SONNET_MODEL=glm-5.3-flash

    If you leave out use_chat_completions_url_for_anthropic_messages, LiteLLM passes /v1/messages straight through and you get the same error back. I tested this on LiteLLM 1.105.1 against a different chat-completions-only GLM-5.3 upstream, not Go itself (I don't have a Go key). Both tool_use and streaming came back as proper Anthropic events.

  3. neriousy commented on Oct 20, 2026

    @neriousy
    Member

    Thanks for the report. We're tracking this same Go /v1/messages failure for GLM models in #50502, so I'm closing this as a duplicate. Please follow that issue for updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions