0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

claude-code-router でAPI Error 500が出るときの対処法

0
Posted at

事象

claude-code-routerで以下のようなエラーが出る

❯ ccr code
╭───────────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code!                         │
│                                                   │
│   /help for help, /status for your current setup  │
│                                                   │
│   cwd: /home/user1/projects/pcap1     │
│                                                   │
│   ─────────────────────────────────────────────── │
│                                                   │
│   Overrides (via env):                            │
│                                                   │
│   • API timeout: 600000ms                         │
│   • API Base URL: http://127.0.0.1:3456           │
╰───────────────────────────────────────────────────╯

> hi
  ⎿  API Error (500 {"error":{"message":"fetch failedTypeError: fetch failed\n    at node:internal/deps/undici/undici:13502:13\n    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n    at async u0 (/home/user1/.nvm/versions/node/v22.14.0/lib/node_modules/@musistudio/claude-code-router/dist/cli.js:74669:11)\n    at async o0 (/home/user1/.nvm/versions/node/v22.14.0/lib/node_modules/@musistudio/claude-code-router/dist/cli.js:74639:84)","type":"api_error","code":"internal_error"}}) · Retrying in 1 seconds… (attempt 1/10)h 

解決法

config.jsonからPROXY_URLを消す

{
  "Providers": [
    {
      "name": "openrouter",
      "api_base_url": "https://openrouter.ai/api/v1/chat/completions",
      "api_key": "api_key",
      "models": ["anthropic/claude-sonnet-4"],
      "transformer": {
        "use": ["openrouter"]
      }
    }
  ],
  "Router": {
    "default": "openrouter,anthropic/claude-sonnet-4"
  },
  "LOG": true
}

そしてサーバーをリスタート

ccr restart

以上です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?