Trae
Add a custom model in Trae model settings.
Trae is an AI code editor from ByteDance. Its settings let you add a custom model in either the OpenAI-compatible or the Anthropic format. The steps are the same in the China and international editions.
- Protocol: OpenAI-compatible or Anthropic
- Base URL:
https://tokenfunc.com/v1for OpenAI-compatible,https://tokenfunc.comfor Anthropic - Models: any, for example
deepseek-chat
Open the Add Model dialog
In Trae open Settings → Models and click Add Model. You can also click "Add Model" at the bottom of the model list in the chat box.
Screenshot pendingThe Models page in Trae settings with the Add Model buttontools/trae-models.png
Choose Custom Model and the API format
Choose Custom Model as the provider, then set API Format:
- OpenAI Chat Completions: for GPT, DeepSeek, GLM, Kimi, Gemini and similar models.
- Anthropic Messages: for Claude models.
Enter the address, model and key
Make sure the Full URL switch is off, then fill in:
Field OpenAI Chat Completions Anthropic Messages Custom request URL https://tokenfunc.com/v1https://tokenfunc.comModel ID deepseek-chatclaude-sonnet-4-5API key sk-xxxxxxxxxxxxxxxxsk-xxxxxxxxxxxxxxxxThe display name is up to you.
If you turn Full URL on, enter the full path instead:
https://tokenfunc.com/v1/chat/completionsfor OpenAI orhttps://tokenfunc.com/v1/messagesfor Anthropic.Screenshot pendingTrae's custom model form with API format, request URL, model ID and API key filled in and Full URL offtools/trae-custom-model.png
Adjust the advanced settings if needed
Expand Advanced Settings to set the context window, image input, thinking mode and so on to match the model. Keep the defaults if unsure.
Add and verify
Click Add Model. Trae makes a real call to check the settings: on success the model joins the list; on failure it shows the error, which you can look up below.
Then choose the model in the chat box and send a message to confirm it replies.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
| 404 when adding | The address does not match the Full URL switch. With it off, stop at /v1 (or the bare address); with it on, enter the full path |
| 401 when adding | Wrong key or no quota left. Check it on API Keys |
| Model not found / no available channel | The model ID does not match this site. Copy it from the Model Square |
| Added but not in the chat model list | The model is disabled in the list. Enable it under Settings → Models |
| Can Claude models use the OpenAI format? | Yes, this site converts automatically, but the Anthropic format gives fuller reasoning and caching support |