全部產品
Search
文件中心

Alibaba Cloud Model Studio:OpenCode

更新時間:May 01, 2026

在 OpenCode 中配置與使用阿里雲百鍊 Token Plan 團隊版。

安裝 OpenCode

  1. 安裝或更新 Node.js(v18.0 或更高版本)。

  2. 在終端中執行以下命令安裝 OpenCode。

    npm install -g opencode-ai

    在終端中執行以下命令,若輸出版本號碼,則表示安裝成功。

    opencode -v

配置 Token Plan 團隊版

請在以下路徑建立並開啟設定檔 opencode.json :

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

  • Windows: C:\Users\<使用者名稱>\.config\opencode\opencode.json

將以下配置寫入檔案,關鍵配置項:

  • Base URLhttps://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1,請勿使用其他套餐的地址。

  • API Key:將YOUR_API_KEY替換為 Token Plan 團隊版專屬 API Key

儲存設定檔後,請退出並重新啟動 OpenCode 使新配置生效。

{
    "$schema": "https://opencode.ai/config.json",
    "provider": {
        "bailian-token-plan": {
            "npm": "@ai-sdk/openai-compatible",
            "name": "Model Studio Token Plan 團隊版",
            "options": {
                "baseURL": "https://token-plan.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
                "apiKey": "YOUR_API_KEY"
            },
            "models": {
                "qwen3.6-plus": {
                    "name": "Qwen3.6 Plus",
                    "modalities": {
                        "input": ["text", "image"],
                        "output": ["text"]
                    },
                    "options": {
                        "thinking": {
                            "type": "enabled",
                            "budgetTokens": 8192
                        }
                    },
                    "limit": {
                        "context": 1000000,
                        "output": 65536
                    }
                },
                "MiniMax-M2.5": {
                    "name": "MiniMax M2.5",
                    "modalities": {
                        "input": ["text"],
                        "output": ["text"]
                    },
                    "limit": {
                        "context": 196608,
                        "output": 24576
                    }
                },
                "glm-5": {
                    "name": "GLM-5",
                    "modalities": {
                        "input": ["text"],
                        "output": ["text"]
                    },
                    "options": {
                        "thinking": {
                            "type": "enabled",
                            "budgetTokens": 8192
                        }
                    },
                    "limit": {
                        "context": 202752,
                        "output": 16384
                    }
                },
                "deepseek-v3.2": {
                    "name": "DeepSeek V3.2",
                    "modalities": {
                        "input": ["text"],
                        "output": ["text"]
                    },
                    "limit": {
                        "context": 131072,
                        "output": 16384
                    }
                }
            }
        }
    }
}
說明

budgetTokens用於控制模型思考過程的最大Token預算,若設定過低可能導致模型思考過程中斷。

使用 OpenCode

在終端中執行以下命令進入 OpenCode。

opencode

在命令列輸入/models,輸入Model Studio Token Plan 團隊版進行搜尋,選擇模型後即可使用。

說明

映像產生模型需通過 Agent 接入,參見接入多模態產生模型

常見問題

請參考常見問題