# Configure Trae with a third-party API

> Configure a third-party API in Trae (LMU AI relay) — no plugin; in Settings → Models → Add Model, choose Anthropic and enter the request URL and sk- key.

URL: https://docs.lmuai.ai/docs/tools/trae





The [Trae](https://www.trae.ai/) editor **natively supports connecting to a third-party API** (the Anthropic-compatible protocol), with no plugin to install and no config file to write — the simplest way to connect a third-party API of any editor. &#x2A;*It supports both official Claude models and Chinese large models (GLM, Qwen, DeepSeek, Kimi, etc.)**.

<Callout type="info" title="Native method vs the Codex plugin — which to choose?">
  * **Want Claude / Chinese models** → the native method on this page (Anthropic protocol, a few clicks in the GUI)
  * **Want the GPT-5 / Codex series** → see the [official Codex plugin](/docs/tools/vscode-plugin) (OpenAI protocol, hand-written config file)

  The two approaches can coexist — if you want to use both kinds of model, just set up both.
</Callout>

***

## Configuration steps [#configuration-steps]

1. Open Trae and go to **Settings → Models → Add Model**
2. Set **Provider** to **Anthropic**
3. Set **Model** to **Custom Model** (at the bottom of the dropdown), then enter the model name in the **Model ID** box below (see the common-models table below)
4. Set the **Custom request URL** to:
   ```
   https://api.lmuai.ai/v1/messages
   ```
5. Set the **API key** to the key you generated in the LMU AI console (starts with `sk-`)
6. Click **Confirm** to save, then switch to that model to start using it

***

## Example: configuring a Chinese model (GLM-5.1) [#example-configuring-a-chinese-model-glm-51]

The screenshot below uses **GLM-5.1** as an example of how to fill in a custom model. Note that you must pick **Custom Model** in the **Model** dropdown and then type the model ID manually; the request URL is always `https://api.lmuai.ai/v1/messages`:

<img alt="Configuring a Chinese model such as GLM-5 in Trae, with Provider set to Anthropic, Model set to Custom Model, and the custom request URL ending in /v1/messages" src="__img0" />

***

## Common models reference [#common-models-reference]

**Official Claude models**

| Model ID            | Description                             |
| ------------------- | --------------------------------------- |
| `claude-opus-5`     | Claude Opus 5 (flagship, recommended)   |
| `claude-sonnet-5`   | Claude Sonnet 5 (balanced)              |
| `claude-haiku-4-5`  | Claude Haiku 4.5 (high-speed)           |
| `claude-opus-4-8`   | Claude Opus 4.8 (previous generation)   |
| `claude-opus-4-7`   | Claude Opus 4.7 (previous generation)   |
| `claude-sonnet-4-6` | Claude Sonnet 4.6 (previous generation) |

**Chinese large models** (pick **Custom Model** and type the ID manually)

| Model ID              | Description                         |
| --------------------- | ----------------------------------- |
| `glm-5.2`             | Zhipu GLM-5.2                       |
| `qwen3.8-max-preview` | Qwen 3.8 Max Preview                |
| `deepseek-v4-pro`     | DeepSeek V4 Pro                     |
| `kimi-k3`             | Kimi K3                             |
| `glm-5.1`             | Zhipu GLM-5.1 (previous generation) |
| `qwen3.7-max`         | Qwen 3.7 Max                        |
| `kimi-k2.6`           | Kimi K2.6 (previous generation)     |

The models actually available are determined by the **Available Models** list in the LMU AI console; for the full list, see the [Model Gallery](/docs/guide/models).

***

## Common issues [#common-issues]

### Native method or the Codex plugin? [#native-method-or-the-codex-plugin]

* **Native method (this page)**: uses the Anthropic protocol and takes just a few clicks in the GUI — best for users who want models like **Claude / GLM / Qwen**
* **[Codex plugin method](/docs/tools/vscode-plugin)**: uses the OpenAI protocol and requires a hand-written config file — best for users who want the **GPT / Codex** series

The two approaches can coexist — if you want to use both kinds of model, just set up both.

### Why does the request URL need to end in `/v1/messages`? [#why-does-the-request-url-need-to-end-in-v1messages]

Trae's Custom request URL requires the **full endpoint** (unlike tools such as Chatbox, which append the path automatically). The Anthropic protocol's chat endpoint is always `/v1/messages`, so the full URL is `https://api.lmuai.ai/v1/messages`.

### Where do I find model IDs? [#where-do-i-find-model-ids]

See the full list of available models in the [Model Gallery](/docs/guide/models). Click any card to copy its model ID and paste it directly into Trae's Model ID box.

### No response or an error after adding? [#no-response-or-an-error-after-adding]

* Is the provider set to **Anthropic** (not OpenAI)?
* Did you pick Custom Model in the model dropdown and then type the model ID manually?
* Does the request URL end in `/v1/messages`?
* Is the API key the `sk-` key generated in the LMU AI console?

Save and restart the Trae client once.
