Skip to content

Use Kimi K3 With OpenCode on Windows or WSL

Configure OpenCode to use Kimi K3 through Moonshot's OpenAI-compatible API, with the current model ID, environment key, and troubleshooting steps.

MGMCSA Guru Team July 26, 2026 2 min read
OpenCode configured to use Kimi K3

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.

Frequently asked questions

Which Kimi model should OpenCode use?

Use kimi-k3 for Moonshot's current flagship.

What is Moonshot's OpenAI-compatible base URL?

Use https://api.moonshot.ai/v1.

Does Kimi K3 support vision in OpenCode?

K3 supports native vision, but OpenCode and its provider adapter must preserve structured image input. Test it before relying on screenshots in an agent task.

Sources & further reading

Official vendor documentation referenced while writing this guide.

MG

MCSA Guru Team

IT & Systems Administration

We are working IT pros and system administrators who spend our days in Windows Server, Microsoft 365, and the wider Microsoft stack. MCSA Guru is where we write down the fixes and walkthroughs we wish we had found the first time.

MCSA Guru provides independent, educational IT guidance. Microsoft, Windows, Windows Server, Microsoft 365, Exchange, and Microsoft Teams are trademarks of Microsoft Corporation; Docker is a trademark of Docker, Inc. MCSA Guru is not affiliated with or endorsed by Microsoft or Docker. Always test changes in a safe environment before applying them in production.

Related guides

Fixing something right now?

Jump straight into the guide library or search for the exact error or task you are dealing with.