TRAE

Use Case:

Suitable for users who want to use MaiToken models in TRAE's Chat or Agent mode.

Configuration Steps

  1. 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.

  2. Expand Custom Configuration: Select "Custom Configuration" or "Add Custom Model".

  3. Select API Format: Choose OpenAI Chat Completions format; do not select Anthropic Messages.

  4. 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.

  5. Enter Request URL: Enter https://api.maitoken.net/v1/chat/completions . This is the full request URL.

  6. 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 to MaiToken - Model ID.

  7. Enter API Key: Paste your own MaiToken Key. Paste only the key itself—do not manually add Bearer.

  8. 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

  1. 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.

  2. 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."

  3. Test Agent: Ask the Agent to create a new file named test-maitoken.txt containing hello, 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.