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.
Everything about running it here on one page: FreeLLMAPI hosting.
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 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:
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:
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:
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
401means 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.
Read next
FreeLLMAPI hosting for your own free provider keys
FreeLLMAPI hosting without a server of your own. Install it in one click, get an HTTPS address for /v1 and a generated admin password. Free to try, servers in the EU.
FreeLLMAPI hosting in the EU
Your own FreeLLMAPI, an alternative to OpenRouter, one click, servers in the EU. Always online on Pro, your own domain, nightly backups. Try it free.
Keep your bot, API or web app online day and night, from 3 EUR a month
A Pro app keeps one bot, API or web app online from 3 EUR a month, Pro all your apps for 9 EUR, in the EU with your own domains. Free to start, no card.
Put your first app online today.
Start on the free plan, no credit card. Move to Pro when an app has to stay online.
Put your app online