Client setup · Catalog reviewed 2026-08-22

Claude Code with a free LLM API

The configuration Claude Code needs, generated from the catalog, plus the free tiers that actually work with it.

What Claude Code needs

Claude Code speaks the Anthropic Messages API, while nearly every free tier in this catalog speaks the OpenAI chat completions API.

  1. ANTHROPIC_BASE_URL has to point at an endpoint that accepts Anthropic-format requests. Claude Code appends its own API path, so the value is a gateway root and not a /v1 suffix.
  2. ANTHROPIC_AUTH_TOKEN holds the key, read from the environment at start-up.
  3. The model you name has to exist on that endpoint. A wrong model id comes back as a 404 from the provider, not as a Claude Code error.
  4. That protocol mismatch, not the key, is what usually breaks a free Claude Code setup. Either put a translating router in front of an OpenAI-compatible free tier, or use a gateway that already speaks Anthropic.

The file this produces

Running npx free-llm-api setup claude-code writes run-claude-code.sh. It is generated from the catalog, so the base URL and model id are the ones the provider documents rather than ones you have to look up. Here it is filled in for GroqCloud:

#!/usr/bin/env sh
set -eu

: "${GROQ_API_KEY:?Set GROQ_API_KEY before running Claude Code}"
ANTHROPIC_BASE_URL='https://api.groq.com/openai/v1' \
ANTHROPIC_AUTH_TOKEN="$GROQ_API_KEY" \
exec claude "$@"

Nothing in that file is a key. The value is read from GROQ_API_KEY at run time, which is the one habit that keeps a credential out of a repository by construction.

Which free tiers fit Claude Code

Only 1 entry in this catalog is not OpenAI-compatible, so there is no table of drop-in free tiers for Claude Code. The realistic routes are a local translating router holding your own provider keys, or a gateway that already answers in the Anthropic format.

What to expect on a free tier

Agentic sessions burn a daily quota far faster than chat does, because every tool call is another long prompt. A 429 tells you that one request was limited and nothing about the quota left, unless the provider returns a reset header.

Before blaming the client, check the key itself: the browser checker separates a rejected credential from a rate limit from an endpoint that is simply down, and each of those has a different fix.

What it costs once the free tier ends

A free key is one way to run Claude Code; paying Anthropic for its own models is the other, and what that costs is not something this catalog tracks. Reported Anthropic pricing, quoted whole from the sentence it was published in — out of the figures a sibling project keeps, where every number travels with its own sentence:

PriceThe sentence it was published inWrite-up
$1.25 / $4.25 per million Meta priced Muse Spark 1.1 at $1.25 per million input and $4.25 per million output, roughly 75% and 83% below Anthropic's Opus, and the tradeoff is visible in the benchmarks, since it leads on MCP Atlas and JobBench while trailing on SWE-Bench Pro and DeepSWE 1.1. 1.6 Billion Free Tokens Is a Compression Ratio, Not a Strategy

Paying Anthropic is one option and the model behind it is another. Say which price you came for — one field, and what gets asked for is what gets chased next.

Sources

Provider figures shown here come from each provider’s own documentation, reviewed on 2026-08-22. The methodology covers what is recorded and what is deliberately left blank.