Skip to main content

Connecting in Claude Code

  1. Open or create the file ~/.claude/settings.json, where ~ is your home directory

  2. Fill it with the contents below

    ~/.claude/settings.json
    {
    "env": {
    "ANTHROPIC_BASE_URL": "<YOUR_URL>",
    "ANTHROPIC_API_KEY": "<YOUR_API_KEY>",
    "CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY": 1
    }
    }
    • Replace <YOUR_API_KEY> with the API key issued to you
      • If you see these instructions but do not have an API key, contact your organization's administrator
    • Replace <YOUR_URL> with the OpenAI-compatible URL issued to you
      • If you see these instructions but do not have an OpenAI-compatible URL, contact your organization's administrator
    • Optional: add the line "CLAUDE_CODE_AUTO_COMPACT_WINDOW": X to the env block — it enables automatic compaction when the context fills up to X tokens. Replace X with the value you need
  3. Start Claude Code. When asked Do you want to use this API key?, answer Yes

    • If you see the error API Error: 401 Unknown API key: ..., contact your organization's administrator to reissue your API key
  4. To choose a model, use /model. Explyt supports only the models marked From gateway

    • auto – maximum availability (uptime) and high quality
    • Anthropic/opus-5 – Anthropic model with high-quality answers
    • OpenAI/gpt-5.6-sol – general-purpose OpenAI model

If you run into problems while connecting, try typing /logout in the chat and start over.

For errors, see Error messages.