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/v1 for OpenAI-compatible, https://tokenfunc.com for Anthropic
  • Models: any, for example deepseek-chat
  1. 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

  2. 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.
  3. Enter the address, model and key

    Make sure the Full URL switch is off, then fill in:

    FieldOpenAI Chat CompletionsAnthropic Messages
    Custom request URLhttps://tokenfunc.com/v1https://tokenfunc.com
    Model IDdeepseek-chatclaude-sonnet-4-5
    API keysk-xxxxxxxxxxxxxxxxsk-xxxxxxxxxxxxxxxx

    The display name is up to you.

    If you turn Full URL on, enter the full path instead: https://tokenfunc.com/v1/chat/completions for OpenAI or https://tokenfunc.com/v1/messages for 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

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

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

SymptomCause and fix
404 when addingThe 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 addingWrong key or no quota left. Check it on API Keys
Model not found / no available channelThe model ID does not match this site. Copy it from the Model Square
Added but not in the chat model listThe 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