<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:wght@400;500;600&family=Inter:wght@400;500;600;700&family=STIX+Two+Text:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Material+Symbols+Outlined:wght,FILL@400,0..1&display=swap" />
CLI & scripting

Claude Code

Anthropic's terminal coding agent via Messages route.

Claude Code talks to FreeTheAi through the Anthropic Messages format. Set the gateway env vars, run `claude`, and pick a Claude alias.

Base URLhttps://api.freetheai.xyz
API path/v1/messages
Recommended modelsbbl/gpt-5.5-mini
Messages Streaming Tool calling
Step by step

Connect Claude Code to FreeTheAi.

3 steps
  1. 1

    Export the gateway env vars

    Claude Code reads ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN. Point them at FreeTheAi.

    bash
    export ANTHROPIC_BASE_URL=https://api.freetheai.xyz
    export ANTHROPIC_AUTH_TOKEN=fta_PASTE_YOUR_FREETHEAI_KEY
  2. 2

    Optional: enable model discovery

    Claude Code can list models from the gateway when you flip on discovery.

    bash
    export CLAUDE_CODE_ENABLE_GATEWAY_MODEL_DISCOVERY=1
  3. 3

    Run claude and pick a model

    Start Claude Code, then use `/model` or `--model` to choose a FreeTheAi Claude alias.

    bash
    claude --model bbl/gpt-5.5-mini
Recommended aliases

Models that pair well with Claude Code.

  • bbl/gpt-5.5-mini
  • glm/glm-5.1
  • opc/deepseek-v4-flash-free

See the full live catalog at /models. Aliases are stable; pricing on the free tier stays $0.

Heads up

Common gotchas.

  • Claude Code's discovery can be restrictive. If discovery does not surface the catalog, pass a known FreeTheAi alias explicitly with `--model`.
  • Setting `ANTHROPIC_AUTH_TOKEN` disables Remote Control, MCP connectors, and `/schedule` tied to a claude.ai login. That is expected.
  • FreeTheAi's `/v1/messages` already supports `anthropic-beta` and `count_tokens`, so no extra config is needed on the gateway side.
Where to next

Keep building.