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

# Connect Claude Code to APIONE

> Configure Anthropic-compatible access in the terminal and VS Code.

Claude Code connects to APIONE through Anthropic Messages. Verify a terminal session before applying the same connection settings to your editor.

## Install and prepare

Install Claude Code using its official instructions and run `claude doctor`. Prepare an [APIONE API Key](https://apione.ai/en/app/api-keys) and a model supporting Messages and tool calls.

## Terminal configuration

For macOS, Linux, or WSL:

```bash theme={null}
export ANTHROPIC_BASE_URL="https://api.apione.ai"
export ANTHROPIC_AUTH_TOKEN="YOUR_APIONE_KEY"
unset ANTHROPIC_API_KEY
export ANTHROPIC_MODEL="YOUR_APIONE_MODEL_ID"
claude
```

For Windows PowerShell:

```powershell theme={null}
$env:ANTHROPIC_BASE_URL="https://api.apione.ai"
$env:ANTHROPIC_AUTH_TOKEN="YOUR_APIONE_KEY"
Remove-Item Env:ANTHROPIC_API_KEY -ErrorAction SilentlyContinue
$env:ANTHROPIC_MODEL="YOUR_APIONE_MODEL_ID"
claude
```

Replace both placeholders. Do not append /v1 or /messages to the base URL. These settings apply to the current shell. After verification, persist them using your shell configuration. Restore the previous environment when switching providers.

## Verify the connection

Run `/status` in a new session, then ask the model to reply with OK only. Use APIONE request records to verify routing rather than the model's self-reported identity. Use `/model` to switch models. For fixed tiers, configure ANTHROPIC\_DEFAULT\_HAIKU\_MODEL, ANTHROPIC\_DEFAULT\_SONNET\_MODEL, and ANTHROPIC\_DEFAULT\_OPUS\_MODEL as needed.

![Claude Code receives a reply; verify the actual request in APIONE.](https://mintcdn.com/apione/eGTb2vS-514SNt6Q/images/integrations/screenshots/claude-code-terminal.png?fit=max\&auto=format\&n=eGTb2vS-514SNt6Q\&q=85\&s=8345d2c6ef1b5193149a373925260bf8)

Claude Code receives a reply; verify the actual request in APIONE.

## VS Code extension

### 1. Install the extension

Open the VS Code extension marketplace and install **Claude Code for VS Code**, published by **Anthropic**, extension ID `anthropic.claude-code`. Click **Restart Extension** if prompted.

![Install the official Claude Code extension published by Anthropic.](https://mintcdn.com/apione/OyYiEY31YyCo4SOx/images/integrations/screenshots/claude-code-vscode-install.png?fit=max\&auto=format\&n=OyYiEY31YyCo4SOx\&q=85\&s=02388ea4e789356a3bdc4fd074bfaeae)

Install the official Claude Code extension published by Anthropic.

### 2. Open user settings

Open the extension settings, find **Claude Code: Environment Variables**, and click **Edit in settings.json**. You can also run **Preferences: Open User Settings (JSON)** from `Ctrl+Shift+P`.

![Open the user settings JSON from Environment Variables.](https://mintcdn.com/apione/OyYiEY31YyCo4SOx/images/integrations/screenshots/claude-code-vscode-settings-entry.png?fit=max\&auto=format\&n=OyYiEY31YyCo4SOx\&q=85\&s=1db3c3f0573ca068ceff32cf30aad31d)

Open the user settings JSON from Environment Variables.

### 3. Enter your APIONE connection

Merge this into the outermost object of your user settings. If `claudeCode.environmentVariables` already exists, update the same array rather than adding a duplicate property.

```json theme={null}
{
  "claudeCode.environmentVariables": [
    {"name":"ANTHROPIC_BASE_URL","value":"https://api.apione.ai"},
    {"name":"ANTHROPIC_AUTH_TOKEN","value":"YOUR_APIONE_KEY"},
    {"name":"ANTHROPIC_MODEL","value":"YOUR_APIONE_MODEL_ID"}
  ]
}
```

| Setting | Value |
| - | - |
| `ANTHROPIC_BASE_URL` | APIONE base URL `https://api.apione.ai` |
| `ANTHROPIC_AUTH_TOKEN` | An API Key created on the [APIONE keys page](https://apione.ai/en/app/api-keys) |
| `ANTHROPIC_MODEL` | An actual model ID available to the current key that supports Anthropic Messages and tool calls |

Use an APIONE Key and an actual model ID supporting Messages and tool calls. Keep the Base URL at the root without `/v1`. Retain your other user settings and keep real credentials out of project files.

### 4. Map model tiers, if needed

Append the tier mappings you need to the same environment-variable array:

```json theme={null}
[
  {"name":"ANTHROPIC_DEFAULT_HAIKU_MODEL","value":"YOUR_HAIKU_MODEL_ID"},
  {"name":"ANTHROPIC_DEFAULT_SONNET_MODEL","value":"YOUR_SONNET_MODEL_ID"},
  {"name":"ANTHROPIC_DEFAULT_OPUS_MODEL","value":"YOUR_OPUS_MODEL_ID"}
]
```

Use actual APIONE IDs for every tier and check the requested model in APIONE after switching.

### 5. Set operation permissions, if needed

**Initial Permission Mode** controls how new sessions request permission for file changes and commands. Start with `default` and review the proposed actions. This setting does not select a model.

![Initial Permission Mode controls permission prompts, not the model.](https://mintcdn.com/apione/OyYiEY31YyCo4SOx/images/integrations/screenshots/claude-code-vscode-permission-mode.png?fit=max\&auto=format\&n=OyYiEY31YyCo4SOx\&q=85\&s=05a1a7ddd7fe574faaed4195d8520d43)

Initial Permission Mode controls permission prompts, not the model.

If APIONE authentication is already configured, **Disable Login Prompt** can suppress the extension's login prompt.

### 6. Reload and verify

1. Save the settings and run **Developer: Reload Window**.
2. Open a new Claude Code session and ask it to reply with OK only.
3. Check the request time, model, final status, and usage in the [APIONE console](https://apione.ai/en/app).
4. After text succeeds, test reading files and making reviewed changes in a test project.

If the terminal works but the extension fails, check the user-level connection settings and the environment inherited by VS Code.

## Troubleshoot

For 401, check credentials and duplicate authentication. For 404, check the address and model ID. For tool errors, check model capabilities and request fields. Verify context limits, reasoning parameters, and experimental features individually.

***

[Integration directory](https://apione.ai/docs/en/guides/clients.md) · [Choose a model](https://apione.ai/docs/en/models/catalog.md) · [Troubleshooting](https://apione.ai/docs/en/support/errors.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.