Use Kimi K3 in OpenCode
Follow the official provider flow to authenticate Moonshot, select Kimi K3 and verify max reasoning before you edit a repository.
Prerequisites
Confirm the CLI and account requirements first.
- OpenCode 1.18.3 or newer
- A Moonshot platform API key
- A repository opened from your terminal
- A clean or understood Git working tree before Agent edits
Configure OpenCode
Authenticate first, then select both the model and reasoning variant.
- 1
Start provider authentication
Run the login command from OpenCode's terminal workflow.
Terminalopencode auth login - 2
Choose Moonshot AI (China)
Select the provider named in Moonshot's official OpenCode guide and paste your API key when prompted.
- 3
Select Kimi K3
Open the model picker and choose Kimi K3 under the authenticated Moonshot provider.
OpenCode command/models - 4
Select the max variant
Open the variant picker and choose max, which matches Kimi K3's currently documented reasoning effort.
OpenCode command/variants
Verify before editing
Check the active session, not just the stored credential.
- The status bar shows Kimi K3
- The provider shows Moonshot AI (China)
- The selected variant shows max
- Git status is understood before allowing edits
Troubleshooting
Fix provider, model and variant mismatches at their source.
| Symptom | Likely cause | Direct fix |
|---|---|---|
| Kimi K3 is missing from /models | Moonshot is not authenticated or the CLI is outdated | Update OpenCode, repeat auth login and choose Moonshot AI (China) |
| The session is not using max | The model was selected without changing its variant | Run /variants and select max |
Official references
Provider behavior can change with CLI releases; verify against these live docs.
OpenCode FAQ
What to know before the first coding session.
Define a controlled coding Agent workflow
Specify repository boundaries, allowed tools and acceptance checks before granting an Agent write access.

