---
title: "How to Connect AI Agents to VS Code using Roo Code | Hostman Docs"
description: "Learn how to integrate AI agents with VS Code using Roo Code. Set up OpenAI-compatible API connection, configure Base URL and API key, and enable code editing, file access, and terminal control from your editor."
---

> For the complete documentation index for AI agents, see [llms.txt](https://hostman.com/llms.txt).

AI agents can be integrated with any tools that support the OpenAI API, including VS Code extensions. For example, using Roo Code, an agent can interact with the editor: access project files, edit code, and execute commands in the terminal.

> [!NOTE]
> As of May 15, 2026, Roo Code is no longer supported. As an alternative, you can [use Cline](https://hostman.com/docs/ai-agents/coding-assistants/cline/), an extension with similar functionality and interface.

## Installing Roo Code

1.  Open VS Code.
2.  Go to the **Extensions** section.
3.  Search for **Roo Code** and install the extension.

![581b3a15 5886 4dfc 8950 Cb7ab95ac052.png](https://content.hostman.com/assets/f0425c9a-6073-48f1-bce0-4fe5ce9b0318.png?width=2726&height=1626)

_Roo Code page in the "Extensions" section of the [VS Code](https://code.visualstudio.com/) interface_

After installation, a Roo Code tab will appear in the sidebar with the chat interface.

## Configuring Connection to an AI Agent

To configure the connection, you will need:

-   [The agent’s Base URL](https://hostman.com/docs/ai-agents/api-usage/openai-compatible-api/#base-url)
-   [Your API key](https://hostman.com/docs/ai-agents/manage-agents/api-access-key/)

Follow these steps:

1.  Go to the **Roo Code** tab.
    
2.  Click the **gear icon** to open settings.
    
3.  Navigate to the **Providers** section.
    
4.  In the provider settings, enter:
    

-   **API Provider**: `OpenAI Compatible`
    
-   **Base URL**: `<agent’s base URL>`
    
-   **API Key**: `<your API key>`
    
-   **Model**: `<model name from agent settings>`
    

6.  Disable **Enable streaming** if it is turned on.
    
7.  Optionally, configure generation parameters:
    

-   **Context Window Size**: the amount of dialogue history sent in each request
    
-   **Max Completion Tokens**: maximum number of tokens in the response
    

9.  Click **Save**, then the back arrow to return to the chat.
    

You can now send messages to the agent directly from VS Code.

## Setting Agent Behavior (Optional)

You can modify the agent’s behavior, for example, to make it respond in Portuguese:

1.  Open Roo Code **Settings**.
2.  Go to the **Prompts** section.
3.  Add the phrase: `Responda em português`.

The agent will now reply in Portuguese when you send messages from the editor.
