Claude Code with ARK
Point Claude Code at ARK's Anthropic-compatible API and run its agent loop on open models. We checked it end to end on ARK Cloud, tool calls included, with Claude Code 2.1.206 in October 2026.
Claude Code: Anthropic's agentic coding tool for the terminal, with extensions for VS Code and JetBrains IDEs.
Before you start
You need an ARK API key: sign in to ARK Cloud and copy it from the dashboard, or use a key from your own ARK deployment and its base URL. The setup below gives each of Claude Code's model tiers an ARK Cloud model: arklabsai/Qwen3.5-122B-A10B for the hardest tasks, arklabsai/Qwen3.6-35B-A3B for everyday work and arklabsai/Qwen3.5-4B for background tasks. All three call tools; the 122B and the 35B read up to 256K tokens, the 4B up to 128K.
1. Install
curl -fsSL https://claude.ai/install.sh | bash2. Connect it to ARK
Claude Code reads gateway settings from the env block of ~/.claude/settings.json. Send your ARK key as a bearer token and map each of Claude Code's four model tiers to an ARK model:
{
"env": {
"ANTHROPIC_BASE_URL": "https://api.ark-labs.cloud/api/anthropic",
"ANTHROPIC_AUTH_TOKEN": "your-ark-api-key",
"ANTHROPIC_DEFAULT_HAIKU_MODEL": "arklabsai/Qwen3.5-4B",
"ANTHROPIC_DEFAULT_SONNET_MODEL": "arklabsai/Qwen3.6-35B-A3B",
"ANTHROPIC_DEFAULT_OPUS_MODEL": "arklabsai/Qwen3.5-122B-A10B",
"ANTHROPIC_DEFAULT_FABLE_MODEL": "arklabsai/Qwen3.5-122B-A10B"
}
}Opus and Fable go to Qwen3.5-122B-A10B, Sonnet to Qwen3.6-35B-A3B and Haiku to Qwen3.5-4B. Switch tiers with /model.
Run claude in your project and check /status: the Anthropic base URL line shows ARK. In VS Code, put the same variables in claudeCode.environmentVariables in your user settings (Preferences: Open User Settings (JSON)); the JetBrains plugin runs the claude command and uses ~/.claude/settings.json.
Good to know
- Use
ANTHROPIC_AUTH_TOKEN, notANTHROPIC_API_KEY: ARK reads the key from theAuthorization: Bearerheader, andANTHROPIC_API_KEYsends it asx-api-key. ANTHROPIC_DEFAULT_HAIKU_MODELalso sends Claude Code's background tasks, such as session titles, to Qwen3.5-4B.- Claude Code assumes 200K tokens of context for model names it does not know. That is below the 256K of the 122B and the 35B, so long sessions on them are compacted somewhat early, and above the 128K of Qwen3.5-4B, so a long session on the Haiku tier can outgrow it before compaction starts.
- Do not put the key in a project's
.claude/settings.json: that file is committed with the project. - Anthropic does not support Claude Code with models other than Claude, through ARK or any other gateway.
- Code completion while you type needs a fill-in-the-middle endpoint, which ARK does not serve: use ARK for chat and agent work.
- Thinking works with tools: when the agent turns thinking on, the Qwen models think before they call a tool (see Reasoning).
- These tools send the whole conversation on every turn. ARK's prompt cache speeds up the repeated part of each prompt; every prompt token is still billed.
Next
Read about tool calling and limits and capacity on ARK, or browse other integrations.
Configuration keys follow Claude Code's official documentation as of November 2026. If the tool has changed since, its docs take precedence.