# Use FreeLLMAPI with Claude Code

> Connect Claude Code to your own FreeLLMAPI. The address without /v1, the unified API key, a curl test and what does not work.

Web page: https://blitz.cloud/guides/freellmapi-claude-code/
Updated: 2026-11-30

FreeLLMAPI also speaks Anthropic's API format, so Claude Code can run on your own free provider keys. The answers then come from your providers' models, not from Claude, and depending on the model they are clearly weaker.

## 1. Install FreeLLMAPI

[Install FreeLLMAPI](https://dashboard.blitz.cloud/new?app=freellmapi&from=store) from the App Store, sign in with the `ADMIN_EMAIL` and `ADMIN_PASSWORD` from the app's settings and add at least one provider key on the Keys page. Copy the unified API key there too.

## 2. Test the address

Replace the address and the key with yours:

```bash
curl https://llm.lena.prod.page/v1/chat/completions \
  -H "Authorization: Bearer YOUR_UNIFIED_KEY" \
  -H "Content-Type: application/json" \
  -d '{"model":"auto","messages":[{"role":"user","content":"Hello"}]}'
```

`"model":"auto"` lets FreeLLMAPI choose.

## 3. Connect Claude Code

Claude Code takes the address without `/v1`:

```bash
export ANTHROPIC_BASE_URL=https://llm.lena.prod.page
export ANTHROPIC_AUTH_TOKEN=YOUR_UNIFIED_KEY
claude
```

The project also ships a command that does the setup and backs up your old configuration:

```bash
npx freellmapi setup-claude --url https://llm.lena.prod.page --api-key YOUR_UNIFIED_KEY
```

On the Keys page you choose which model answers for the `claude-opus`, `claude-sonnet` and `claude-haiku` names.

## When nothing comes back

- On the free plan the app sleeps after 30 minutes without a visit. A request from Claude Code does not wake it: open the address in your browser first, or make it a Pro app for 3 EUR a month.
- A `401` means the key is wrong. It has to be the unified API key, not a provider's key.
- When every quota is used up, no provider answers until they reset. The Analytics page shows it.

Your providers' terms apply here too. FreeLLMAPI is meant for your own use, not for passing on to others.
