Claude Code
Set up Claude Code with Hyde Inference.
This guide covers the Claude Code CLI in your terminal. For using Claude in the Claude Desktop app, see the Claude Desktop guide.
Before you start
Install Claude Code if you don't have it yet. The official setup docs cover every platform. Quickest ways:
curl -fsSL https://claude.ai/install.sh | bashbrew install --cask claude-codewinget install Anthropic.ClaudeCodenpm install -g @anthropic-ai/claude-codeNative installs update themselves in the background. Verify with claude --version.
You also need a Hyde API key. Generate one in the dashboard's Keys tab, or open the setup link from your invite email. Treat the link like a password: don't forward it.
Setup
1. Set up an isolated profile
If you use Claude Code for anything else, this setup won't touch it. Everything goes in a separate profile. Add this alias to your shell profile (~/.zshrc or ~/.bashrc):
echo "alias claude-hyde='CLAUDE_CONFIG_DIR=~/.claude-hyde claude'" >> ~/.zshrcThen reload your shell:
source ~/.zshrcNow create the profile folder and settings file. Step 2 writes it for you.
The rest of this guide uses claude-hyde and ~/.claude-hyde/. Skipping this step? Substitute claude and ~/.claude/.
2. Configure the gateway
Get your key from the dashboard's Keys tab, then write the settings file with one command:
mkdir -p ~/.claude-hyde && cat > ~/.claude-hyde/settings.json <<'EOF'
{
"apiKeyHelper": "echo $HYDE_INFERENCE_API_KEY",
"env": {
"ANTHROPIC_BASE_URL": "https://inference.hyde.tech",
"CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": "1"
}
}
EOFThen set your key for this session:
export HYDE_INFERENCE_API_KEY="sk-your-key-here"If ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN are already exported in your shell, unset them first: unset ANTHROPIC_API_KEY ANTHROPIC_AUTH_TOKEN.
3. Start your session and verify
cd /path/to/your/project
claude-hydeInside the session, run /status. The base URL must read https://inference.hyde.tech, and the auth token should show apiKeyHelper. Claude Code may show the tier name (Haiku/Sonnet/Opus) instead of the Hyde model ID in confirmations. That is expected.
The key is sent as x-api-key, which is Claude Code's native scheme on this path. Discovery populates /model from the gateway.
Models
/model lists every model the gateway serves. The current catalog lives on the Models page. To pin a default, add "model": "<alias from the Models page>" at the top level of settings.json.
What each setting does
| Setting | What it does |
|---|---|
apiKeyHelper | A shell command Claude Code runs to obtain the key on every request. The key itself stays in your environment, out of the settings file and out of source control. |
env.ANTHROPIC_BASE_URL | Routes requests to the gateway (https://inference.hyde.tech) instead of api.anthropic.com. |
CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY | Keeps the /model picker in sync with the gateway's live catalog. |
If it breaks
401 / invalid key. Is the variable exported? Check it is set with echo "${HYDE_INFERENCE_API_KEY:0:10}…"; it prints the first characters only. If the key was revoked, generate a new one in the Keys tab and re-export.
Requests still go to Anthropic. A conflicting ANTHROPIC_API_KEY or ANTHROPIC_AUTH_TOKEN is set. See the warning in step 2.
Previous login keeps appearing. If you skipped the isolated profile, run /logout inside Claude Code to clear cached credentials first.
"model not found". Open /model. It lists live aliases from the gateway. Exact strings are on the Models page.