Get started/Installation

Installation

Set up Claude Code with DirtCheapAI in the safest and fastest way.

Before you start

You need:

  • A DirtCheapAI account
  • An active API key that starts with key_
  • Available credit or an active package on that key
  • Node.js 18 or newer for Claude Code

Install Claude Code

bash
npm install -g @anthropic-ai/claude-code
claude --version

Recommended install

Linux / macOS

bash
curl -fsSL https://dirtcheapai.com/install.sh | bash -s -- 'key_xxx'

Windows (PowerShell)

powershell
& ([scriptblock]::Create((irm "https://dirtcheapai.com/install.ps1"))) 'key_xxx'

What the install script does

  • Writes ANTHROPIC_BASE_URL
  • Writes ANTHROPIC_AUTH_TOKEN
  • Sets default Claude model mappings in ~/.claude/settings.json
  • Turns off the Anthropic login prompt

Important validation note

The install script should only be used with a real purchased key from your dashboard. The key must be active and funded. Do not use placeholder values.

Manual setup

If you prefer manual setup, create or update ~/.claude/settings.json:

json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://dirtcheapai.com/api/v1",
    "ANTHROPIC_AUTH_TOKEN": "key_xxx",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-4.6",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-4.6",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-4.5"
  },
  "disableLoginPrompt": true
}