IntelliJ IDEA

How to fix a wrong Base URL causing request failures in IntelliJ IDEA

The Base URL is the core connection to AI Code With. Claude Code CLI appends Anthropic protocol paths, so ANTHROPIC_BASE_URL should be the host only — do not add /v1.

Start with these checks

ANTHROPIC_BASE_URL was entered with a /v1 suffix or the wrong host.

  • The request fails after sending a message, or reports a wrong endpoint path.
  • ANTHROPIC_BASE_URL includes /v1, so the path is duplicated
  • Print ANTHROPIC_BASE_URL in a terminal and confirm the current value
base url404ECONNREFUSED

01

Understand path joining

Claude Code CLI uses the Anthropic-compatible protocol and appends the API path to the Base URL. Set ANTHROPIC_BASE_URL to https://api.aicodewith.ai without /v1.

02

Enter the correct Base URL

Change ANTHROPIC_BASE_URL to https://api.aicodewith.ai, remove leftover path fragments, then restart IDEA so the process reads the new value.

  1. 1Print ANTHROPIC_BASE_URL in a terminal and confirm the current value
  2. 2Remove any trailing /v1, /v1/messages, or guessed path

03

Verify the request succeeds

After restarting, send a test message. A normal reply means the path is correct. If it still fails, confirm IDEA was not started with the old environment.

  1. 1Remove any trailing /v1, /v1/messages, or guessed path
  2. 2Export https://api.aicodewith.ai (no /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