Skip to content
Sign Up Free
Coding and development

TRAE setup: API key, Base URL, and models

Install TRAE, configure the BetterToken Base URL and API key, choose an available model, and troubleshoot common errors. Includes setup guidance.

To connect TRAE to BetterToken, prepare an API key, use the full request URL shown below, and choose a current Model ID from the model plaza. This guide uses full-URL mode. If your client offers a Full URL switch, turn it on for this address. Field names and URL modes can vary by region and version; check the controls shown in your client.

Key settings

FieldValue
API KeyBetterToken API key
Full request URLhttps://bettertoken.ai/v1/chat/completions
ModelA current Model ID from the model plaza

Prerequisites

Sign up and get a BetterToken API Key

Already have an account? Sign in, top up, then create a key in the console.

Additional requirements

Install

Install or open TRAE, then continue with the manual setup below.

Manual setup

FieldValue
API KeyBetterToken API key
Full request URLhttps://bettertoken.ai/v1/chat/completions
ModelA current Model ID from the model plaza

Setup

Open settings

In IDE mode, click the Settings icon in the upper-right corner to open the settings center.

You can also open SOLO mode and click the Settings icon in the upper-right corner of the chat panel.

Open the model panel

In the left navigation, choose Model to open the Model panel.

Add a model

Click + Add model.

The TRAE model panel with the settings entry, model navigation item, and add model button highlighted.

Fill in the model configuration

When the Add model window appears, fill in the fields as follows:

FieldValue
ProviderOpenAI
ModelCustom model
Model IDa model ID copied from the model plaza
API keyyour API Key copied from the BetterToken console
Custom request URLhttps://bettertoken.ai/v1/chat/completions
The TRAE add model window with OpenAI selected, a custom model selected, and fields for model ID, API key, and custom request URL.

Save and start using it

Click Confirm to save the configuration, then choose the new model.

Verify the connection

Send a short test prompt. If the tool returns a response without an authentication or Model ID error, the connection works. Fully restart the tool after changing its configuration.

Switch models

Open the model selector or change the Model field in the configuration. Use the exact Model ID from the model plaza, then restart the current session.

Common errors

ErrorWhat to check
401 or UnauthorizedCheck the BetterToken API key and remove leading or trailing spaces.
404In full-URL mode, use exactly https://bettertoken.ai/v1/chat/completions. If your client has a Full URL switch, turn it on so the endpoint path is not appended again.
model not foundCopy a current Model ID from the model plaza.
Changes do not applySave the configuration and fully restart the tool.

Technical details

Protocol, endpoint, and internal provider fields

This guide uses the complete custom request URL https://bettertoken.ai/v1/chat/completions in full-URL mode. The official Chinese documentation describes a Full URL switch; use it only if your client provides that control.