Skip to content

Add support for Z.ai GLM Coding Plan (Anthropic-compatible provider) #2431

Closed

Description

@dnmtvf

Zhipu recently introduced the GLM Coding Plan – see z.ai/subscribe.

OpenCode already supports Z.ai, but this is a new feature of Z.ai that is exposed only through the Anthropic-compatible endpoint.

It would be great if OpenCode could add support for the Coding Plan specifically, since many developers would love to use it as a more affordable alternative to Claude code

Activity

  1. github-actions commented on Sep 5, 2025

    @github-actions
    Contributor

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

    Feel free to ignore if none of these address your specific case.

  2. MasterTuto commented on Sep 5, 2025

    @MasterTuto

    can you try setting baseURL to https://api.z.ai/api/anthropic/v1?

    Originally posted by @Reidond in #2383

  3. anuramat commented on Sep 9, 2025

    @anuramat

    fyi they support openai type api with CoT in response:

    https://docs.z.ai/scenario-example/develop-tools/opencode

    {
        "$schema": "https://opencode.ai/config.json",
        "provider": {
            "zhipuai": {
                "api": "https://api.z.ai/api/coding/paas/v4"
            }
        }
    }
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