OpenCode can call Kimi K3 through Moonshot’s OpenAI-compatible API. K3 replaces the old K2 Turbo and Thinking split for a new flagship setup, with reasoning effort controls and native multimodal input in one model.
Install OpenCode and create a key
Follow the OpenCode Windows and WSL installation guide, then create a Moonshot API key.
Export the key in the terminal that will launch OpenCode:
export MOONSHOT_API_KEY="YOUR_MOONSHOT_API_KEY"
PowerShell uses this form for the current session:
$env:MOONSHOT_API_KEY = "YOUR_MOONSHOT_API_KEY"
Add the Moonshot provider
Merge this provider into opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"provider": {
"moonshot": {
"npm": "@ai-sdk/openai-compatible",
"name": "Moonshot AI",
"options": {
"baseURL": "https://api.moonshot.ai/v1",
"apiKey": "{env:MOONSHOT_API_KEY}"
},
"models": {
"kimi-k3": {
"name": "Kimi K3"
}
}
}
},
"model": "moonshot/kimi-k3"
}
Start and test OpenCode
Run OpenCode inside a project:
cd /path/to/project
opencode
Confirm that moonshot/kimi-k3 is selected. You can also open /models and choose it from the list. Begin with a small task whose result is easy to inspect.
Reasoning and images
Kimi K3 supports low, high, and max reasoning effort. The exact OpenCode setting depends on the provider adapter and OpenCode version. If the interface does not expose the control, use the provider’s default rather than inventing an unsupported JSON field.
K3 also accepts images, but the client must send a structured image block. If text prompts work and screenshots do not, update OpenCode and check whether the provider adapter declares image input for kimi-k3.
Troubleshooting
A provider-not-found error means the moonshot prefix in moonshot/kimi-k3 does not match the provider key. An authentication error means the key was not exported in the terminal that launched OpenCode.
A model error usually means an old K2 name remains in the configuration. Replace the configured model with the exact lowercase ID kimi-k3 and restart OpenCode.
Kimi K3 OpenCode check
- Install a current OpenCode release
- Create and export a Moonshot API key
- Use https://api.moonshot.ai/v1 as the base URL
- Set the model to moonshot/kimi-k3
- Test text and image input separately
The old speed-first K2 Turbo configuration is no longer the current default. Kimi K3 combines the flagship reasoning, long-context, and multimodal path under one model ID.
For Claude Code, see the direct Kimi K3 setup.