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.
Symptom
Section titled “Symptom”Not logged in · Please run /loginUsing 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.
Open `~/.claude.json` in the current user home directory.
Edit the `customApiKeyResponses` field, moving `PROXY_MANAGED` out of the `rejected` array into the `approved` array.
// ~/.claude.json{"customApiKeyResponses": {"approved": ["PROXY_MANAGED"],"rejected": []}}Restart Claude Code, and if the `Do you want to use this API key?` prompt appears, be sure to answer `yes`.
If you get a `400 bad request` after the edit, or it still reports not logged in, downgrade cc-switch to version 3.15.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 2 real issues
- 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.
Related problems
Section titled “Related problems”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.