You want Claude Code to behave like a normal local CLI tool, but you also want the API connection to be explicit, reproducible, and easy to verify across projects.
What you can do
Claude Code is a terminal-based coding agent. Once it is installed, you can run claude inside a project directory and ask it to read code, modify files, run commands, explain errors, or inspect a recent diff.
The useful part for builders is that Claude Code already reads standard environment variables before it sends requests. That means you can keep the native claude workflow while pointing the underlying API traffic at Ace Data Cloud:
- Base URL:
https://api.acedata.cloud - Auth variable:
ANTHROPIC_AUTH_TOKEN - Optional local project config:
.claude/settings.local.json - Optional context compaction trigger:
CLAUDE_CODE_AUTO_COMPACT_WINDOW="850000"
The rest of your workflow stays familiar: open a terminal, cd into a repository, run claude, and ask for help.
How it works
Claude Code uses the Anthropic Messages API protocol. The terminal app decides where to send requests by reading ANTHROPIC_BASE_URL and authenticates with ANTHROPIC_AUTH_TOKEN.
When ANTHROPIC_BASE_URL is set to https://api.acedata.cloud, Claude Code sends requests to Ace Data Cloud. Ace Data Cloud checks the API token, routes the request to an available Claude Code service channel, and records usage after the request completes.
No local proxy process is required. No wrapper CLI is required. You still run the official claude command; the only change is the API target and token.
Step 1: Install the Claude Code CLI
Claude Code supports macOS, Linux, Windows, and WSL. The native installer is the simplest path because it installs the claude command and handles updates.
On macOS, Linux, or WSL:
curl -fsSL https://claude.ai/install.sh | bash
On Windows PowerShell:
irm https://claude.ai/install.ps1 | iex
On Windows CMD:
curl -fsSL https://claude.ai/install.cmd -o install.cmd && install.cmd && del install.cmd
If you prefer npm and already have Node.js 18 or higher:
npm install -g @anthropic-ai/claude-code
Then reopen your terminal and check the command:
claude --version
If the shell says command not found, reopen the terminal again or inspect the PATH message printed by the installer.
Step 2: Configure it globally for your shell
If you want every project on your machine to use the same API route, put the configuration in your shell startup file: ~/.zshrc, ~/.bashrc, or ~/.bash_profile.
export ACEDATACLOUD_API_TOKEN="{token}"
export ANTHROPIC_BASE_URL="https://api.acedata.cloud"
export ANTHROPIC_AUTH_TOKEN="$ACEDATACLOUD_API_TOKEN"
export CLAUDE_CODE_AUTO_COMPACT_WINDOW="850000"
Replace {token} with your API token from the Ace Data Cloud console. The CLAUDE_CODE_AUTO_COMPACT_WINDOW value sets the automatic compression trigger window to about 850,000 tokens. It reserves room for tool results and final answers; it does not change the model context limit.
Reload the shell config:
source ~/.zshrc
Use the matching file name if you configured Bash instead of Zsh.
Step 3: Or configure only one repository
For team projects, I usually prefer project-local configuration with a personal ignored file. Create .claude/settings.local.json in the repository root:
{
"env": {
"ANTHROPIC_AUTH_TOKEN": "{token}",
"ANTHROPIC_BASE_URL": "https://api.acedata.cloud",
"CLAUDE_CODE_AUTO_COMPACT_WINDOW": "850000"
}
}
This only affects the current project. The same file is also read when the project is opened with the Claude Code VS Code extension.
Do not commit personal credentials. Add this file to .gitignore:
.claude/settings.local.json
If your shell already has an old ANTHROPIC_API_KEY, unset it in the same environment where you launch Claude Code or VS Code:
unset ANTHROPIC_API_KEY
The important detail is to actually unset it, not set it to an empty string. After changing this, restart Claude Code. For VS Code, reload the window.
Step 4: Start a session and verify the route
From a project directory:
cd /path/to/your/project
claude
A first prompt can be simple:
Explain the directory structure of this project
For a one-off task, pass the prompt directly:
claude "Help me check the recent git diff for possible bugs"
If you want Claude Code to print the result and exit, use -p:
claude -p "Summarize the purpose of README.md"
Inside the interactive Claude Code interface, run:
/status
You should see the auth source and base URL, including:
Auth token: ANTHROPIC_AUTH_TOKEN
Anthropic base URL: https://api.acedata.cloud
If the base URL is not https://api.acedata.cloud, the current terminal probably did not load the expected shell config, or a project-level config is overriding it.
Optional: choose model tiers explicitly
Claude Code can select models by task type, but the documented environment variables let you set defaults:
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-4-8"
export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-4-6"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-4-5-20251001"
export CLAUDE_CODE_SUBAGENT_MODEL="claude-sonnet-4-6"
Use these only if you know you want consistent model choices. Otherwise, the default Claude Code selection is a reasonable starting point.
A practical habit
Keep global config for personal machines and use .claude/settings.local.json when a repository needs a predictable setup. In both cases, verify with /status before doing serious work. That one check catches most misconfigured shells, stale login state, and accidental credential conflicts.
For the full Ace Data Cloud reference, see the Claude Code terminal setup guide: https://platform.acedata.cloud/documents/claude-code-terminal-integration
Top comments (0)