Skip to main content
OpenCode is an open-source programming agent. This guide shows how to connect OpenCode to the Kimi Open Platform through built-in authentication and use the kimi-k3 model with its 1M-token context window.
This guide is based on OpenCode 1.18.3. Its interface, configuration options, and supported capabilities may change between versions.

Prerequisites

Complete these prerequisites before you start. Follow the linked official guides for installation and account setup.

Install OpenCode

Install or update OpenCode with the official documentation.

Create an API key

Create a Kimi Open Platform API key and keep it private.

Check account settings

Confirm that the account has available balance, then check limits, budgets, and organization settings.
Kimi K3 requires available balance in your account; vouchers granted from new-user verification cannot be used for Kimi K3. Rate limits vary by user tier. See Rate Limits. If your organization uses an IP whitelist, follow Organization Best Practices and add the public egress IPv4 address of the computer that calls the API.

Step 1: Configure the API key

Run opencode auth login and select Moonshot AI in the provider list:
Then paste your Kimi Open Platform API key and press Enter:
Do not put the API key in configuration files, screenshots, or a Git repository. This guide uses a Global Kimi Open Platform key; do not substitute a key from another Kimi service or region.

Step 2: Select the Kimi K3 model

Run opencode to start OpenCode:
Run the /models command in the input field: Run the /models command Search for and select Kimi K3 in the Select model dialog: Select the Kimi K3 model

Step 3: Adjust the reasoning effort

Run the /variants command in the input field: Run the /variants command Select max in the Select variant dialog: Select the max variant kimi-k3 defaults to max reasoning effort and can also switch to low / high. See the Model Parameter Reference. When setup is complete, the status bar should show Kimi K3, Moonshot AI, and max: Final configuration

Learn more