Skip to content

Prompts /login and cannot use Codex API - Claude Code

Quick fix

Do not encode reasoning level in the model ID. Keep gpt-5.4; CC Switch maps it automatically.

Error output
启动claudecode 提示要 /login, 没办法用codex的呀
English translation

When starting Claude Code, it prompts for /login, so Codex cannot be used.

When using a non-Anthropic official API such as Codex API with cc-switch, the user tried to set a reasoning level or third-party compatibility by changing the model name in environment variables. This causes Claude Code to fail recognition and force /login.

Per maintainer/community guidance in closed Issue #1931, do not encode reasoning level in the model ID string, such as `gpt-5.4:high`. Keep the model ID as a plain name, such as `gpt-5.4`. cc-switch maps Claude thinking levels to the `reasoning.effort` parameter. Issue #555 is an Azure Foundry support request and does not directly fix this error, but confirms this configuration scenario, so it is listed as a related source.

  1. Check your environment variable configuration. Remove any reasoning-level suffix or special encoding from the model name. Keep the model ID as the standard name only, such as gpt-5.4.

    .env 或系统环境变量
    # 错误示例:ANTHROPIC_DEFAULT_HAIKU_MODEL="gpt-5.4:high"
    # 正确示例:
    ANTHROPIC_DEFAULT_HAIKU_MODEL="gpt-5.4"
    ANTHROPIC_DEFAULT_OPUS_MODEL="gpt-5.4"
    ANTHROPIC_DEFAULT_SONNET_MODEL="gpt-5.4"
    ANTHROPIC_MODEL="gpt-5.4"
    ANTHROPIC_REASONING_MODEL="gpt-5.4"
ToolClaude Code
VersionUnknown
PlatformsUnknown
Should the reasoning level be written in the model name?
No. Do not encode the reasoning level in the model ID. Keep the model ID as the original name, such as gpt-5.4. cc-switch automatically handles the `reasoning.effort` mapping.
What if it keeps prompting /login after connecting?
This usually means the model configuration is invalid and the client cannot authenticate through the unofficial API. Simplify the model ID as described above, and verify the API Key and Endpoint settings.

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.