Skip to content

Harness Integration

Integrate X-Serve with coding agents. The supported harnesses are shown below.

Installation

curl -fsSL https://claude.ai/install.sh | bash
irm https://claude.ai/install.ps1 | iex
curl -fsSL https://chatgpt.com/codex/install.sh | sh
irm https://chatgpt.com/codex/install.ps1 | iex
curl -fsSL https://pi.dev/install.sh | sh
irm https://pi.dev/install.ps1 | iex
curl -fsSL https://hermes-agent.nousresearch.com/install.sh | bash -s -- --skip-browser --skip-setup
& ([scriptblock]::Create((irm https://hermes-agent.nousresearch.com/install.ps1))) -SkipSetup

Usage

Paste the setup script into your terminal with your key in place of the placeholder.

export NETPREME_API_KEY="<NETPREME_API_KEY>"

export ANTHROPIC_AUTH_TOKEN="$NETPREME_API_KEY"
export ANTHROPIC_BASE_URL=https://api.netpreme.com
export ANTHROPIC_MODEL=moonshotai/Kimi-K3
export ANTHROPIC_DEFAULT_HAIKU_MODEL=moonshotai/Kimi-K3
export CLAUDE_CODE_MAX_CONTEXT_TOKENS=512000
export CLAUDE_CODE_MAX_OUTPUT_TOKENS=128000
export CLAUDE_CODE_AUTO_COMPACT_WINDOW=409600

claude
export NETPREME_API_KEY="<NETPREME_API_KEY>"

codex -c model_providers.netpreme.name=netpreme \
  -c model_providers.netpreme.base_url=https://api.netpreme.com/v1 \
  -c model_providers.netpreme.env_key=NETPREME_API_KEY \
  -c model_providers.netpreme.wire_api=responses \
  -c model_provider=netpreme \
  -c model_context_window=512000 \
  -c model_max_output_tokens=128000 \
  -c model_auto_compact_token_limit=409600 \
  -c model=moonshotai/Kimi-K3
export NETPREME_API_KEY="<NETPREME_API_KEY>"

mkdir -p ~/.pi/agent
cat > ~/.pi/agent/models.json <<EOF
{
  "providers": {
    "netpreme": {
      "baseUrl": "https://api.netpreme.com/v1",
      "api": "openai-completions",
      "apiKey": "$NETPREME_API_KEY",
      "models": [
        {
          "id": "moonshotai/Kimi-K3",
          "contextWindow": 512000,
          "maxTokens": 128000
        }
      ]
    }
  }
}
EOF
cat > ~/.pi/agent/settings.json <<'EOFS'
{
  "compaction": {
    "reserveTokens": 102400
  }
}
EOFS

pi --provider netpreme --model moonshotai/Kimi-K3
export NETPREME_API_KEY="<NETPREME_API_KEY>"

export PATH="$HOME/.local/bin:$PATH"

hermes config set model.api_key "$NETPREME_API_KEY"
hermes config set model.provider custom
hermes config set model.base_url https://api.netpreme.com/v1
hermes config set model.default moonshotai/Kimi-K3
hermes config set model.context_length 512000
hermes config set model.max_tokens 128000
hermes config set compression.threshold 0.8

hermes

X-Serve Connect

X-Serve Connect (beta) launches Claude Code sessions from VS Code against X-Serve, with no shell setup.

  1. On the Console's Coding Agents page, switch the step 2 client picker to VS Code (Claude Code is the supported agent) and make sure Claude Code is installed locally. Step 4 then offers Download for VS Code.
  2. In VS Code, open the Extensions view, choose ...Install from VSIX..., and pick the downloaded netpreme-connect-vscode.vsix. Reload if asked.

Then open the X-Serve icon in the Activity Bar, select Connect Claude Code, paste an X-Serve API key, and choose a model.

See X-Serve Connect for the full walkthrough, screenshots, and an FAQ.