Infux
Back to Home
Claude Code

Integration Guide

Using Infux with Claude Code

Step-by-step setup for using Infux with Claude Code

Important Note

Claude Code uses the Anthropic Messages API — not the OpenAI format. It connects via ANTHROPIC_BASE_URL, not OPENAI_BASE_URL. Infux's gateway supports the Anthropic Messages format at /v1/messages, so Claude Code works natively.

Prerequisites

  • Claude Code installed (npm install -g @anthropic-ai/claude-code)
  • An Infux API key (get one at dashboard)

Option 1: Environment Variables

Add to your shell profile (~/.zshrc or ~/.bashrc):

~/.zshrc
export ANTHROPIC_BASE_URL="https://api.infux.dev/v1"
export ANTHROPIC_API_KEY="sk-infux-your_key_here"

Then reload: source ~/.zshrc

Option 2: Claude Code Settings

Set the environment variables in Claude Code's settings file:

~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://api.infux.dev/v1",
    "ANTHROPIC_API_KEY": "sk-infux-your_key_here"
  }
}

Recommended Models

Override the default model with ANTHROPIC_MODEL:

~/.zshrc
export ANTHROPIC_MODEL="kimi-k2.5"  # or any Infux model ID
Use CaseModelWhy
Fast editsdeepseek-v3-0324Fastest TTFT, great code quality
Complex refactorskimi-k2.5Strong SWE-bench, large context
Hard reasoningkimi-k2.5-thinkingBest SWE-bench score (56.5%)

Verify It Works

terminal
claude "Write a hello world in Python"

You should see the response streaming in real-time via the Infux gateway.

Troubleshooting

Still connecting to Anthropic

Make sure you set ANTHROPIC_BASE_URL (not OPENAI_BASE_URL). Claude Code only reads Anthropic environment variables.

API key rejected

Use ANTHROPIC_API_KEY (not OPENAI_API_KEY). Verify your key starts with sk-infux-.

Model not found

Set ANTHROPIC_MODEL to an Infux model ID. Check available models at /models.