All Products
Search
Document Center

Alibaba Cloud Model Studio:OpenCode

Last Updated:Mar 06, 2026

OpenCode is an open source AI coding tool. Set up and use Coding Plan with OpenCode.

Install OpenCode

  1. Install or update Node.js (v18.0 or later).

  2. In your terminal, install OpenCode:

    npm install -g opencode-ai

    Verify the installation. If a version number appears, the installation succeeded:

    opencode -v

Set up Coding Plan

Create and open the config file opencode.json at one of the following paths:

  • macOS or Linux: ~/.config/opencode/opencode.json

  • Windows: C:\Users\<username>\.config\opencode\opencode.json

Write the following configuration to a file. Key configuration items:

  • baseURL: Set to https://coding-intl.dashscope.aliyuncs.com/apps/anthropic/v1. Do not use the general Model Studio endpoint.

  • apiKey: Replace YOUR_API_KEY with your Coding Plan API key, in the format of sk-sp-xxx.

Note

Save the config file. Restart OpenCode to apply the settings.

{
    "$schema": "https://opencode.ai/config.json",
    "provider": {
        "bailian-coding-plan": {
            "npm": "@ai-sdk/anthropic",
            "name": "Model Studio Coding Plan",
            "options": {
                "baseURL": "https://coding-intl.dashscope.aliyuncs.com/apps/anthropic/v1",
                "apiKey": "YOUR_API_KEY"
            },
            "models": {
                "qwen3.5-plus": {
                    "name": "Qwen3.5 Plus",
                    "modalities": {
                        "input": ["text", "image"],
                        "output": ["text"]
                    },
                    "options": {
                        "thinking": {
                            "type": "enabled",
                            "budgetTokens": 8192
                        }
                    },
                    "limit": {
                        "context": 1000000,
                        "output": 65536
                    }
                },
                "qwen3-max-2026-01-23": {
                    "name": "Qwen3 Max 2026-01-23",
                    "modalities": {
                        "input": ["text"],
                        "output": ["text"]
                    },
                    "limit": {
                        "context": 262144,
                        "output": 32768
                    }
                },
                "qwen3-coder-next": {
                    "name": "Qwen3 Coder Next",
                    "modalities": {
                        "input": ["text"],
                        "output": ["text"]
                    },
                    "limit": {
                        "context": 262144,
                        "output": 65536
                    }
                },
                "qwen3-coder-plus": {
                    "name": "Qwen3 Coder Plus",
                    "modalities": {
                        "input": ["text"],
                        "output": ["text"]
                    },
                    "limit": {
                        "context": 1000000,
                        "output": 65536
                    }
                },
                "MiniMax-M2.5": {
                    "name": "MiniMax M2.5",
                    "modalities": {
                        "input": ["text"],
                        "output": ["text"]
                    },
                    "options": {
                        "thinking": {
                            "type": "enabled",
                            "budgetTokens": 8192
                        }
                    },
                    "limit": {
                        "context": 204800,
                        "output": 131072
                    }
                },
                "glm-5": {
                    "name": "GLM-5",
                    "modalities": {
                        "input": ["text"],
                        "output": ["text"]
                    },
                    "options": {
                        "thinking": {
                            "type": "enabled",
                            "budgetTokens": 8192
                        }
                    },
                    "limit": {
                        "context": 202752,
                        "output": 16384
                    }
                },
                "glm-4.7": {
                    "name": "GLM-4.7",
                    "modalities": {
                        "input": ["text"],
                        "output": ["text"]
                    },
                    "options": {
                        "thinking": {
                            "type": "enabled",
                            "budgetTokens": 8192
                        }
                    },
                    "limit": {
                        "context": 202752,
                        "output": 16384
                    }
                },
                "kimi-k2.5": {
                    "name": "Kimi K2.5",
                    "modalities": {
                        "input": ["text", "image"],
                        "output": ["text"]
                    },
                    "options": {
                        "thinking": {
                            "type": "enabled",
                            "budgetTokens": 8192
                        }
                    },
                    "limit": {
                        "context": 262144,
                        "output": 32768
                    }
                }
            }
        }
    }
}
Note

The budgetTokens setting controls the maximum token budget for the model’s thinking process. Setting it too low may interrupt the model’s reasoning.

Usage

You can execute the following command in the terminal to enter OpenCode.

opencode

Type /models, search for Model Studio Coding Plan, and select a model to start using it.

image

image

FAQ

See FAQ.