[Bug] Anthropic API Error: 520 status code with empty response body

Resolved 💬 3 comments Opened Nov 23, 2025 by lmxuwork Closed Jan 23, 2026

Bug Description
API Error: 520 status code (no body) 总是报错,大哥们帮忙解决一下

Environment Info

  • Platform: darwin
  • Terminal: intellij
  • Version: 2.0.50
  • Feedback ID:

Errors

[{"error":"Error: 404 {\"error\":{\"message\":\"Invalid URL (POST /v1/messages/count_tokens)\",\"type\":\"invalid_request_error\",\"param\":\"\",\"code\":\"\"}}\n    at H9.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:397:36537)\n    at WT.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1309:2195)\n    at WT.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1309:5419)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1468:2698\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1468:2196\n    at async LA5 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1467:2364)\n    at async QA2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1468:2129)\n    at async VOA (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2194:52)\n    at async Y81 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2194:261)","timestamp":"2025-11-23T18:57:14.959Z"},{"error":"Error: 520 status code (no body)\n    at H9.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:397:36675)\n    at WT.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1309:2195)\n    at WT.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1309:5419)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async j41.model (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3838:14446)\n    at async j41 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2081:1872)\n    at async oW9 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3838:14598)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3838:7946\n    at async us1 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1468:1971)\n    at async VIA (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:3838:7916)","timestamp":"2025-11-23T19:01:17.491Z"},{"error":"Error: 404 {\"error\":{\"message\":\"Invalid URL (POST /v1/messages/count_tokens)\",\"type\":\"invalid_request_error\",\"param\":\"\",\"code\":\"\"}}\n    at H9.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:397:36537)\n    at WT.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1309:2195)\n    at WT.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1309:5419)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1468:2698\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1468:2196\n    at async LA5 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1467:2364)\n    at async QA2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1468:2129)\n    at async VOA (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2194:52)\n    at async Y81 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2194:261)","timestamp":"2025-11-23T19:03:29.455Z"},{"error":"Error: 404 {\"error\":{\"message\":\"Invalid URL (POST /v1/messages/count_tokens)\",\"type\":\"invalid_request_error\",\"param\":\"\",\"code\":\"\"}}\n    at H9.generate (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:397:36537)\n    at WT.makeStatusError (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1309:2195)\n    at WT.makeRequest (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1309:5419)\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1468:2698\n    at async file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1468:2196\n    at async LA5 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1467:2364)\n    at async QA2 (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:1468:2129)\n    at async VOA (file:///opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/cli.js:2194:52)\n    at async Y81 (file:///opt/homebrew/lib/node_modules/@anth

Note: Error logs were truncated.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗