Skip to main content
Claude Code is Anthropic’s coding agent CLI. Out of the box it talks to Anthropic’s gateway; redirecting it at ByteSpike unlocks the rest of the model catalog (Claude, plus DeepSeek-Anthropic, plus Anthropic-via-Gemini translation, etc.) under one key.

Prerequisites

  • A ByteSpike account + a key bound to the claude-default group (or any group that includes Claude/DeepSeek-Anthropic). See Register.
  • Claude Code installed:
    npm install -g @anthropic-ai/claude-code
    # or
    brew install claude-code
    

Configure

Two environment variables. Add to your shell profile (~/.zshrc, ~/.bashrc, or ~/.config/fish/config.fish):
export ANTHROPIC_BASE_URL="https://llm.bytespike.ai"
export ANTHROPIC_API_KEY="sk-byts-..."
Reload the shell (exec $SHELL or open a new tab). That’s it — claude now sends every Messages-API call through ByteSpike.
Want it scoped to one project, not your whole shell? Drop a .envrc (with direnv) or a project-local script that exports the vars only inside the repo:
# .envrc
export ANTHROPIC_BASE_URL="https://llm.bytespike.ai"
export ANTHROPIC_API_KEY="sk-byts-..."

Verify

claude --version
Then start a session:
claude
In the running session, try a small task:
> what model are you?
You should see the model self-identify (e.g. “I’m Claude Sonnet 4.6 served via ByteSpike”). If you get an auth error, double-check ANTHROPIC_API_KEY; if you get 400 model_not_allowed, your key’s group doesn’t include the model Claude Code defaulted to — switch to a group that includes it or override with --model.

Switching models

Claude Code picks the right tool per command. Override per-session:
claude --model claude-opus-4-8    # use Opus for this session
Or per-tool inside the session:
> /model claude-haiku-4-5
Any model id from your claude-default group (or whatever group your key is bound to) works. See Models for the full catalog.

Common configs

Generate a separate key per project from Console → API keys with its own quota (USD lifetime cap) and rate_limit_* buckets. Wire each project’s .envrc to the right key. Spend stays attributable in /api/v1/me/usage by api_key_id.
Both work end-to-end through ByteSpike — no extra config. The gateway preserves tool_use blocks, cache_control markers, and thinking blocks (Opus / Sonnet 4.x) untouched.
Claude Code’s MCP servers (mcp__* tools) all run client-side — they don’t care which gateway sits between the CLI and the model. Just set the env vars and your existing MCP config keeps working.
Claude Code respects HTTPS_PROXY / NO_PROXY. Add llm.bytespike.ai to NO_PROXY if your proxy mangles SSE streams; otherwise set HTTPS_PROXY=https://proxy.corp:443 and proceed normally.

Troubleshooting

SymptomCauseFix
401 invalid x-api-keyWrong key value or key was revokedRe-copy from Console → API keys; rotate if needed
402 insufficient_balanceAccount out of credits or key hit its quotaTop up at Console → Billing; raise the key’s quota
403 permission_denied (model)Model not in the key’s routing groupSwitch key, or switch model with --model
503 api_errorThe key’s group has no capacity to serve this model right nowClick Test next to the model in Console → Models to confirm; switch group if it’s a mismatch
Mid-stream stall (SSE)Corporate proxy bufferingAdd llm.bytespike.ai to NO_PROXY
For the live response shape, see /v1/messages.

Next

Codex CLI

OpenAI’s coding CLI — same idea, OpenAI-side env vars.

Models

What Claude Code can actually call.

Authentication

Group binding, quota, rate limits.

DOSIA Agent mode

The agent integration that builds on top of Claude Code’s Messages shape.