Trae
How to fix a Trae protocol that does not match the model
Trae's Add Model dialog supports two API formats, but AI Code With does not convert them. Claude can only hit the Anthropic Messages root; GPT, Gemini, DeepSeek, GLM, and Kimi can only hit the OpenAI Chat Completions /v1 address. Mixing them 404s or fails to parse.
Start with these checks
API format does not match the Model ID family. Claude must use Anthropic Messages; every other family must use OpenAI Chat Completions.
- Claude is set to OpenAI Chat Completions, or GPT/Gemini/DeepSeek/GLM/Kimi is set to Anthropic Messages; the request 404s or fails to parse.
- A Claude model was configured as OpenAI Chat Completions, or a non-Claude model was configured as Anthropic Messages
- Confirm the Model ID family: IDs starting with claude use Anthropic; everything else uses OpenAI
01
Pick the protocol by model family
Every Model ID that starts with claude uses Anthropic Messages. GPT, Gemini, DeepSeek, GLM, and Kimi use OpenAI Chat Completions. Do not mix them just because Trae lists both formats.
The quick-copy area on this page splits the two configs with protocol tabs. Switching tabs also switches the Request URL and default Model ID.
02
Keep the Request URL aligned with API format
Anthropic Messages uses https://api.aicodewith.ai (no /v1). OpenAI Chat Completions uses https://api.aicodewith.ai/v1. The right format with the wrong URL still fails.
Add each model separately. Do not keep a Claude URL and swap in a GPT ID, or the reverse.
- 1Confirm the Model ID family: IDs starting with claude use Anthropic; everything else uses OpenAI
- 2For Claude pick Anthropic Messages and enter https://api.aicodewith.ai
03
Save and confirm the protocol with a real request
After saving, turn off Auto, pick that custom model, and send a short message. A normal reply plus a matching usage-record row means the protocol is aligned.
If you then get 401, follow the API key article; if you get Model Not Found, follow the Model ID article. Protocol mismatches usually show up as 404 or an unparseable response.
- 1For Claude pick Anthropic Messages and enter https://api.aicodewith.ai
- 2For GPT, Gemini, DeepSeek, GLM, and Kimi pick OpenAI Chat Completions and enter https://api.aicodewith.ai/v1
AI Code With will not convert an OpenAI request into Anthropic, or the reverse. The wrong protocol cannot be fixed by changing only the Model ID.
If it is still not fixed
Sources
Reconfigure
Return to the integration center and continue the setup steps.
Return to the related setup step