Skip to content

qwen3.7-max returns 401 unsupported_value for response_format.type via oa-compat #29754

Closed as not planned

Description

@tanjinlimkelvin-dot

Bug Description

Using qwen3.7-max through OpenCode Go (oa-compat endpoint) returns a 401 error related to response_format.type.

error.code=unsupported_value_401
error.param=response_format.type
openai.RequestError: Response status code indicates failure

Other models (e.g. mimo-v2-pro, kimi-k2.6) work fine with the same config.

Related Issues

Steps to Reproduce

  1. Configure OpenCode Go provider with qwen3.7-max model
  2. Make any request (including a simple "hi")
  3. Observe 401 error on response

Expected Behavior

Model should respond normally like other models do.

Actual Behavior

Immediate 401 error:

error.code=unsupported_value_401
error.param=response_format.type

Environment

  • Model: qwen3.7-max
  • Provider: opencode-go (oa-compat)
  • Other models (mimo-v2-pro, kimi-k2.6) work fine

Suspected Cause

The oa-compat layer may be sending a response_format parameter that qwen3.7-max doesn't support (e.g. structured output / JSON mode). The model's API rejects it as unsupported.

Additional Context

Multiple users reporting this in the past few days. Seems to be a regression or incompatibility introduced with the qwen3.7-max model update.

Activity

  1. github-actions commented on May 28, 2026

    @github-actions
    Contributor

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

    Please follow the discussion in #29568 for updates and consider closing this issue if it covers the same problem.

  2. CJ5035 commented on May 29, 2026

    @CJ5035
    Image
  3. Cephei-OpenSource commented on May 29, 2026

    @Cephei-OpenSource

    May I ask what you are suggesting with this screenshot? The API endpoint for Opencode needs to be changed to use Qwen 3.7, maybe? So, you suggest, I need one endpoint and protocol for Qwen3.7 and others for the other models? Please clarify. This could maybe be solved with a litelllm server, if I understand your screenshot correctly. But then Opencode shouldn't report Qwen 3.7 on the default endpoint IMO. Kind regards

  4. CJ5035 commented on May 30, 2026

    @CJ5035

    @Cephei-OpenSource Yes, based on tests from others online, the configuration for Qwen 3.7 differs from that of other models. Other models use the OpenAI Chat Completions API, but Qwen 3.7 requires the Anthropic Messages protocol to function properly.

    try this:

    curl https://opencode.ai/zen/go/v1/messages \  
    -H "Content-Type: application/json" \  
    -H "x-api-key: $OPENCODE_GO_API_KEY" \  
    -H "anthropic-version: 2023-06-01" \  
    -d '{"model":"qwen3.7-max","messages":[{"role":"user","content":"hi"}],"max_tokens":20}'`

    https://mp.weixin.qq.com/s/PIMju3QjgBOzhtgXyTSZ_A

  5. Cephei-OpenSource commented on May 30, 2026

    @Cephei-OpenSource

    Thanks a lot. I can confirm with the anthropic protocol Qwen 3.7 Max is working with Open WebUI if embedded via a LiteLLM Server to force the different protocols. In case somebody needs it:

    1. Declare the API Key for Opencode in .env

    2. Don't forget to define a variable for it also in docker-compose.yml

    3. Entries for config.yaml (example models: MiMo V2.5 Pro and Qwen 3.7 Max):

     # Opencode
      # 1. Mimo -> OpenAI Format, base needs /v1, protocol is openai/
      - model_name: mimo-v2.5-pro
        litellm_params:
          model: openai/mimo-v2.5-pro
          api_base: https://opencode.ai/zen/go/v1
          api_key: os.environ/OPENCODE_API_KEY
          additional_drop_params: ["reasoningSummary"]
    
      # 2. Qwen -> Anthropic Format, base without /v1, protocol is anthropic/
      - model_name: qwen3.7-max
        litellm_params:
          model: anthropic/qwen3.7-max
          api_base: https://opencode.ai/zen/go
          api_key: os.environ/OPENCODE_API_KEY
    

    This example works for a Zen subscription using Go models.

    Again, thanks a lot for your help. Kind regards, Michael

  6. moinulmoin commented on May 31, 2026

    @moinulmoin

    still waiting for this, lol

  7. carter-smalls commented on May 31, 2026

    @carter-smalls

    Might be related to auth/config errors from OpenAI. npx ai-doctor might catch API key issues and auth config problems.

  8. github-actions commented on Jul 31, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

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