How to set up the Kilo Code Coding agent in VS Code with Ozeki AI Gateway

This guide demonstrates how to configure Kilo Code, an AI-powered coding assistant for Visual Studio Code, to work with Ozeki AI Gateway. You'll learn the complete installation process and configuration steps needed to integrate Kilo Code with your Ozeki AI Gateway setup.

What is Kilo code?

Kilo Code is an AI-powered coding assistant extension for Visual Studio Code that helps developers write code faster and more efficiently. It provides intelligent code completion, generation, and refactoring suggestions powered by large language models. When connected to Ozeki AI Gateway, you authenticate using API keys created in the gateway and access only the AI models that have been configured for your specific provider and routed to your user account. This setup provides significant advantages: you can switch models without reconfiguring Kilo Code (especially useful for teams with multiple developers), view the Kilo system prompt, and track token usage and costs to monitor which developer used how many credits on which model.

How to set up the Kilo Code with Ozeki AI Gateway (Quick Steps)

  1. Open Visual Studio
  2. Install Kilo Code
  3. Choose "Use your own API key" on welcome page
  4. Select OpenAI Compatible API provider
  5. Enter Ozeki AI Gateway URL and user API key
  6. Select LLM model
  7. Save configuration
  8. Test Kilo Code
  9. Task completed

Step 0 - Make sure Ozeki AI Gateway is installed on your computer

Before configuring Kilo Code, you need to have Ozeki AI Gateway installed and running on your system. If you haven't installed Ozeki AI Gateway yet, follow our How to Install Ozeki AI Gateway on Linux guide.

Create API key for Kilo Code (Video tutorial)

Before configuring Kilo Code, you need to create an API key in Ozeki AI Gateway. This video demonstrates how to navigate to the Users section, create a new API key for Kilo Code, and copy it for use in the configuration process. The API key serves as the authentication credential that allows Kilo Code to communicate with your Ozeki AI Gateway.

Create API key for Kilo Code
Figure 1 - Create API key for Kilo Code in Ozeki AI Gateway

Create route for Kilo Code (Video tutorial)

After creating the API key, you must establish a route in Ozeki AI Gateway that connects your user account to an AI provider. This video shows how to create a route that links your Kilo Code user to a provider like OpenRouter, enabling access to the AI models you've configured.

Create route for Kilo Code
Figure 2 - Create route for Kilo Code in Ozeki AI Gateway

How to set up the Kilo Code with Ozeki AI Gateway (Video tutorial)

In this video tutorial, you will learn how to set up Kilo Code with Ozeki AI Gateway step-by-step. The video covers installing the extension, configuring the API connection, and testing the integration with a sample coding task.

Step 1 - Search Kilo Code in VS Code extensions

Open Visual Studio Code and click on the Extensions icon in the left sidebar. In the search bar, type "Kilo Code" to find the AI coding assistant extension (Figure 3).

Search Kilo Code in extensions
Figure 3 - Search Kilo Code in VS Code extensions

Step 2 - Install Kilo Code

Locate the Kilo Code extension in the search results and click the "Install" button. Visual Studio Code will download and install the extension. Wait for the installation to complete before proceeding (Figure 4).

Install Kilo Code
Figure 4 - Install Kilo Code extension

Step 3 - Open Kilo Code

After installation, the Kilo Code icon will appear in the VS Code sidebar. Click on the Kilo Code icon to open the extension's interface. This will display the welcome screen where you can configure the AI provider connection (Figure 5).

Open Kilo Code
Figure 5 - Open Kilo Code interface

Step 4 - Choose Use your own API Key

On the Kilo Code welcome screen select "Use your own API Key" to configure a custom API endpoint. This option allows you to connect Kilo Code to Ozeki AI Gateway (Figure 6).

Choose Use your own API Key
Figure 6 - Choose "Use your own API Key" option

Step 5 - Select OpenAI compatible provider

From the provider list, select "OpenAI Compatible" as your API provider type. This option works with any API that follows the OpenAI API format, including Ozeki AI Gateway (Figure 7).

Select OpenAI compatible provider
Figure 7 - Select OpenAI compatible provider

Step 6 - Enter Ozeki AI Gateway base url and API key

Enter your Ozeki AI Gateway base URL in the API endpoint field. Then, enter your Ozeki AI Gateway API key in the API key. Kilo Code authenticates to the gateway using this key (Figure 8).

You need a working installation of Ozeki AI Gateway with at least one configured AI provider, one user with an API key, and at least one route that connects the user to a provider. If you haven't set this up yet, please check out the Ozeki AI Gateway Quick Start Guide.

Enter base URL and API key
Figure 8 - Enter Ozeki AI Gateway base URL and API key

Step 7 - Choose LLM model from list

Kilo Code will fetch the list of available models from your Ozeki AI Gateway based on your API key. The models shown are those that have been enabled in your provider configuration and routed to your user account. Select the LLM model you want to use for code assistance from the dropdown list (Figure 9).

Choose LLM model
Figure 9 - Choose LLM model from list

Step 8 - Click "Let's Go" to save config

After entering all the configuration details, scroll down and click the "Let's Go" button to save your settings (Figure 10).

Click Let's Go to save config
Figure 10 - Click "Let's Go" to save configuration

Step 9 - Test Kilo Code

To verify that Kilo Code is working properly with your Ozeki AI Gateway, test it with a simple coding task. The AI will generate code based on your request (Figure 11).

Test Kilo Code
Figure 11 - Test Kilo Code with a coding task

Step 10 - Task completed

Kilo Code will generate the requested code and display it in the interface. You can review the generated code, insert it into your project, or ask for modifications (Figure 12).

Task completed
Figure 12 - Task completed successfully

View Kilo Code transaction log (Video tutorial)

One of the key advantages of using Ozeki AI Gateway is the ability to monitor usage. This video demonstrates how to access the transaction log in Ozeki AI Gateway to view information about Kilo Code requests, including which developer made requests, which models were used, token consumption, and associated costs.

View Kilo Code transaction log
Figure 13 - View Kilo Code transaction log in Ozeki AI Gateway

Final thoughts

You have successfully configured Kilo Code to work with Ozeki AI Gateway, giving you an AI-powered coding assistant that routes through your own on-premises infrastructure. Use it to accelerate your development workflow with code generation, debugging assistance, and documentation creation. All interactions are authenticated through your gateway API key and limited to the providers and models configured for your account.

More information