Claude Code

Claude Code is a powerful coding assistant launched by Anthropic. By default, you must log in to a Claude account to use it, which requires purchasing the official monthly subscription. However, Claude Code itself supports direct API calls.

Installation Steps

  1. Installation Command:

    npm install -g @anthropic-ai/claude-code
    
  2. Configure Environment Variables:

    To enable the Claude Code -> XAI Gateway -> Anthropic API data flow, you must configure the following environment variables and provide your XAI API key.

    export ANTHROPIC_API_KEY=sk-Xvs...
    export ANTHROPIC_BASE_URL=api.xaixapi.com
    claude