Skip to content

Not logged in · Please run /login Claude Code

Quick fix

Edit ~/.claude.json to move PROXY_MANAGED into the approved list, or answer yes at the prompt.

Error output
Not logged in · Please run /login

Using cc-switch to give Claude Code a proxied model (GitHub Copilot or Codex, for instance), Claude Code detects the third-party API key and prompts `Do you want to use this API key?`. If you answer `no` by mistake, or the auth state handling misbehaves in cc-switch 3.16, `PROXY_MANAGED` gets written into the `rejected` list in `~/.claude.json`. Claude Code then refuses to use the proxy credential and reports not logged in. Some users hit a `400 bad request: Authorization header is badly formatted` error after editing the config, or find the edit has no effect at all — usually a compatibility regression in cc-switch 3.16.

  1. Open `~/.claude.json` in the current user home directory.

  2. Edit the `customApiKeyResponses` field, moving `PROXY_MANAGED` out of the `rejected` array into the `approved` array.

    // ~/.claude.json
    {
    "customApiKeyResponses": {
    "approved": [
    "PROXY_MANAGED"
    ],
    "rejected": []
    }
    }
  3. Restart Claude Code, and if the `Do you want to use this API key?` prompt appears, be sure to answer `yes`.

  4. If you get a `400 bad request` after the edit, or it still reports not logged in, downgrade cc-switch to version 3.15.

ToolClaude Code
Versioncc-switch 3.16.0 - 3.16.1
PlatformsWindows
I get `400 bad request: Authorization header is badly formatted` after editing `.claude.json`. How do I resolve it?
This is a known problem in cc-switch 3.16 — try downgrading cc-switch to version 3.15.
Why does switching to a DeepSeek model work and only Codex error?
This only happens with the proxy on and a model that needs OAuth authentication (Codex, GitHub Copilot). Other models are unaffected.

This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.