Claude Code
Claude Code CLI Setup Guide — Quickly connect via the OmwAI relay service using settings.json environment variable configuration.
Project Overview
Claude Code is a terminal-based AI coding assistant by Anthropic. Similar to Codex CLI, it allows you to write, edit, and run code directly in the terminal through natural language instructions.
- Official repository: https://github.com/anthropics/claude-code
Prerequisites
Before you begin, make sure you have:
- Node.js installed (v18+ recommended)
- Claude Code installed globally:
npm install -g @anthropic-ai/claude-code- Created a CC-dedicated API token in the OmwAI dashboard (it's recommended to select the
cctoken group for easier management and rate limiting) - Your OmwAI site address ready (e.g.
https://api.example.com)
Configuration Directory
Claude Code stores its configuration file in the .claude folder under your user home directory:
| System | Path |
|---|---|
| Windows | %userprofile%\.claude\ |
| macOS | ~/.claude/ |
| Linux | ~/.claude/ |
The main configuration file in this directory:
| File | Purpose |
|---|---|
settings.json | Core config — relay address and API Key |
If
settings.jsondoesn't exist, create it manually.
Configure settings.json
Create or edit settings.json with the following content:
{
"env": {
"ANTHROPIC_BASE_URL": "https://your-site-address",
"ANTHROPIC_AUTH_TOKEN": "sk-your-api-token",
"CLAUDE_CODE_ATTRIBUTION_HEADER": "0",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
"CLAUDE_CODE_DISABLE_TERMINAL_TITLE": "1"
}
}Configuration reference:
| Field | Description |
|---|---|
ANTHROPIC_BASE_URL | Your OmwAI site address (do not append /v1) |
ANTHROPIC_AUTH_TOKEN | API Key copied from OmwAI dashboard (starts with sk-) |
CLAUDE_CODE_ATTRIBUTION_HEADER | Set to "0" to disable the attribution header |
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC | Set to "1" to disable non-essential network requests |
CLAUDE_CODE_DISABLE_TERMINAL_TITLE | Set to "1" to prevent terminal title modification |
Configure API Key
Replace "sk-your-api-token" in ANTHROPIC_AUTH_TOKEN with the token value you created in the OmwAI dashboard.
It's recommended to create a dedicated group token for Claude Code, making it easier to monitor usage and apply rate limits from the OmwAI dashboard.
Verify the Configuration
After completing the configuration, run the following command in your terminal:
claudeIf Claude Code starts successfully with a chat interface and responds to your messages, the configuration is complete.
Troubleshooting
Connection Failed
Check that ANTHROPIC_BASE_URL is correct — make sure not to append /v1 to the site address.
Authentication Failed
Confirm the API Key in ANTHROPIC_AUTH_TOKEN is valid. You can create a new token in the OmwAI dashboard and try again.
Login Required
If you are still prompted to log in to Anthropic services after configuration, verify that the API token group is set correctly, and ensure you are using a cc-grouped token.
How is this guide?