このガイドでは、OpenCode で Alibaba Cloud Model Studio Coding Plan を設定および使用する方法について説明します。
OpenCode のインストール
Node.js をバージョン 18.0 以降にインストールまたは更新します。
ターミナルで次のコマンドを実行して OpenCode をインストールします。
npm install -g opencode-aiインストールを確認するには、次のコマンドを実行します。インストールが成功すると、バージョン番号が返されます。
opencode -v
Coding Plan の設定
設定ファイル opencode.json を次のいずれかのパスに作成して開きます。
macOS / Linux:
~/.config/opencode/opencode.jsonWindows:
C:\Users\YourUsername\.config\opencode\opencode.json
ファイルに次の設定を追加します。
Base URL:https://coding-intl.dashscope.aliyuncs.com/apps/anthropic/v1。一般的な Model Studio エンドポイントは使用しないでください。説明OpenCode を設定する際、Base URL は
/v1で終わる必要があります。そうしないと、404 Not Foundエラーが返されます。API Key:YOUR_API_KEYを、Coding Plan 用の専用の シンガポール用の API キーに置き換えます。キー形式はsk-sp-xxxです。
設定ファイルを保存した後、OpenCode を再起動して変更を適用します。
{
"$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": 196608,
"output": 24576
}
},
"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
}
}
}
}
}
}budgetTokens パラメーターは、モデルの思考プロセスの最大トークン予算を制御します。この値を低く設定しすぎると、プロセスが中断される可能性があります。
MiniMax-M2.5 の場合、budgetTokensとoutputの合計は 32768 以下である必要があります。
使用方法
ターミナルで次のコマンドを実行して OpenCode を起動します。
opencodeコマンドラインで /models と入力し、Model Studio Coding Plan を検索し、その後、モデルを選択します。


よくある質問
よくある質問をご参照ください。