Skip to main content
Trae Work supports custom model services through OpenAI-compatible or Anthropic-compatible protocols. For HaiToken, the most reliable setup is OpenAI Chat Completions.
This Trae Work guide is primarily GUI-based, so the core steps are generally the same on Windows, macOS, and Linux. If menu hierarchy, button placement, or dialog styling differs slightly on your system, follow the current UI, but keep the same protocol, request URL, model ID, and API key values.

What You Need

  • A HaiToken API key
  • At least one available model ID, such as gpt-5.4
  • HaiToken OpenAI-compatible address: https://api.haitoken.ai/v1
  • HaiToken Claude / Anthropic-compatible address: https://api.haitoken.ai

Choose the API format first

Trae Work officially supports two common protocol formats:
  • OpenAI Chat Completions: recommended first, simplest to configure, and the best default for most HaiToken setups
  • Anthropic Messages: also common, useful when you explicitly want the Claude / Anthropic ecosystem
If you do not have a strong reason, start with the OpenAI path.

Setup Steps

Step 1: Open the model settings

In Trae Work, go to Settings > Models. If the current page shows Add Model, click it to open the add-model dialog.

Step 2: Choose Custom Configuration

In the add-model dialog, switch from preset providers to Custom Configuration. This allows Trae Work to call HaiToken directly with the protocol, endpoint, and model ID you provide.

Step 3: Choose the API format

Select OpenAI Chat Completions as the API format. HaiToken provides an OpenAI-compatible chat endpoint at POST /v1/chat/completions, and this is the simplest path for most Trae Work integrations. If you explicitly want the Claude / Anthropic path instead, you can choose Anthropic Messages here. In that case, the request URL later should be https://api.haitoken.ai rather than the OpenAI-style /v1 address.

Step 4: Fill the endpoint, model ID, and API key

Use the following values: If the UI provides a Full URL switch, it is safer to keep it off first and enter the base address https://api.haitoken.ai/v1. If Full URL is already enabled, then use the full endpoint https://api.haitoken.ai/v1/chat/completions instead. If you chose Anthropic Messages, keep the base-address style and enter https://api.haitoken.ai, then let the client call /v1/messages. If the dialog also exposes optional fields, adjust them according to the real model capability:
  • Multimodal: enable only if the model supports image input
  • Display name: for example HaiToken GPT-5.4
  • Context window and max output: keep the defaults if you are unsure

Step 5: Add the model and enable it

Click Add Model. If Trae Work reports a successful connection, the model should appear in the model list. Make sure it is enabled and switch to it in the chat UI.

Verification

  1. Open the Trae Work chat panel.
  2. Switch to the HaiToken-backed model.
  3. Send a simple test prompt such as hi or Explain what this file does.
  4. If the reply returns normally, the integration is working.

Notes

If you are using base-address mode in Trae Work, enter https://api.haitoken.ai/v1. If you are using Full URL mode, enter https://api.haitoken.ai/v1/chat/completions. Do not mix the two modes.
The value you should enter here is the model ID from the HaiToken homepage or model list, not the display name. Copy a value such as gpt-5.4 directly to avoid model not found.
Trae Work’s official model documentation states that custom configuration supports both OpenAI Chat Completions and Anthropic Messages. For HaiToken, the OpenAI path is usually the most direct. Official model docs

FAQ

Next