TRAE

Use Cases

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

Configuration Steps

  1. Open Model Management: Open TRAE and go to the account or settings page. Find “Models” in the left-hand menu, and then click “Add Model.” In some versions, you may need to access model management from the model drop-down menu in the chat panel.

  2. Open Custom Configuration: Select “Custom Configuration” or “Add Custom Model.”

  3. Select the API Format: Select OpenAI Chat Completions. Do not select Anthropic Messages.

  4. Enable Full URL: If the interface provides a “Full URL” option, enable it. When enabled, TRAE will use the URL exactly as entered and will not append a request path automatically.

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

  6. Enter the Model ID: Replace <Model ID> with the exact ID shown in the API Key's model restriction list. We recommend setting the display name to MaiToken - Model ID.

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

  8. Save the Configuration: Click “Submit” or “Save.” Return to the chat panel, disable Auto, and then select the MaiToken model you just created.

Field Value
API Format OpenAI Chat Completions
Full URL https://api.maitoken.com/v1/chat/completions
Model ID <Model ID>
API Key <your MaiToken Key>
If the interface does not provide a “Full URL” option, update TRAE first. If the current version only accepts a Base URL, enter https://api.maitoken.com/v1 . If it supports neither a Base URL nor a custom request URL, that version is not suitable for this guide.

Test the Configuration

  1. Test a Basic Conversation: Enter “Reply with OK only” in the chat box. If you receive a valid response, the API Key, request URL, and Model ID are configured correctly.

  2. Test Project Reading: Open a test project and enter “Read the current project directory and list only the files at the first level. Do not modify any files.”

  3. Test Agent Capabilities: Ask the Agent to create a file named test-maitoken.txt and write hello into it. Confirm that the file was created successfully. Do not use a real production project for testing.

Common Issues

Issue Solution
404 Not Found Check whether /chat/completions was appended twice. The full URL should contain only one /v1/chat/completions path.
Model is missing after saving Disable Auto mode, and then look for the custom model in the model selector in the chat panel.
Chat works but files cannot be modified Use a model that supports tool_calls, and confirm that TRAE is running in Agent mode rather than standard Chat mode.