This repository was archived by the owner on Jul 29, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 728
This repository was archived by the owner on Jul 29, 2025. It is now read-only.
How to configure Kimi K2 with the Moonshoot API? #340
Copy link
Copy link
Open
Description
As the title suggests.
I updated the
config.json
as follows:
{
"data": {
"directory": ".opencode"
},
"providers": {
"openai": {
"apiKey": "your-openai-api-key",
"disabled": false
},
"anthropic": {
"apiKey": "your-anthropic-api-key",
"disabled": false
},
"copilot": {
"disabled": false
},
"groq": {
"apiKey": "your-groq-api-key",
"disabled": false
},
"openrouter": {
"apiKey": "your-openrouter-api-key",
"disabled": false
},
"moonshot": {
"npm": "@ai-sdk/openai-compatible",
"name": "Kimi K2 (Moonshot)",
"options": {
"baseURL": "https://api.moonshot.ai/v1",
"apiKey": "sk-your-moonshot-api-key"
},
"models": {
"kimi-k2-0711-preview": {
"name": "kimi-k2"
}
}
}
},
"agents": {
"coder": {
"model": "moonshot/kimi-k2-0711-preview",
"maxTokens": 5000
},
"task": {
"model": "moonshot/kimi-k2-0711-preview",
"maxTokens": 5000
},
"title": {
"model": "moonshot/kimi-k2-0711-preview",
"maxTokens": 80
}
},
"shell": {
"path": "/bin/bash",
"args": ["-l"]
},
"lsp": {
"go": {
"disabled": false,
"command": "gopls"
}
},
"debug": false,
"debugLSP": false,
"autoCompact": true
}
Upon running
opencode
for the first time, I was prompted to select a model.
Selected 'other' and added the provider name and API key.
Got stuck in this process ->opencode
command would prompt to select a provider always.
Selected OpenAI
Nowopencode
opens with OpenAI configured.
How to revert this to configure to Moonshot AI as a provider?
There seems to be a bug - upon selecting 'Other' as a provider, the opencode initial config seems to be stuck in a loop, i.e. you cannot configure 'Other' providers.
Edit:
How to revert this........
OpenAI auth was removed by removing theauth.json
viarm ~/.local/share/opencode/auth.json
yagudaev and samyarkdJoaoHenriqueBarbosa, beongju1 and lubomirmolin
Metadata
Metadata
Assignees
Labels
No labels