Claude Code
Claude Code should use the Anthropic Messages protocol against CoAIWork.
Configuration Values
| Item | Value |
|---|---|
| Base URL | https://coaiwork.com |
| Main route | /v1/messages |
| Default model | claude-opus-4-6 |
| Auth env var | ANTHROPIC_API_KEY |
| Configuration style | No separate config file; use environment variables |
Required values:
ANTHROPIC_BASE_URL=https://coaiwork.comANTHROPIC_API_KEY=<YOUR_TOKEN>
Warning
ANTHROPIC_API_KEY must be set as an environment variable. Do not hard-code the real token in scripts or shell history.
macOS
Install
npm install -g @anthropic-ai/claude-code
Configure
echo 'export ANTHROPIC_BASE_URL="https://coaiwork.com"' >> ~/.zshrc
echo 'export ANTHROPIC_API_KEY="<YOUR_TOKEN>"' >> ~/.zshrc
source ~/.zshrc
Verify
curl -s https://coaiwork.com/v1/models \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01"
Run
claude --model claude-opus-4-6
Linux
Install
npm install -g @anthropic-ai/claude-code
Configure
echo 'export ANTHROPIC_BASE_URL="https://coaiwork.com"' >> ~/.bashrc
echo 'export ANTHROPIC_API_KEY="<YOUR_TOKEN>"' >> ~/.bashrc
source ~/.bashrc
Validate a request
curl -s https://coaiwork.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "claude-opus-4-6",
"max_tokens": 64,
"messages": [{"role": "user", "content": "Reply with OK only."}]
}'
Run
claude --model claude-opus-4-6
Windows
Install
npm install -g @anthropic-ai/claude-code
Configure
[Environment]::SetEnvironmentVariable("ANTHROPIC_BASE_URL", "https://coaiwork.com", "User")
[Environment]::SetEnvironmentVariable("ANTHROPIC_API_KEY", "<YOUR_TOKEN>", "User")
Open a new terminal, then run:
claude --model claude-opus-4-6