Hydedocs

Claude Code

Set up Claude Code with Hyde Inference.

This guide covers the Claude Code CLI in your terminal.

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 | bash
Tip

Native 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'" >> ~/.zshrc

Then reload your shell:

source ~/.zshrc

Now create the profile folder and settings file. Step 2 writes it for you.

Tip

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"
  }
}
EOF

Then set your key for this session:

export HYDE_INFERENCE_API_KEY="sk-your-key-here"
Heads-up

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-hyde

Inside the session, run /status. The base URL must read https://inference.hyde.tech, and the auth token should show apiKeyHelper.

Then open /model and pick a Hyde model before your first prompt. If you do not, Claude Code sends your first prompt to its own default model. The gateway does not have that model, so the request fails with 403 key not allowed to access model. In confirmations, Claude Code may show the model as Haiku, Sonnet, or Opus. That is normal.

Tip

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

SettingWhat it does
apiKeyHelperA 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_URLRoutes requests to the gateway (https://inference.hyde.tech) instead of api.anthropic.com.
CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERYKeeps 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}…", which 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.

"403 key not allowed to access model"

You are still on the default model that Claude Code picked for itself. The gateway does not have that model. Open /model, pick a Hyde model, and retry. To keep this choice, pin "model" in settings.json as shown above.

"model not found"

Open /model. It lists live aliases from the gateway. Exact strings are on the Models page.

Was this page helpful?