Client setup · Catalog reviewed 2026-07-25

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.

Sources

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