Prerequisites
- A ByteSpike account + a key bound to the
claude-defaultgroup (or any group that includes Claude/DeepSeek-Anthropic). See Register. - Claude Code installed:
Configure
Two environment variables. Add to your shell profile (~/.zshrc,
~/.bashrc, or ~/.config/fish/config.fish):
exec $SHELL or open a new tab). That’s it —
claude now sends every Messages-API call through ByteSpike.
Verify
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-default group (or whatever group
your key is bound to) works. See Models for the full
catalog.
Common configs
One key per project
One key per project
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.Streaming + tool use
Streaming + tool use
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.MCP server compatibility
MCP server compatibility
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.Behind a corporate proxy
Behind a corporate proxy
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
| Symptom | Cause | Fix |
|---|---|---|
401 invalid x-api-key | Wrong key value or key was revoked | Re-copy from Console → API keys; rotate if needed |
402 insufficient_balance | Account out of credits or key hit its quota | Top up at Console → Billing; raise the key’s quota |
403 permission_denied (model) | Model not in the key’s routing group | Switch key, or switch model with --model |
503 api_error | The key’s group has no capacity to serve this model right now | Click Test next to the model in Console → Models to confirm; switch group if it’s a mismatch |
| Mid-stream stall (SSE) | Corporate proxy buffering | Add llm.bytespike.ai to NO_PROXY |
/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.