> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gpuhub.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Trae

> Configure Trae IDE to call AI Gateway models through the Roo Code extension.

<img src="https://mintcdn.com/gpuhub/GEB8Gf9uDczdNFr-/images/ide-agents-trae-icon.png?fit=max&auto=format&n=GEB8Gf9uDczdNFr-&q=85&s=7c5f27fea4a7dfa3084e5b0f2d6b2511" alt="" width="96" height="96" data-path="images/ide-agents-trae-icon.png" />

Native Trae does not directly support external model providers. You can use external model APIs by installing the Roo Code extension and configuring AI Gateway as an OpenAI-compatible provider.

## Install Roo Code

Open the Trae extension marketplace, search for `Roo Code`, and install the extension.

## Configure the Model API

When selecting an API provider, choose `OpenAI Compatible`.

If you want to use Claude-series models, still choose `OpenAI Compatible` and use the OpenAI-compatible endpoint provided by AI Gateway.

| Field        | Value                                                         |
| ------------ | ------------------------------------------------------------- |
| API Provider | `OpenAI Compatible`                                           |
| Base URL     | `https://llm.gpuhub.com/api/v1`                               |
| API Key      | Your AI Gateway API key                                       |
| Model        | The target model name, such as `GLM-5` or `claude-sonnet-4-6` |

<img src="https://mintcdn.com/gpuhub/okogEM35aUTWSg4p/images/ide-agents-trae-roo-code-config.png?fit=max&auto=format&n=okogEM35aUTWSg4p&q=85&s=c01a32486f5d6847c30cde91e17c4074" alt="" width="1065" height="884" data-path="images/ide-agents-trae-roo-code-config.png" />

## Context Length

If requests fail because of context length settings, adjust the context length in the extension configuration to match the selected model.
