Using Kimi K2.5 Model in Programming Tools
kimi-k2.5 is a MoE architecture foundation model with exceptional code and Agent capabilities. We use Claude Code, VS Code & Cline/RooCode as examples to illustrate how to use the kimi-k2.5 series models.
Latest release on January 27, 2026: kimi-k2.5 model with 256K context window, native fusion of text and visual understanding, and Agent cluster collaboration mode, leading in complex scenarios such as agent tasks, code generation, and visual reasoning.
Latest release on November 6, 2025: kimi-k2-thinking and kimi-k2-thinking-turbo models with 256k context window, supporting multi-step tool calls and thinking, excelling at solving more complex problems.
Latest release on September 5, 2025: kimi-k2-0905-preview model with context window expanded to 256K and enhanced code capabilities. If you need faster response speed, you can use the kimi-k2-turbo-preview model, which always aligns with the latest version of kimi-k2 while maintaining consistent functionality, but with output speed increased to 60 tokens/s, up to 100 tokens/s.
Usage Notes
When using large models for code generation, due to the randomness and complexity of the model, multiple attempts may be required to generate code that meets expectations. Programming tools will automatically perform multiple rounds of retries and calls, which may lead to rapid token usage growth. To better control costs and improve the user experience, we recommend you pay attention to the following points:
-
Budget Control
- Set Daily Spending Limit: Before use, please go to Kimi Open Platform Project Settings (opens in a new tab) to configure the "Project Daily Spending Budget". Once the budget limit is reached, the system will automatically reject all API requests under this project (Note: Due to billing delays, the limit may take about 10 minutes to take effect). For setup instructions, please see Organization Management Best Practices
- Balance Alert Reminder: It is recommended to enable the account balance reminder function. When the account balance falls below the preset amount (default ÂĄ20), the system will notify you via SMS to recharge in a timely manner.
-
Usage Recommendations
- Continuous Monitoring: It is recommended to keep monitoring while the programming software is running, and handle abnormal situations promptly to avoid unnecessary resource consumption due to infinite loops or excessive retries.
- Model Selection: If response speed is not a high priority, you can choose to use the
kimi-k2-0905-previeworkimi-k2-0711-previewmodels, which consume tokens relatively slowly and are more suitable for long-running scenarios.
K2 Vendor Verifier
Kimi models have always focused on agentic loops, and the reliability of tool calls is crucial. To this end, we launched K2 Vendor Verifier (K2VV) (opens in a new tab) to evaluate the quality of Kimi API tool calls from different vendors, helping you intuitively compare the accuracy differences among various vendors.
Latest Update: K2VV has been expanded to 12 vendors, and more test data has been open-sourced. Welcome to provide feedback on the test metrics you care about here (opens in a new tab).
Obtaining API Key
- Visit the Open Platform at https://platform.moonshot.ai/console/api-keys (opens in a new tab) to create and obtain an API Key, selecting the default project.

Using kimi k2.5 thinking model in Claude Code
Install Claude Code
If you have already installed Claude Code, you can skip this step
MacOS and Linux
# Install nodejs on MacOS and Linux
curl -fsSL https://fnm.vercel.app/install | bash
# Open a new terminal to make fnm take effect
fnm install 24.3.0
fnm default 24.3.0
fnm use 24.3.0
# Install claude-code
npm install -g @anthropic-ai/claude-code --registry=https://registry.npmmirror.com
# Initialize configuration
node --eval "
const homeDir = os.homedir();
const filePath = path.join(homeDir, '.claude.json');
if (fs.existsSync(filePath)) {
const content = JSON.parse(fs.readFileSync(filePath, 'utf-8'));
fs.writeFileSync(filePath,JSON.stringify({ ...content, hasCompletedOnboarding: true }, 2), 'utf-8');
} else {
fs.writeFileSync(filePath,JSON.stringify({ hasCompletedOnboarding: true }), null, 'utf-8');
}"Windows
# Open the PowerShell terminal in Windows Terminal
# Install nodejs on Windows
# Right-click the Windows button and select "Terminal"
# Then execute the following commands in sequence
winget install OpenJS.NodeJS
Set-ExecutionPolicy -Scope CurrentUser RemoteSigned
# Then close the terminal window and open a new one
# Install claude-code
npm install -g @anthropic-ai/claude-code --registry=https://registry.npmmirror.com
# Initialize configuration
node --eval "
const homeDir = os.homedir();
const filePath = path.join(homeDir, '.claude.json');
if (fs.existsSync(filePath)) {
const content = JSON.parse(fs.readFileSync(filePath, 'utf-8'));
fs.writeFileSync(filePath,JSON.stringify({ ...content, hasCompletedOnboarding: true }, 2), 'utf-8');
} else {
fs.writeFileSync(filePath,JSON.stringify({ hasCompletedOnboarding: true }), null, 'utf-8');
}"Configure Environment Variables
After completing the installation of Claude Code, please set the environment variables as follows to use the kimi-k2.5 model and start Claude.
Note: If you still need to use the slow version of the kimi-k2 model, you can replace the model below with kimi-k2-thinking.
MacOS and Linux
# Start the high-speed kimi-k2.5 model on Linux/macOS
export ANTHROPIC_BASE_URL=https://api.moonshot.ai/anthropic
export ANTHROPIC_AUTH_TOKEN=${YOUR_MOONSHOT_API_KEY}
export ANTHROPIC_MODEL=kimi-k2.5
export ANTHROPIC_DEFAULT_OPUS_MODEL=kimi-k2.5
export ANTHROPIC_DEFAULT_SONNET_MODEL=kimi-k2.5
export ANTHROPIC_DEFAULT_HAIKU_MODEL=kimi-k2.5
export CLAUDE_CODE_SUBAGENT_MODEL=kimi-k2.5
export ENABLE_TOOL_SEARCH=false
claudeWindows
# Start the high-speed kimi-k2.5 model on Windows PowerShell
$env:ANTHROPIC_BASE_URL="https://api.moonshot.ai/anthropic";
$env:ANTHROPIC_AUTH_TOKEN="YOUR_MOONSHOT_API_KEY"
$env:ANTHROPIC_MODEL="kimi-k2.5"
$env:ANTHROPIC_DEFAULT_OPUS_MODEL="kimi-k2.5"
$env:ANTHROPIC_DEFAULT_SONNET_MODEL="kimi-k2.5"
$env:ANTHROPIC_DEFAULT_HAIKU_MODEL="kimi-k2.5"
$env:CLAUDE_CODE_SUBAGENT_MODEL="kimi-k2.5"
$env:ENABLE_TOOL_SEARCH=false
claudeVerify Environment Variables
Enter /status in Claude Code to check the model status:

- How to experience the thinking capabilities of
kimi-k2.5in Claude Code- After configuring the turbo model, click the
Tabbutton to switch after entering the Claude Code page. A "Thinking on" indicator will appear when the switch is successful.
- After configuring the turbo model, click the

You can now use Claude Code for development as usual!
Using kimi k2.5 model in Cline
Install Cline
- Open VS Code
- Click the Extensions icon in the left activity bar (or use the shortcut
Ctrl+Shift+X/Cmd+Shift+X) - Enter
clinein the search box - Find the
Clineextension (usually published by Cline Team) - Click the
Installbutton to install it - After installation, you may need to restart VS Code

Verify Installation
After installation, you can:
- See the Cline icon in the left activity bar of VS Code
- Or search for "Cline" related commands through the command palette (
Ctrl+Shift+P/Cmd+Shift+P) to verify the installation was successful
Official Recommendation: Configure Moonshot Provider to use kimi-k2.5 model
- Select 'Moonshot' as the API Provider
- Select 'api.moonshot.ai' as the Moonshot Entrypoint
- Configure the Moonshot API Key with the Key obtained from the Kimi Open Platform
- Select 'kimi-k2.5' as the Model
- Check 'Disable browser tool usage' under Browser
- Click 'Done' to save the configuration

Experience the effects of kimi-k2.5 model in cline
- We asked the kimi-k2.5 model to write a Snake game
- Game effects
Using kimi k2.5 model in RooCode
Install RooCode
- Open VS Code
- Click the Extensions icon in the left activity bar (or use the shortcut
Ctrl+Shift+X/Cmd+Shift+X) - Enter
roo codein the search box - Find the
Roo Codeextension (usually published by RooCode Team) - Click the "Install" button to install it
- After installation, you may need to restart VS Code

Verify Installation
After installation, you can:
- See the RooCode icon in the left activity bar of VS Code
- Or search for "RooCode" related commands through the command palette (
Ctrl+Shift+P/Cmd+Shift+P) to verify the installation was successful
Official Recommendation: Configure Moonshot Provider to use kimi-k2.5 model
- Select 'Moonshot' as the API Provider
- Select 'api.moonshot.ai' as the Moonshot Entrypoint
- Configure the Moonshot API Key with the Key obtained from the Kimi Open Platform
- Select 'kimi-k2.5' as the Model
- Check 'Disable browser tool usage' under Browser

Using kimi k2.5 Model in OpenCode
Install OpenCode
The easiest way to install OpenCode is through the install script.
curl -fsSL https://opencode.ai/install | bashYou can also install it with npm:
npm install -g opencode-aiConfigure API key
-
Run
opencode auth loginand select Moonshot AI.$ opencode auth login ┌ Add credential │ ◆ Select provider │ ● Moonshot AI │ ... └ -
Enter your Moonshot AI API key.
$ opencode auth login ┌ Add credential │ ◇ Select provider │ Moonshot AI │ ◇ Enter your API key │ _ └ -
Run
opencodeto launch OpenCode.$ opencodeUse the
/modelscommand to select a model like Kimi K2.5 or Kimi K2 Turbo . Kimi K2.5 is the official kimi-k2-0905-preview model, and Kimi K2 Turbo is the official kimi-k2-turbo-preview model./models
Let's get started. For more information, please visit opencode.ai/docs (opens in a new tab)

Direct API Calls to kimi-k2.5 model
from openai import OpenAI
client = OpenAI(
api_key = "$MOONSHOT_API_KEY",
base_url = "https://api.moonshot.ai/v1",
)
completion = client.chat.completions.create(
model = "kimi-k2.5",
messages = [
{"role": "system", "content": "You are Kimi, an artificial intelligence assistant provided by Moonshot AI. You are more proficient in Chinese and English conversations. You will provide users with safe, helpful, and accurate answers. At the same time, you will refuse to answer any questions involving terrorism, racial discrimination, pornography, or violence. Moonshot AI is a proper noun and cannot be translated into other languages."},
{"role": "user", "content": "Hello, my name is Li Lei, what is 1+1?"}
]
)
print(completion.choices[0].message.content)Where $MOONSHOT_API_KEY needs to be replaced with the API Key you created on the platform.
To use the kimi-k2-turbo-preview model, simply replace the model name with kimi-k2-turbo-preview.
When running the code in the documentation using the OpenAI SDK, ensure that the Python version is at least 3.7.1, the Node.js version is at least 18, and the OpenAI SDK version is not lower than 1.0.0.