Trae

How to fix a wrong Trae Request URL

The Request URL is the root Trae uses to call AI Code With. Claude must use the Anthropic Messages root without /v1; GPT, Gemini, DeepSeek, GLM, and Kimi must use the OpenAI-compatible root with /v1. Trae appends the rest of the path — keep Full URL off.

Start with these checks

The Request URL has the wrong path: Claude was given /v1, a non-Claude model is missing /v1, or Full URL was turned on and a path was appended.

  • Sending a message fails, times out, or reports a wrong endpoint path, 404, or connection refused.
  • Claude was entered as https://api.aicodewith.ai/v1, or a non-Claude model is missing /v1
  • Open Add Model and confirm the protocol: Anthropic Messages for Claude, OpenAI Chat Completions otherwise
404ECONNREFUSEDtimeout

01

Confirm the protocol before changing the URL

Claude uses Anthropic Messages at https://api.aicodewith.ai. Every other family uses OpenAI Chat Completions at https://api.aicodewith.ai/v1. The wrong protocol still 404s or fails to parse even if the host looks similar.

AI Code With does not convert protocols. One URL cannot serve both API formats.

02

Enter the Base URL with no extra path

The only correct Claude value is https://api.aicodewith.ai. The only correct value for every other family is https://api.aicodewith.ai/v1. Common mistakes: adding /v1 for Claude, omitting /v1 otherwise, a trailing slash, or turning Full URL on and appending a path.

With Full URL off, Trae appends the path for the selected API format. Manually adding /messages or /chat/completions duplicates the path and 404s.

  1. 1Open Add Model and confirm the protocol: Anthropic Messages for Claude, OpenAI Chat Completions otherwise
  2. 2For Claude enter https://api.aicodewith.ai (no /v1); for every other family enter https://api.aicodewith.ai/v1

03

Save and verify with a real request

Save the model, turn off Auto, pick that custom model, and send a message. On timeout or DNS errors, check that the machine can reach api.aicodewith.ai.

Success means a normal model reply and a matching AI Code With usage-record entry by time. If the URL is correct but parsing still fails, see “Protocol does not match the model”.

  1. 1For Claude enter https://api.aicodewith.ai (no /v1); for every other family enter https://api.aicodewith.ai/v1
  2. 2Keep Full URL off; do not append /messages or /chat/completions

Do not paste other relay domains from third-party tutorials into Trae. This page only uses https://api.aicodewith.ai and https://api.aicodewith.ai/v1.

If it is still not fixed

Sources

Reconfigure

Return to the integration center and continue the setup steps.

Return to the related setup step