TRAE - AI Programming Assistant
Added 58API custom models in TRAE for AI conversations, code analysis, code generation and agent programming tasks
Added 58API custom models in TRAE for AI conversations, code analysis, code generation, and agent programming tasks. TraeCode and TraeWork have been merged into the new TRAE. This article is written based on the merged TRAE desktop version.
Scope of application
This article applies to the TRAE desktop version that supports the "custom configuration" function, including the domestic version (trae.cn) and the international version (trae.ai); both the IDE window and the Agent window are configured in "Settings → Model → Add Model". TRAE updates quickly. If the interface text is slightly different, please refer to this path.
Configuration quick check
It is recommended to use OpenAI Chat Completions compatible format:
| TRAE configuration items | Fill in the content |
|---|---|
| Add method | Custom configuration |
| API format | OpenAI Chat Completions format |
| Full URL | closure |
| Custom request address | https://api.58api.net/v1 |
| Model ID | Fill in the model name shown in 58API |
| API key | API token created in 58API console |
| multimodal | Only enabled when the model supports image input |
If the "Full URL" switch is turned on, please fill in:
https://api.58api.net/v1/chat/completionsYou can only choose between the basic address and the complete address. Don't add duplicates when "Full URL" is turned off /chat/completions。
Preparation before use
- Install and log into the latest version of TRAE.
- Log in to 58API and confirm that the account balance is sufficient.
- Create an API token in the 58API console.
- Confirm that the model you plan to use supports the OpenAI Chat Completions-compatible interface.
- Copy the model name for use.
TRAE takes the
modelThe parameter is called "Model ID" and the 58API console usually displays the same value as "Model Name". There is no need to look up or fill in the numeric ID here.
1. Obtain 58API key
Go to the "API Keys" page of the 58API console, create or select an existing key, and click the copy icon to the right of the key.

The API key should only be filled in in TRAE's model configuration window. It is recommended to create a separate key for TRAE and set the quota or access scope as needed.
2. Open TRAE model management
Open Settings in TRAE, go to Models, and click Add Model.
In some versions, you can also open the model list from the lower right corner of the AI dialog input box, and then click "Add Model".
3. Add 58API custom model
Select "Custom Configuration" in the "Add Model" window and enter the OpenAI Chat Completions configuration page as shown below.

In the screenshot, the "Multi-modal" switch is turned on, for illustration only; please turn it on only when the model supports image input.
Fill in the following:
- API Format: Select
OpenAI Chat Completions 格式。 - Full URL: Keep it closed.
- Custom request address: fill in
https://api.58api.net/v1。 - Model ID: Fill in the exact model name as shown in 58API.
- API Key: Paste the 58API Token you just copied.
- Multi-modal: Only enabled when the current model supports image input.
What should be filled in for the model ID?
Although the TRAE interface says "Model ID", you actually need to fill in the Model Name of 58API here.
For example, fill in whatever name is shown in the 58API available model list. Capitalization, hyphens, and version suffixes in names must be consistent.
Please do not fill in:
- Numeric ID;
- Aliases you give the model;
- "Model Display Name" in TRAE Advanced Configuration.
Two ways to fill in addresses (OpenAI Chat Completions format)
| Full URL switch | Request address |
|---|---|
| Close (recommended) | https://api.58api.net/v1 |
| Open | https://api.58api.net/v1/chat/completions |
If the address mode is filled in incorrectly, a common symptom is that it returns when adding a model. 404, or the requested address appears repeatedly /chat/completions。
Using the Claude model (Anthropic Messages format, optional)
If "Anthropic Messages Format" is selected for the Claude model, TRAE automatically splices /v1/messages, the address should be changed to:
| API format | Full URL switch | Request address |
|---|---|---|
| Anthropic Messages Format | closure | https://api.58api.net(Don’t bring it /v1) |
| Anthropic Messages Format | Open | https://api.58api.net/v1/messages |
Do not inherit when selecting Anthropic Messages format https://api.58api.net/v1, otherwise the request would become /v1/v1/messages and returns 404.
4. Set advanced configuration
It is recommended to keep the default values when accessing for the first time, and only modify the items that can be confirmed:
| Configuration items | suggestion |
|---|---|
| Model series | This can be selected if TRAE provides a template corresponding to the selected model; the default configuration will be used if this cannot be confirmed |
| Model display name | Fillable 58API - 模型名称, easy to distinguish from built-in models |
| context window | Set according to the actual capabilities of the model in 58API, do not blindly increase the size |
| Tool call round | Keep the default value for the first time to avoid extra consumption caused by abnormal loops. |
The model display name only affects the TRAE interface display; what is actually sent during the request is the 58API model name filled in the "Model ID" field.
5. Add and enable models
Click "Add Model". TRAE checks the address, model name, and API key:
- Connection successful: the model will appear in the model management list;
- Connection failed: Expand the error and service provider logs, and then check the FAQs in this article one by one.
After the addition is successful, confirm that the enable switch on the right side of the model is turned on. The model can be edited, disabled or deleted here later.

The schematic diagram is taken from the TRAE official document. The service provider label ("Volcano Engine") in the list is subject to the actual interface after adding the 58API model.
If you only want to temporarily hide the model, select "Disable" instead of deleting and reconfiguring it.
6. Select the 58API model in the dialog
- Create a new AI conversation.
- Click the model name in the lower right corner of the input box.
- Turn off Auto Mode.
- Manually select the newly added
58API - 模型名称。

Auto Mode will only call the TRAE built-in model and will not automatically use the 58API custom model you added. When you need to use 58API, you must turn off Auto Mode and manually select a custom model.
7. Test the connection
First send a small read-only task:
请用三句话说明当前项目的主要目录结构,暂时不要修改文件。After confirming that the model can respond normally, test the code task again:
检查当前项目的启动方式,告诉我应该运行哪条命令,先不要执行。If you are ready to verify the agent's capabilities, then have the model perform a file modification and inspection task with a well-defined scope and easy rollback.
8. View usage logs on 58API
Open the 58API console, enter "Usage Log", and confirm that the request record just now appears.

The picture above shows the usage log page. When TRAE is configured to access through this article, the endpoint in the log should usually be /v1/chat/completions(When using the Anthropic Messages format /v1/messages), the model name should be consistent with the content filled in the "Model ID" field of TRAE; the time, tokens and fees are subject to your actual request.
Verification Checklist
- TRAE The connection check passes when adding a model;
- The custom model is enabled and appears in the dialog's model list;
- Auto Mode is off;
- The 58API custom model has been manually selected;
- Simple conversations can return content normally;
- Code models that call tools as expected rather than just outputting plain text;
- 58Corresponding requests appear in the API usage log;
- The model names and endpoints in the logs are as expected.
FAQ
When adding a model, it prompts 401, authentication failed or API Key is invalid.
Copy the Token from the 58API console again and check whether there are missing characters, spaces or newlines before and after. Confirm that the token is not disabled, the token limit is sufficient, and the account has available balance.
Prompt 404 or interface not found
Focus on checking whether the "Full URL" switch and address match:
- OpenAI Chat Completions Format + Full URL Close:
https://api.58api.net/v1;Open:https://api.58api.net/v1/chat/completions - Anthropic Messages Format + Full URL Close:
https://api.58api.net;Open:https://api.58api.net/v1/messages
Do not fill in the complete request address into the basic address pattern, and do not splice it repeatedly. /chat/completions。
Prompt that the model name is wrong or the model is unavailable
Return to 58API to view the model names available for the current account, and fill in the name as it is in the "Model ID" field of TRAE. Do not fill in the numeric ID or the TRAE model display name you set yourself.
Also confirm that the current Token has the right to access the model.
Models can chat but will not modify code or call tools
The availability of general chat does not mean that the model is suitable for Agent programming. Please switch to a model that supports tool invocation, instruction following, and code tasks, and check tool permissions in TRAE.
The returned content is empty, keeps waiting, or prompts that the model request failed.
Check in the following order:
- Create a new conversation and try again;
- Check whether the request is received in the 58API usage log;
- Check if the model is compatible with OpenAI Chat Completions streaming responses;
- Temporarily turn off multimodality and use plain text for request verification;
- Change to a model test that confirms support for tool calls;
- Check the service provider log returned by TRAE, and do not judge the cause based solely on general error messages.
The "custom configuration" entry cannot be found
Update TRAE first. The interfaces of some old versions, grayscale versions or different product forms are not consistent. This article is for the TRAE desktop (IDE/Agent window); the TRAE plug-in and TRAE CLI may be configured differently.
Expenses increase too quickly
Agent programming will carry the project context and call the tool multiple times, and the cost is usually higher than ordinary chat. suggestion:
- Use independent token for TRAE;
- Use small projects and simple tasks for first testing;
- Don’t set the context window or tool call round to a high level without any basis;
- Check 58API usage logs and balance changes regularly.
References
This article refers to the following information:
- TRAE official documentation: built-in models and custom models
- TRAE international version documentation: Built-in models & custom models
- TRAE official documentation: Auto mode
- 58API Documentation: Get list of available models
- 58API Documentation: OpenAI Chat Completions
- 58API Documentation: Anthropic Messages
The interface is subject to the actual page.