Kimi Code

Install and configure Kimi Code CLI and its local Web interface.

Follow the system-specific steps for Kimi Code CLI or Kimi Web.

Kimi Code CLI

Windows · macOS

Windows

1. Install

Open PowerShell from the Start menu and run the official installer:

irm https://code.kimi.com/kimi-code/install.ps1 | iex

After installation, close and reopen the terminal and run kimi --version. Continue when the version appears. See the official installation guide for other methods.

2. Configure

Prepare an API Key and copy a model ID from the model catalog that supports Chat Completions and is available to your Key. Replace YOUR_MODEL with that ID.

The configuration file is %USERPROFILE%\.kimi-code\config.toml.

  1. Press Win + E to open File Explorer.
  2. Enter %USERPROFILE%\.kimi-code in the address bar and press Enter.
  3. Right-click config.toml and choose Open with → Notepad.
  4. If the directory is missing, create the .kimi-code folders inside %USERPROFILE%. If the file is missing, create it in Notepad.
config.toml
default_model = "getrun-model"

[providers.getrun]
type = "openai"
base_url = "https://api.get-apikey.com/v1"
api_key = "your-api-key"

[models.getrun-model]
provider = "getrun"
model = "YOUR_MODEL"
max_context_size = 128000

Replace your-api-key with your Key and YOUR_MODEL with the model ID. getrun-model is the local model alias. max_context_size is the model’s context limit; replace the example value of 128000 with the selected model’s actual limit.

For an existing file, update matching fields and keep other settings. Put default_model before any [table] and keep one copy of each provider and model section.

Save in the directory above. In Notepad, use Save As → All files → UTF-8 and name the file config.toml without an extra .txt extension.

3. Use

Open your project folder in File Explorer, enter powershell in the address bar, and press Enter.

kimi -m getrun-model

Confirm the project prompts and send Reply only OK. Once you receive a reply, enter your task. Running kimi without -m uses the model selected by default_model.

Exit and restart Kimi Code after editing the configuration.

macOS

1. Install

Press Command + Space to find and open Terminal, then run the official installer:

curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash

After installation, close and reopen the terminal and run kimi --version. Continue when the version appears. See the official installation guide for other methods.

2. Configure

Prepare an API Key and copy a model ID from the model catalog that supports Chat Completions and is available to your Key. Replace YOUR_MODEL with that ID.

The configuration file is ~/.kimi-code/config.toml.

  1. Open Finder and press Command + Shift + G.
  2. Enter ~/.kimi-code and select Go.
  3. Open config.toml in TextEdit or VS Code.
  4. If the folder or file is missing, choose File → Open Folder in VS Code, press Command + Shift + G, and enter ~ to open your home directory. Create the .kimi-code folders in the Explorer sidebar, then create config.toml inside.
config.toml
default_model = "getrun-model"

[providers.getrun]
type = "openai"
base_url = "https://api.get-apikey.com/v1"
api_key = "your-api-key"

[models.getrun-model]
provider = "getrun"
model = "YOUR_MODEL"
max_context_size = 128000

Replace your-api-key with your Key and YOUR_MODEL with the model ID. getrun-model is the local model alias. max_context_size is the model’s context limit; replace the example value of 128000 with the selected model’s actual limit.

For an existing file, update matching fields and keep other settings. Put default_model before any [table] and keep one copy of each provider and model section.

Press Command + S to save. In TextEdit, choose Format → Make Plain Text and keep the filename config.toml.

3. Use

Open Terminal, type cd with a trailing space, drag your project folder from Finder into Terminal, and press Enter.

kimi -m getrun-model

Confirm the project prompts and send Reply only OK. Once you receive a reply, enter your task. Running kimi without -m uses the model selected by default_model.

Exit and restart Kimi Code after editing the configuration.

Kimi Web

Windows · macOS

Windows

1. Install

The Web interface is included in Kimi Code CLI. Install the CLI first:

Open PowerShell from the Start menu and run the official installer:

irm https://code.kimi.com/kimi-code/install.ps1 | iex

After installation, close and reopen the terminal and run kimi --version. Continue when the version appears. See the official installation guide for other methods.

2. Configure

Prepare an API Key and copy a model ID from the model catalog that supports Chat Completions and is available to your Key. Replace YOUR_MODEL with that ID.

The configuration file is %USERPROFILE%\.kimi-code\config.toml.

  1. Press Win + E to open File Explorer.
  2. Enter %USERPROFILE%\.kimi-code in the address bar and press Enter.
  3. Right-click config.toml and choose Open with → Notepad.
  4. If the directory is missing, create the .kimi-code folders inside %USERPROFILE%. If the file is missing, create it in Notepad.
config.toml
default_model = "getrun-model"

[providers.getrun]
type = "openai"
base_url = "https://api.get-apikey.com/v1"
api_key = "your-api-key"

[models.getrun-model]
provider = "getrun"
model = "YOUR_MODEL"
max_context_size = 128000

Replace your-api-key with your Key and YOUR_MODEL with the model ID. getrun-model is the local model alias. max_context_size is the model’s context limit; replace the example value of 128000 with the selected model’s actual limit.

For an existing file, update matching fields and keep other settings. Put default_model before any [table] and keep one copy of each provider and model section.

Save in the directory above. In Notepad, use Save As → All files → UTF-8 and name the file config.toml without an extra .txt extension.

3. Use

Open your project folder in File Explorer, enter powershell in the address bar, and press Enter.

kimi web

In the browser, select your project workspace, choose New Chat, select your configured model, and send Reply only OK. If the browser does not open automatically, use the local URL shown in the terminal. Keep the terminal running during use and press Ctrl + C to stop it.

An English Kimi Web session on Windows with an OK reply.

Exit and restart Kimi Code after editing the configuration.

macOS

1. Install

The Web interface is included in Kimi Code CLI. Install the CLI first:

Press Command + Space to find and open Terminal, then run the official installer:

curl -fsSL https://code.kimi.com/kimi-code/install.sh | bash

After installation, close and reopen the terminal and run kimi --version. Continue when the version appears. See the official installation guide for other methods.

2. Configure

Prepare an API Key and copy a model ID from the model catalog that supports Chat Completions and is available to your Key. Replace YOUR_MODEL with that ID.

The configuration file is ~/.kimi-code/config.toml.

  1. Open Finder and press Command + Shift + G.
  2. Enter ~/.kimi-code and select Go.
  3. Open config.toml in TextEdit or VS Code.
  4. If the folder or file is missing, choose File → Open Folder in VS Code, press Command + Shift + G, and enter ~ to open your home directory. Create the .kimi-code folders in the Explorer sidebar, then create config.toml inside.
config.toml
default_model = "getrun-model"

[providers.getrun]
type = "openai"
base_url = "https://api.get-apikey.com/v1"
api_key = "your-api-key"

[models.getrun-model]
provider = "getrun"
model = "YOUR_MODEL"
max_context_size = 128000

Replace your-api-key with your Key and YOUR_MODEL with the model ID. getrun-model is the local model alias. max_context_size is the model’s context limit; replace the example value of 128000 with the selected model’s actual limit.

For an existing file, update matching fields and keep other settings. Put default_model before any [table] and keep one copy of each provider and model section.

Press Command + S to save. In TextEdit, choose Format → Make Plain Text and keep the filename config.toml.

3. Use

Open Terminal, type cd with a trailing space, drag your project folder from Finder into Terminal, and press Enter.

kimi web

In the browser, select your project workspace, choose New Chat, select your configured model, and send Reply only OK. If the browser does not open automatically, use the local URL shown in the terminal. Keep the terminal running during use and press Ctrl + C to stop it.

Exit and restart Kimi Code after editing the configuration.

Configuration location

If KIMI_CODE_HOME is set, edit config.toml in that directory. Linux can use the macOS installation command and the same ~/.kimi-code/config.toml path. See the Kimi Code configuration guide for more fields.

On this page