Use Case:
| Suitable for users who want to use MaiToken models in TRAE's Chat or Agent mode. |
|---|
Configuration Steps
Open Model Management: Launch TRAE, open the account or settings page, locate "Models" on the left, and click "Add Model". Depending on your version, you may also access this from the model dropdown in the chat box.
Expand Custom Configuration: Select "Custom Configuration" or "Add Custom Model".
Select API Format: Choose OpenAI Chat Completions format; do not select Anthropic Messages.
Enable Full URL: If the UI provides a "Full URL" toggle, turn it on. Once enabled, TRAE uses the exact address you enter without automatically appending request paths.
Enter Request URL: Enter https://api.maitoken.net/v1/chat/completions . This is the full request URL.
Enter Model ID: Replace
<Model ID>with the exact ID shown in your API Key's model restriction list. We recommend setting the display name toMaiToken - Model ID.Enter API Key: Paste your own MaiToken Key. Paste only the key itself—do not manually add
Bearer.Save Configuration: Click "Submit" or "Save". Return to the chat panel, turn off Auto, and select the MaiToken model you just created.
| Field | Value |
|---|---|
| API Format | OpenAI Chat Completions |
| Full URL | https://api.maitoken.net/v1/chat/completions |
| Model ID | <Model ID> |
| API Key | <Your MaiToken Key> |
| If there is no "Full URL" toggle in the UI, upgrade TRAE first. If your current version only accepts a Base URL, enter https://api.maitoken.net/v1 ; if neither Base URL nor a custom request URL is supported, that version is not suitable for this guide. |
|---|
How to Test After Setup
Test Basic Chat: Enter
"Reply OK only"in the chat box. Receiving a normal reply confirms that your API Key, request URL, and Model ID are basically correct.Test Project Reading: Open a test project and enter
"Please read the current project directory and list only the top-level file names without modifying any files."Test Agent: Ask the Agent to create a new file named
test-maitoken.txtcontaininghello, then verify the file was created. Do not run initial tests on a real production project.
Troubleshooting
| Issue | Suggested Fix |
|---|---|
| 404 Not Found | Check whether /chat/completions was appended twice. The full URL should contain /v1/chat/completions only once. |
| Model not found after saving | Turn off Auto mode, then look for your custom model in the chat box's model selector. |
| Chat works but cannot edit files | Switch to a model that supports tool_calls, and make sure you are using Agent mode rather than regular Chat mode. |
