FIM Gate Docs
Integrations

Claude Code

Route Claude Code requests to FIM Gate via environment variables.

Claude Code is Anthropic's official terminal coding assistant. It decides where to send requests based on two environment variables, ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN — simply point them at FIM Gate.

Setup

  1. Install Claude Code:

    npm install -g @anthropic-ai/claude-code
  2. Edit the user-level settings file ~/.claude/settings.json (create it if it doesn't exist) and add the following to the env field:

    {
      "env": {
        "ANTHROPIC_BASE_URL": "https://api.gate.fim.ai",
        "ANTHROPIC_AUTH_TOKEN": "$FIM_API_KEY",
        "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1",
        "CLAUDE_CODE_ATTRIBUTION_HEADER": "0"
      }
    }

    Replace $FIM_API_KEY with the key you created in the Console.

  3. Launch and use it as usual:

    # Interactive session
    claude
    
    # One-off question
    claude "Explain the directory structure of this project"

FAQ

What if I get an invalid beta flag error?

This happens when Claude Code sends experimental beta flags. Check that your configuration includes "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1", add it if missing, then restart claude.

On this page