OmwAIOmwAI
API ReferenceProgramming ToolsAI Applications

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.

Prerequisites

Before you begin, make sure you have:

  1. Node.js installed (v18+ recommended)
  2. Claude Code installed globally:
npm install -g @anthropic-ai/claude-code
  1. Created a CC-dedicated API token in the OmwAI dashboard (it's recommended to select the cc token group for easier management and rate limiting)
  2. 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:

SystemPath
Windows%userprofile%\.claude\
macOS~/.claude/
Linux~/.claude/

The main configuration file in this directory:

FilePurpose
settings.jsonCore config — relay address and API Key

If settings.json doesn'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:

FieldDescription
ANTHROPIC_BASE_URLYour OmwAI site address (do not append /v1)
ANTHROPIC_AUTH_TOKENAPI Key copied from OmwAI dashboard (starts with sk-)
CLAUDE_CODE_ATTRIBUTION_HEADERSet to "0" to disable the attribution header
CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFICSet to "1" to disable non-essential network requests
CLAUDE_CODE_DISABLE_TERMINAL_TITLESet 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:

claude

If 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?