Skip to content

Z.ai subscription API fails to work in opencode but works in other agents #8515

Closed

Description

@vladnicula

Description

Image

I have a Z.Ai subscription and am using the same API KEY in opencode and other agents.

About an hour ago the Z.Ai integration stopped working in opencode.

The same API Key and Z.Ai model was used successfully in other AI Agents clis or IDE integrations while the opencode agent continued to fail with this error.

Plugins

No response

OpenCode version

1.1.20

Steps to reproduce

  1. Setup an API KEY from Z.Ai subscription using GLM 4.7
  2. Attempt to use it.
  3. Inspect results.
    Expected: AI requests work
    Current: AI requests fail with the attached screenshot.

IMPORTANT: The same account/api key and model work fine in other AI Agents or IDE integrations, while the opencode one fails.

Screenshot and/or share link

Image

Operating System

mac os 14.4.1 (23E224)

Terminal

cursor zsh

Activity

  1. github-actions commented on Jan 14, 2026

    @github-actions
    Contributor

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

    • Z.ai coding model connection issue #4349: Z.ai coding model connection issue - Same Z.ai API authentication problem where the API key works with curl but fails with timeout in opencode (glm-4.6/glm-4.7 models)

    Feel free to ignore if this doesn't address your specific case.

  2. rekram1-node commented on Jan 14, 2026

    @rekram1-node
    Contributor

    I think it's because you are using incorrect provider. You should be using the zai-coding-plan not the zai provider

  3. rekram1-node commented on Jan 14, 2026

    @rekram1-node
    Contributor
    Image

    This is the one u wantt^^^^

  4. vladnicula commented on Jan 15, 2026

    @vladnicula
    Author
    Image This is the one u wantt^^^^

    that is it! amazing catch! Thanks @rekram1-node!

    Looks like the same API key worked for hours under the normal z.api urls. I was not charged it seems anything. Cool.

  5. AshMcConnell commented on Jan 16, 2026

    @AshMcConnell

    Thanks, exactly my problem too 👍

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions