Setup guide - From Kimi and OpenCode docs
Use Kimi in OpenCode
Both Moonshot and OpenCode document this. OpenCode has a built-in Moonshot AI provider: you add the key with opencode auth login (or /connect), pick Kimi K3 with /models, and set reasoning effort with /variants.
Last verified 4 steps4 official sources
Steps
- Step 1.
Run opencode auth login, select Moonshot AI in the provider list, then paste your Kimi Open Platform API key and press Enter.
Terminalopencode auth login - Step 2.
Start OpenCode.
Terminalopencode - Step 3.
Run /models, then search for and select Kimi K3.
Snippet/models - Step 4.
Run /variants and select max. The status bar should show Kimi K3, Moonshot AI and max.
Snippet/variants
Caveats
- Kimi's guide was written against OpenCode 1.18.3.
- OpenCode's own providers page still says "To use Kimi K2 from Moonshot AI" and uses the /connect command. Kimi K2 is discontinued; select Kimi K3 instead.
- Kimi K3 needs available account balance; vouchers from new-user verification cannot be used for it.
- The base URL and the MOONSHOT_API_KEY env var come from the moonshotai provider definition in OpenCode's models.dev registry (sst/models.dev). The setup steps themselves never ask you to enter a base URL.
More setup guides
Same tool, other providers
Related reading
- Kimi K3 Is GA in GitHub Copilot: Pricing, Rollout, and What It Means for Model ChoiceKimi K3 is GA in GitHub Copilot at $3/$15 per million tokens, off by default for Business and Enterprise. Rollout details and what it means for model choice.
- Cloudflare Runs Kimi and GLM at Scale: FP8 KV Caches, INT4 Weights, and a Cache Safety NetCloudflare runs Kimi K2.6 and GLM 5.2 on Workers AI with FP8 KV caches, INT4 weights and a KV cache integrity check. What each technique buys on GPU fleets.
- AMD MI355X vs NVIDIA B200 vs B300 for Open-Weight ServingAMD MI355X vs NVIDIA B200 vs B300 for serving Kimi K3's about 1.5TB of open weights: verified specs, the Wafer benchmark, and cost per token for each.
- Kimi Linear: An Attention Architecture That Outperforms Full AttentionKimi Linear explained: Moonshot's KDA hybrid linear attention beat full attention with 75% less KV cache and up to 6x faster decoding at 1M context.
- Kimi K3 Weights Land on HuggingFace: 2.8T Open Frontier Model You Can Actually DownloadKimi K3 open weights are on HuggingFace: 2.8T parameters, 1M context, native MXFP4 and a ~1.63TB download. The specs, license terms and HN reaction.
- Kimi K3 in 10 Minutes: Moonshot AI's 2.8T Open Model, API Setup, Pricing, and BenchmarksKimi K3 from Moonshot AI is a 2.8T open model with a 1M-token context and an OpenAI-compatible API. How to call it, what it costs, and how it benchmarks.
FAQ
How do I use Kimi in OpenCode?
Both Moonshot and OpenCode document this. OpenCode has a built-in Moonshot AI provider: you add the key with opencode auth login (or /connect), pick Kimi K3 with /models, and set reasoning effort with /variants.
Which Kimi model ids work in OpenCode?
The official docs read for this guide list kimi-k3, kimi-k2.7-code and kimi-k2.6. Requests go to https://api.moonshot.ai/v1.
Is this an official Kimi and OpenCode setup?
The steps draw on both Kimi's and OpenCode's docs. It was last checked against 4 official pages on October 17, 2026.
Sources
Last verified against 4 official pages.
- platform.kimi.aihttps://platform.kimi.ai/docs/guide/open-code.md
- opencode.aihttps://opencode.ai/docs/providers/
- raw.githubusercontent.comhttps://raw.githubusercontent.com/sst/models.dev/dev/providers/moonshotai/provider.toml
- raw.githubusercontent.comhttps://raw.githubusercontent.com/sst/models.dev/dev/providers/moonshotai/models/kimi-k3.toml
Newsletter
New models, set up the day they ship
One email per week. New model releases, the coding tools that support them and how to wire them up.