# Claude Code API Setup: Passion8, CC Switch and settings.json

> Connect Claude Code to Passion8 with CC Switch or settings.json. Set the gateway Base URL, API key, and enabled model, then verify the active route.

URL: https://docs.passion8.cc/en/docs/claude-code/settings
Language: en
Publisher: Passion8
Last updated: 2026-10-11

After installation, connect Claude Code with a **Passion8 URL, API key, and enabled Claude model ID**. Local API-key access does not require an Anthropic account or OAuth login. This page offers two methods: **[CC Switch](#configure-with-cc-switch-recommended)** for graphical configuration, or [manual configuration](#manual-configuration) using environment variables and settings. New users can start with CC Switch.




The Passion8 Base URL for Claude Code is `https://passion8.cc`, **without** `/v1`. Use `ANTHROPIC_AUTH_TOKEN` for your Passion8 API key.




## Before configuring

Confirm Claude Code runs locally:

```bash
claude --version
```

If it is not installed, see [Install Claude Code](https://docs.passion8.cc/en/docs/claude-code/install).

Prepare these connection settings:

| Item | Value |
| --- | --- |
| Base URL | `https://passion8.cc` |
| Token variable | `ANTHROPIC_AUTH_TOKEN`, holding your complete Passion8 API key |
| Model ID | The exact Claude model ID enabled for your token in the Passion8 dashboard |

After configuration, the test command should return a normal response. For authentication errors, check the token first. For connection errors, check whether `/v1` was mistakenly added to the Base URL.

## Configure with CC Switch (recommended)

CC Switch manages Claude Code configuration graphically, without hand-editing JSON. The fields are the same on macOS and Windows.







### Install and open CC Switch

Download the release for your system from [CC Switch Releases](https://github.com/farion1231/cc-switch/releases). Open it and select `Claude Code` in the application list.






### Add an application-specific configuration

Add a Claude Code provider with these settings:

| Field | Value |
| --- | --- |
| Name | `Passion8 Claude Code` |
| Endpoint / Base URL | `https://passion8.cc` |
| API Key | `sk-YOUR_PASSION8_API_KEY` |
| Environment variable | `ANTHROPIC_AUTH_TOKEN` |






### Save and test

Save and enable the configuration, then restart Claude Code. Test from Terminal on macOS or PowerShell on Windows:

```bash
claude -p "Confirm the connection in one sentence"
```

A normal response indicates the request worked. Check `/status` for the Passion8 endpoint and token source to confirm which configuration is active.









These settings configure the **Claude Code CLI**. IDE integrations can also use the CLI settings, but current VS Code extensions perform their own pre-launch authentication check; if the extension still asks to log in, configure `claudeCode.environmentVariables` in VS Code user settings as described in the [official gateway guide](https://code.claude.com/docs/en/llm-gateway-connect#vs-code-extension). **Claude Desktop is separate** and requires its own CC Switch configuration below.




## Connect Claude Desktop as well (optional)

Claude Code and Claude Desktop are separate applications. Claude Code uses `~/.claude/settings.json`; Claude Desktop has its own configuration. CC Switch exposes **separate application entries**, typically “Claude” and “Claude Desktop,” with a small monitor indicator on the Desktop icon. Configure the desktop application separately.







### Select Claude Desktop

Choose **Claude Desktop** in the application switcher. If it is hidden, check **Settings → General → Application visibility**.






### Add or import a provider

If Passion8 is already configured for Claude Code, use **Import existing providers from Claude Code** where available.

Alternatively, click **+** and enter:

| Field | Value |
| --- | --- |
| Name | `Passion8 Claude Desktop` |
| Endpoint / Base URL | `https://passion8.cc` |
| API Key | `sk-YOUR_PASSION8_API_KEY` |

For this direct Passion8 configuration, leave **Model mapping required** off unless your actual route specifically requires mapping.






### Enable and restart

Click **Enable** on the provider card, then **fully quit and reopen Claude Desktop**.




Claude Desktop does not reload this configuration in the same way as Claude Code. Fully quit and restart after switching providers.









## Manual configuration

Use this method if you do not want CC Switch or prefer direct control over environment variables and `settings.json`.





### macOS


### 1. Create the configuration directory

Use the user-level `~/.claude/settings.json` to keep your key out of the project repository:

```bash
mkdir -p ~/.claude
```

### 2. Edit settings.json

Edit `~/.claude/settings.json`:

```json title="~/.claude/settings.json"
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://passion8.cc",
    "ANTHROPIC_AUTH_TOKEN": "sk-YOUR_PASSION8_API_KEY"
  }
}
```

### 3. Test

Save, open a fresh terminal, and test from a project directory:

```bash
claude -p "Confirm the connection in one sentence"
```

### Alternatively, use environment variables

Adding these lines to `~/.zshrc` makes them available in new terminal sessions:

```bash
echo 'export ANTHROPIC_BASE_URL="https://passion8.cc"' >> ~/.zshrc
echo 'export ANTHROPIC_AUTH_TOKEN="sk-YOUR_PASSION8_API_KEY"' >> ~/.zshrc
source ~/.zshrc
```




Entering a real key in an `echo` command can leave it in shell history. To avoid that, open `~/.zshrc` or `~/.claude/settings.json` in an editor and paste it there.







### Windows


### 1. Create the configuration directory

Create the user-level Claude Code directory in PowerShell:

```powershell
New-Item -ItemType Directory -Force "$env:USERPROFILE\.claude"
notepad "$env:USERPROFILE\.claude\settings.json"
```

### 2. Edit settings.json

Enter this configuration in the file:

```json title="%USERPROFILE%\\.claude\\settings.json"
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://passion8.cc",
    "ANTHROPIC_AUTH_TOKEN": "sk-YOUR_PASSION8_API_KEY"
  }
}
```

### 3. Test

Save, open a new PowerShell window, and test from a project directory:

```powershell
claude -p "Confirm the connection in one sentence"
```

### Alternatively, use environment variables

Variables saved by `setx` take effect in a new PowerShell window:

```powershell
setx ANTHROPIC_BASE_URL "https://passion8.cc"
setx ANTHROPIC_AUTH_TOKEN "sk-YOUR_PASSION8_API_KEY"
```







## Advanced configuration template

The model IDs below were checked against the official catalog on 2026-10-11: Sonnet 5.5, Opus 5.5, Fable 5.1, and Haiku 5.5. Official availability does not mean your Passion8 key has access. Before copying, compare them with your console; remove unavailable tiers or substitute IDs you can access. The template uses only `ANTHROPIC_MODEL` as its default model source, avoiding a conflicting top-level `model`. Unverified `[1M]` suffixes are not included by default.

The minimal configuration above covers basic connectivity. If you understand permissions, caching, and model selection, this advanced template can be placed in `~/.claude/settings.json`.




This is not a beginner default. `bypassPermissions` and `skipDangerousModePermissionPrompt` reduce confirmation prompts and increase the impact of mistakes. Use them only in a trusted local project, recoverable Git repository, container, or disposable VM.




```json title="~/.claude/settings.json"
{
  "env": {
    "ANTHROPIC_AUTH_TOKEN": "sk-YOUR_PASSION8_API_KEY",
    "ANTHROPIC_BASE_URL": "https://passion8.cc",
    "CLAUDE_CODE_EXPERIMENTAL_AGENT_TEAMS": "1",
    "CLAUDE_CODE_EFFORT_LEVEL": "auto",
    "DISABLE_AUTOUPDATER": "1",
    "DISABLE_BUG_COMMAND": "1",
    "CLAUDE_CODE_ATTRIBUTION_HEADER": "0",
    "DISABLE_ERROR_REPORTING": "1",
    "DISABLE_TELEMETRY": "1",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5-5",
    "ANTHROPIC_DEFAULT_SONNET_MODEL_NAME": "claude-sonnet-5-5",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-5-5",
    "ANTHROPIC_DEFAULT_OPUS_MODEL_NAME": "claude-opus-5-5",
    "ANTHROPIC_DEFAULT_FABLE_MODEL": "claude-fable-5-1",
    "ANTHROPIC_DEFAULT_FABLE_MODEL_NAME": "claude-fable-5-1",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5-5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL_NAME": "claude-haiku-5-5",
    "ANTHROPIC_MODEL": "claude-opus-5-5"
  },
  "attribution": {
    "commit": "",
    "pr": ""
  },
  "permissions": {
    "defaultMode": "bypassPermissions"
  },
  "skipDangerousModePermissionPrompt": true
}
```

Without `ENABLE_PROMPT_CACHING_1H`, ordinary API/provider requests use the default five-minute cache TTL unless another setting overrides it. Add the following only when the same large context is repeatedly reused after five minutes but within an hour:

```json title="Optional: request a one-hour prompt cache TTL"
{
  "env": {
    "ENABLE_PROMPT_CACHING_1H": "1"
  }
}
```

### Important fields

| Field | Purpose | Recommendation |
| --- | --- | --- |
| `ANTHROPIC_BASE_URL` | Send Claude Code requests to Passion8 | Use `https://passion8.cc`, without `/v1` |
| `ANTHROPIC_AUTH_TOKEN` | Passion8 API key | Required; do not leave blank or commit it |
| `ENABLE_PROMPT_CACHING_1H` | Request a one-hour cache TTL | Omit by default; consider it for longer gaps between large-context requests |
| `ENABLE_TOOL_SEARCH` | Defer MCP tool definitions | Not enabled by default on a custom gateway; set true only after confirming `tool_reference` passthrough |
| `CLAUDE_CODE_EFFORT_LEVEL` | Default reasoning effort | `auto` follows the model default; supported levels vary, and this variable overrides `/effort` and `--effort` |
| `ANTHROPIC_DEFAULT_*_MODEL` | Pin the default model for each tier | Use IDs available in Passion8 |
| `ANTHROPIC_MODEL` / `model` | Startup model | This template uses only the former; it overrides file-level model, while `/model` and `--model` can select another session model |
| `attribution` | Commit and PR attribution | Replaces deprecated `includeCoAuthoredBy`; do not duplicate the old setting |
| `permissions.defaultMode = bypassPermissions` | Skip most tool approval prompts | Use only in trusted, recoverable or isolated environments |
| `skipDangerousModePermissionPrompt` | Hide the dangerous-mode confirmation | Enable only if you explicitly accept that behavior |

### About one-hour caching

`ENABLE_PROMPT_CACHING_1H=1` is not a default recommendation. It suits repeated large contexts where turns are often separated by more than five minutes but less than an hour. The five-minute default has lower write cost and is a better general starting point.




A one-hour cache generally does not transfer across accounts, models, or upstream context boundaries. Changes in upstream routing or cache scope can prevent reuse; do not treat a hit as guaranteed. Keep the five-minute default if repeated cache creation and cost variation are concerns.




See [Prompt caching](https://docs.passion8.cc/en/docs/claude-code/prompt-caching) for details and [Permissions and modes](https://docs.passion8.cc/en/docs/claude-code/permissions) for permission implications.

## Check the active configuration

Run a test request:

```bash
claude -p "Describe the current project in one sentence"
```

A normal response confirms a successful request. Check `/status` and the Passion8 usage record to establish the route. If it fails, check:

| Item | Expected value or action |
| --- | --- |
| Base URL | `https://passion8.cc` |
| Token variable | `ANTHROPIC_AUTH_TOKEN` |
| Token value | Your Passion8 API key, without extra whitespace |
| Terminal | Open a new terminal after changing persistent environment variables |
| Project configuration | Do not put personal keys in committed `.claude/settings.json` |

For command, PATH, proxy, TLS, or login failures, see [Installation and login troubleshooting](https://docs.passion8.cc/en/docs/claude-code/install-troubleshooting). For authentication, missing models, or runtime API failures, see [Troubleshooting](https://docs.passion8.cc/en/docs/claude-code/troubleshooting) and [Error reference](https://docs.passion8.cc/en/docs/claude-code/error-reference).

## Gateway Setup FAQ

### Do I need an Anthropic account or Claude subscription?

Local Claude Code can connect using this Passion8 API-key configuration, without Anthropic OAuth or a Claude subscription. Locally configured gateway access does not automatically enable cloud-hosted entry points.

### Why does the Claude Code URL omit /v1?

This guide uses the Anthropic-compatible entry point: set `ANTHROPIC_BASE_URL` to `https://passion8.cc`. Do not copy Codex’s `https://passion8.cc/v1`; clients have different protocol and URL requirements.

### How do I choose a model or switch vendors in one editor?

Use the exact model ID enabled for your token in the Passion8 dashboard, and specify it as `ANTHROPIC_MODEL` in the template above. For the official Claude panel, follow the [VS Code extension guide](https://docs.passion8.cc/en/docs/claude-code/vscode). To switch Claude, GPT, Gemini, and Grok in one extension, follow [Cline multi-model configuration](https://docs.passion8.cc/en/docs/cline).

## Related pages



- [Install Claude Code](https://docs.passion8.cc/en/docs/claude-code/install): Install the CLI, desktop app, and official IDE extensions.
- [Configuration debugging and .claude](https://docs.passion8.cc/en/docs/claude-code/configuration-debugging): Diagnose settings sources, merging, hooks, MCP, skills, permissions, and local data.



## Field verification

Checked: 2026-10-11. [Official model catalog](https://platform.claude.com/docs/en/about-claude/models/overview), [environment variables](https://code.claude.com/docs/en/env-vars), and [settings reference](https://code.claude.com/docs/en/settings-reference). Documentation verification does not establish successful live calls to every Passion8 model.
