Kilo Code External API Setup: A Complete Guide

Want more flexibility than Kilo Code's built-in AI models? Learn how to connect an external API, configure a compatible LLM, and integrate Kimi to improve code generation, debugging, refactoring, and everyday development workflows.

12 min read2026-08-12
How to Connect Kimi API to Kilo Code

Built-in AI models can be helpful, but they do not always give developers the control, flexibility, or model choice they need for coding tasks. When you want better support for code generation, debugging, refactoring, or tools like Kimi, using an external API with Kilo Code becomes a much better option. A proper setup can make your workflow smoother, faster, and easier to manage. Read this article to learn how to connect an external API key in Kilo Code and get more from your coding workflow.

What is Kilo Code and how does it work?

Kilo Code is an AI coding assistant that helps developers write, edit, and understand code more easily. It works as a VS Code extension, JetBrains extension, and CLI tool, making it simple to use in different development setups. It uses a chat-based interface to handle tasks like code generation, debugging, refactoring, and code explanations.

How to use built-in AI models in Kilo Code?

A good place to begin with Kilo Code is its built-in AI models, because they are easy to access and do not need any extra API setup. Once the extension is installed and linked to your account, you can choose a model and start using AI support for coding, debugging, refactoring, and everyday development tasks inside VS Code. Here's how you can use built-in AI models in Kilo Code:

Step 01: Install the Kilo Code extension in VS Code

Start by downloading and installing the Kilo Code extension from VS Code. Once the installation is complete, open the extension inside your editor so you can begin the setup process and connect it to your development environment without any extra tools.

Install the Kilo Code extension in VS Code

Step 02: Start the free setup and log in to your account

After opening the extension, click Free models to begin. You will then need to sign in with your Kilo account so the platform can verify your access and unlock the built-in AI features available in the extension.

Start the free setup and log in to your account

Step 03: Complete the VS Code authorisation process

Once you sign in, Kilo Code will ask you to authorise VS Code. Approving this step connects your editor with your Kilo account properly, making sure the extension can load features, sync settings, and give you access to the supported AI models.

Complete the VS Code authorisation process

Step 04: Choose a built-in AI model and begin using it

After the setup is finished, open the model selector inside Kilo Code and browse the available built-in models. Pick the one that fits your needs, and you can start using it for code generation, debugging, explanations, and other development tasks right away.

Choose a built-in AI model and begin using it
Choose a built-in AI model and begin using it
Choose a built-in AI model and begin using it

How to connect any LLM to Kilo Code?

Using built-in models in Kilo Code is simple, but connecting your own LLM gives you more freedom in model choice and coding workflow. To keep the setup easy to follow, the steps below use Kimi as an example and show how to connect it to Kilo Code through the Providers settings:

Step 1: Get a Kimi API key

Go to Kimi API Platform, open User Center / API Keys, and create a key. Kimi's API is OpenAI-compatible and uses this base URL:https://api.moonshot.ai/v1

Get a Kimi API key
Get a Kimi API key

Step 2: Open Kilo Code in VS Code

Open Kilo Code in VS Code, then click the gear icon in the panel. After that, go to the Providers tab, where you can add and manage external AI providers inside the extension.

Open Kilo Code in VS Code

Step 3: Add Moonshot.ai

In the Providers tab, choose Moonshot.ai / Kimi, paste your API key, and save the settings. Kilo’s documentation says the Moonshot provider is available directly in the Providers section, so the setup should be quick and straightforward

Add Moonshot.ai
Add Moonshot.ai

Step 4: Pick a Kimi model

After adding the provider, pick a Kimi model to use in Kilo Code. Some recommended options for coding are listed below:

Recommended for coding:

  • kimi-k2.7-code

  • kimi-k2.7-code-highspeed

  • kimi-k2.6

Kimi lists kimi-k2.7-code as its strongest coding model.

If Moonshot is not shown in Kilo

Use Custom provider instead:

  • Provider ID: moonshot

  • Display name: Kimi

  • Provider API: OpenAI Compatible

  • Base URL: https://api.moonshot.ai/v1

  • API key: your Kimi API key

  • Model: kimi-k2.7-code

Kilo supports OpenAI-compatible custom providers through this flow.

Use a custom provide

Benefits of using the Kimi API

Connecting Kimi to Kilo Code does more than simply add another model to your setup. It creates a smoother AI-powered coding workflow by bringing everyday development tasks into one place, so you don’t have to keep switching between different tools. Here’s how using the Kimi API can help:

  • Simplify everyday coding tasks

Kimi can help with code generation, explanations, and debugging directly inside your coding environment. This makes daily development work easier to manage and saves time on routine tasks. You can focus more on solving bigger coding problems instead of spending too much time on smaller ones.

  • Maintain high code standards

Kimi can suggest improvements and point out possible issues while you work on your code. This makes it easier to keep your code readable, consistent, and better organised across different files and projects. It can also help you catch mistakes early before they become larger development problems.

  • Adapt to different project needs

Whether you are building new features, refactoring old code, or writing project documentation, Kimi can support different stages of development. This makes it useful for more than one type of coding task and gives you more flexibility in the same workspace.

What can you do with Kilo Code?

After setup, Kilo Code can work as an AI coding assistant directly inside your editor. It helps with tasks like reviewing code, making file changes, solving errors, and speeding up repetitive development work without breaking your workflow. Here's how you can use the Kilo Code:

  • Chat with your codebase

Kilo Code can help you understand a project by answering questions about files, features, and code logic. You can ask what a file does, where a function is connected, or how a feature works. This makes it easier to explore a codebase without manually checking everything yourself.

  • Edit code for you

You can describe a bug fix, code change, refactor, or even a new feature, and Kilo Code can update the files for you. This saves time on repetitive editing and makes simple changes faster to handle. It is especially useful when you already know what needs to change but want help applying it.

  • Debug issues

When you run into an error or a failing test, you can share it with Kilo Code and ask it to trace the cause. It can help break down what the issue means and where the problem may be coming from. This makes debugging less frustrating and more structured.

  • Generate tests

Kilo Code can help create unit tests, integration tests, edge-case tests, mocks, and cleanup logic. This makes it easier to improve test coverage without writing every test from scratch. It can be useful when you want to save time while still keeping your project well tested.

  • Explain unfamiliar code

When you are joining a new project or reviewing someone else’s work, Kilo Code can explain code in simpler terms. It can help you understand the purpose of a function, a file, or a larger code flow. This makes learning unfamiliar code much quicker and less overwhelming.

  • Run coding workflows

Kilo Code can support coding workflows by reading files, suggesting changes, and applying patches where needed. Depending on permissions, it may also run certain commands as part of the workflow. This helps reduce manual steps when working through development tasks.

  • Work in modes/agents

You can use Kilo Code in different modes, such as planning, coding, debugging, or reviewing, depending on how you set it up. This makes it easier to use the tool for specific tasks instead of treating every request the same way. It adds more structure to your workflow.

  • Automate repetitive edits

Kilo Code can help with repeated changes like renaming patterns, updating APIs, cleaning up types, migrating code, or improving documentation. This is useful when a task needs to be repeated across many files or sections of a project. It can save a lot of time on work that would otherwise be slow and repetitive.

Conclusion

Using the right model setup can make your workflow more flexible and easier to manage. Instead of relying only on default options, Kilo Code can be shaped around the way you code and handle different development tasks. That extra control becomes useful when you want a smoother AI coding experience that fits your project needs. If you want to explore that flexibility in a practical way, try Kimi with Kilo Code. It is a simple way to improve how you code, debug, and work through daily tasks.

FAQ

Which AI model is ideal for coding in Kilo Code?
The best model depends on the kind of coding work you do and the provider you use in Kilo Code. For the Kimi setup, kimi-k2.7-code is the strongest choice because it is designed specifically for coding tasks. It can handle code generation, debugging, and refactoring more effectively than general-purpose models. If you want a faster option, kimi-k2.7-code-highspeed can also be a practical choice.
Can I use multiple API providers in Kilo Code?
Yes, Kilo Code supports multiple providers, so you are not limited to just one API connection. You can add different providers through the Providers section and switch between them based on the model or task you need. This is useful when you want one model for coding, another for quick responses, or more flexibility across projects. It also makes testing different LLMs much easier inside the same workspace.
Why isn't my AI model appearing in Kilo Code?
A model may not appear in Kilo Code if the provider was not added correctly or the API settings are incomplete. In many cases, checking the API key, base URL, provider type, and model name solves the problem. If the provider is not listed directly, you can usually add it through the Custom provider option using OpenAI-compatible settings. Restarting Kilo Code or refreshing the provider setup can also help the model appear properly.
You Might Also Like
Install Claude Code: Full Guide for Windows & Mac
Install Claude Code: Full Guide for Windows & Mac
2026-08-12
How to Connect External APIs to Roo Code
How to Connect External APIs to Roo Code
2026-08-12
Droid API Integration: How to Connect External AI Models
Droid API Integration: How to Connect External AI Models
2026-08-12
10 No-Code AI Agents to Automate Workflows in 2026
10 No-Code AI Agents to Automate Workflows in 2026
2026-08-12
AI Agent Frameworks Explained: Architecture, Tools, and APIs
AI Agent Frameworks Explained: Architecture, Tools, and APIs
2026-08-12