The free tier is closed for most users.Thank you for every chat along the way. Paid models work as before, and your account, API keys, and balance stay as they are.Read why

Claude Code API: Run It on FreeTheAI Models

Claude Code can run on FreeTheAI's Anthropic-compatible Messages endpoint. Point ANTHROPIC_BASE_URL at FreeTheAI and choose which model fills each Claude slot.

WebsiteAPI reference

Steps

  1. Add the settings

    Put this in ~/.claude/settings.json (on Windows, %USERPROFILE%\.claude\settings.json). Never put your key in a project's shared .claude/settings.json.

    json
    {
      "env": {
        "ANTHROPIC_BASE_URL": "https://api.freetheai.org",
        "ANTHROPIC_AUTH_TOKEN": "ftai_your_key_here",
        "ANTHROPIC_MODEL": "glm-5.3",
        "ANTHROPIC_DEFAULT_OPUS_MODEL": "glm-5.3",
        "ANTHROPIC_DEFAULT_SONNET_MODEL": "glm-5.3",
        "ANTHROPIC_DEFAULT_HAIKU_MODEL": "glm-5.3-flash",
        "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1"
      }
    }
  2. Start Claude Code

    Run claude, then /status. The Anthropic base URL line should show https://api.freetheai.org.

  3. Add funds

    Paid models bill your wallet. Add funds at freetheai.org/dashboard/wallet and follow a provider of the model on its page, or requests are refused.

How this guide was checked: Tested end to end with Claude Code 2.1.284 on 2026-09-29 (reads a file with its Read tool on three FreeTheAI models).

Tips

  • Claude Code warns that FreeTheAI models are not in its model catalog. That is expected; it still works and assumes a 200K context.
  • The HAIKU model runs background tasks such as titles, so a fast model fits there.
  • If a model answers 400 about unknown fields, add "CLAUDE_CODE_DISABLE_EXPERIMENTAL_BETAS": "1".

Troubleshooting

Is using Claude Code with FreeTheAI official?

No. Claude Code supports custom gateways through ANTHROPIC_BASE_URL, but Anthropic does not support non-Claude models behind one, so some Claude-only features may not work.

Does Claude Code tool use work on FreeTheAI?

Yes. File reading and other tools were tested on 2026-09-29 with glm-5.3 and kimi-k3.1-pro.

Does it use my Claude subscription?

No. While ANTHROPIC_AUTH_TOKEN is set, requests go to FreeTheAI with your FreeTheAI key and do not count against a claude.ai plan.

Common errors

  • 401: the key is wrong or incomplete. Paste the whole key.
  • 403: follow a provider of the model, or confirm your email.
  • 404: the model ID or URL is wrong.
  • 429: daily limit reached, or too many requests at once.

More guides: Coding tools

All setup guides

Did this guide work for you?