Use RouterBrain as the model backend for AI coding in TRAE.

TRAE is ByteDance's AI-native IDE focused on intelligent collaboration and agent automation. TRAE supports OpenAI-compatible custom models—point the endpoint at RouterBrain to use console keys and the shared catalog.

Install TRAE

Step 1 — Download and install

Get TRAE from trae.cn (China) or trae.ai (international).

Step 2 — Initial setup

Complete the first-run wizard (language, theme, etc.).

Step 3 — Sign in

Log in with your TRAE account. Before wiring RouterBrain, create an inference API key in the console (API keys) and note a catalog id (List models).

Version requirement

Custom Base URL needs a recent TRAE build (roughly CN 3.3.51+ / intl 3.5.51+—check release notes). Upgrade if custom request URL is missing.

Use RouterBrain in TRAE

TRAE connects via API key + custom OpenAI endpoint.

Before you start

Unset shell vars that may interfere:

unset OPENAI_API_KEY
unset OPENAI_BASE_URL

Step 1 — Open add model

Either path:

  • Click the current model name (bottom-right of the AI panel) → Add model
  • Or Avatar → AI settings → ModelsAdd model

Step 2 — Choose OpenAI protocol

In the add-model dialog:

  • Provider / API formatOpenAI (compatible)
  • Custom configuration if offered

Step 3 — Base URL and model ID

FieldValue
Custom request URLhttps://51kik.com/v1
Model IDCatalog id (exact match from GET /models)

Full URL toggle (wording varies by version):

  • RouterBrain base is /v1 root—usually leave full-URL / /chat/completions suffix OFF.
  • If connection fails, try ON with https://51kik.com/v1/chat/completions.

See Base URL and environments.

Step 4 — API key

Paste your RouterBrain inference key (not an OpenAI vendor key).

Step 5 — Add model

Click Add model. TRAE validates the key:

  • Success → model appears in the list; select it in Chat / Agent.
  • Failure → read the error; validate with curl first (First request), then recheck key, id, and URL.

Multimodal

Enable vision / image options only if your catalog model supports them.

Verify

  1. Pick the new model and send a simple prompt.
  2. 401 → key; 403 → model access or balance (Errors).
  3. Still stuck? Help → Developer Tools → Network for request URL and response.

Quick reference

FieldValue
ProtocolOpenAI-compatible
Custom request URLhttps://51kik.com/v1
API KeyConsole inference key
Model IDCatalog id

Related