npm install -g opencode-ai
opencode -v
~/.config/opencode/opencode.json。C:\\Users\\<用户名>\\.config\\opencode\\opencode.json。opencode.json 文件中,并保存。{"$schema": "https://opencode.ai/config.json","provider": {"myprovider": {"npm": "@ai-sdk/openai-compatible","name": "Token Plan","options": {"baseURL": "https://tokenhub-intl.tencentcloudmaas.com/plan/v3","apiKey": "$your_api_key"},"models": {"auto": {"name": "Auto","modalities": {"input": ["text"],"output": ["text"]},"options": {"thinking": {"type": "enabled"}}},"glm-5.2": {"name": "GLM-5.2","modalities": {"input": ["text"],"output": ["text"]},"options": {"thinking": {"type": "enabled"}}},"kimi-k2.6": {"name": "Kimi-K2.6","modalities": {"input": ["text"],"output": ["text"]},"options": {"thinking": {"type": "enabled"}}},"minimax-m3": {"name": "MiniMax-M3","modalities": {"input": ["text"],"output": ["text"]},"options": {"thinking": {"type": "enabled"}}},"deepseek-v4-flash-202605": {"name": "DeepSeek-V4-Flash 原厂直供","modalities": {"input": ["text"],"output": ["text"]},"options": {"thinking": {"type": "enabled"}}},"deepseek-v4-pro-202606": {"name": "DeepSeek-V4-Pro 原厂直供","modalities": {"input": ["text"],"output": ["text"]},"options": {"thinking": {"type": "enabled"}}}}}}}
opencode
/models,选择配置的模型并在 OpenCode 中使用。文档反馈