> ## Documentation Index
> Fetch the complete documentation index at: https://bianxieai.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Claude Code

> Run Claude Code through the Anthropic-compatible API

## Install and configure

Install Claude Code using its official method and confirm `claude --version`, then set:

<CodeGroup>
  ```bash macOS / Linux theme={null}
  export ANTHROPIC_BASE_URL="https://api.bianxie.ai"
  export ANTHROPIC_AUTH_TOKEN="API_KEY"
  export ANTHROPIC_MODEL="your-model"
  claude
  ```

  ```powershell Windows PowerShell theme={null}
  $env:ANTHROPIC_BASE_URL="https://api.bianxie.ai"
  $env:ANTHROPIC_AUTH_TOKEN="API_KEY"
  $env:ANTHROPIC_MODEL="your-model"
  claude
  ```
</CodeGroup>

If your Claude Code version expects `ANTHROPIC_API_KEY`, assign the same key to that variable. The model must support Anthropic Messages and tool use.

Persist variables in your shell profile, Windows user environment, or the `env` object in `~/.claude/settings.json`. Never commit a real key.

## Troubleshooting

### Not logged in or login prompt

If Claude Code shows **Not logged in · Please run /login** or opens the Anthropic login options, it usually has not loaded a valid Bianxie AI configuration or its first-run onboarding is incomplete.

Check that `ANTHROPIC_AUTH_TOKEN`, `ANTHROPIC_BASE_URL`, and `ANTHROPIC_MODEL` are available in the current terminal and are not overridden by stale global variables or a CC Switch profile. After confirming the key, Base URL, and model ID, you can skip first-run onboarding as follows:

1. Locate `.claude.json` in the user home directory:

   * macOS / Linux: `~/.claude.json`
   * Windows: `C:\Users\%USERNAME%\.claude.json`

2. Set `hasCompletedOnboarding` to `true`:

```json theme={null}
{
  "hasCompletedOnboarding": true
}
```

3. Save the file and run `claude` again.

<Note>If `.claude.json` already contains other fields, add or update only `hasCompletedOnboarding`; do not replace the entire file.</Note>

### Other errors

* `401`: Do not copy the literal `API_KEY` placeholder into the configuration.
* `400 Incorrect model ID`: Copy the exact model ID from the live model page.
* CC Switch and manual settings conflict: remove stale global `ANTHROPIC_*` variables.
