INSTALL & CONFIGURE

How to install and configure FreeLLMAPI

Install FreeLLMAPI with Docker or the desktop app, add provider keys, test its OpenAI-compatible API, and connect Claude Code, Codex CLI and more.

QUICK ANSWER

What is FreeLLMAPI?

FreeLLMAPI is an open-source, self-hosted gateway that combines API access from multiple free-tier LLM providers behind one endpoint. Install it locally, add your own provider keys, create a unified key, and point an OpenAI-compatible client at the gateway.

This is a source-based setup guide, not a claim that every provider or operating-system path was tested by this directory.

Before you install FreeLLMAPI

  • A computer that can run Docker, or a supported FreeLLMAPI desktop build.
  • At least one account and API key from a supported LLM provider. FreeLLMAPI does not create those provider accounts for you.
  • A local, single-user test workload. The project describes itself as intended for personal experimentation, not as a managed multi-tenant service.

Choose an install method

MethodBest forCheck first
Desktop appWindows, macOS or Linux users who want the shortest path to a local dashboard.Download only from the official Releases page and verify the current asset for your operating system and CPU.
Reviewed install scriptmacOS or Linux users who have Docker and want the official automated setup.Download and inspect the script before running it; it creates the install directory, encryption key and container.
Docker ComposeUsers who want to understand and control the configuration, data volume and updates.Requires Docker, Docker Compose and OpenSSL. Keep the generated encryption key with your backups.

Option 1: inspect and run the official install script

The official documentation offers a one-line installer. A safer reviewable workflow is to download it, read it, and then execute the local copy. Re-running the official script is documented to preserve the existing .env file and encryption key.

After the container starts, open http://localhost:3001. If you are on Windows and do not want to use WSL or Docker from a shell, use the current desktop installer from the official Releases page.

Download the installer

curl -fsSL https://freellmapi.co/install.sh -o install.sh

Inspect it before execution

less install.sh

Run the reviewed local copy

bash install.sh

Option 2: install with Docker Compose

Docker Compose is the clearest path when you want explicit control over the configuration. The commands below follow the official Docker guide: clone the repository, generate a 32-byte encryption key, write the local environment file, and start the service on port 3001.

Do not publish the encryption key or commit the .env file. The key protects provider credentials stored by the local gateway.

Clone the official repository

git clone https://github.com/tashfeenahmed/freellmapi.git
cd freellmapi

Create the local encryption key

ENCRYPTION_KEY="$(openssl rand -hex 32)"
printf "ENCRYPTION_KEY=%s\nPORT=3001\n" "$ENCRYPTION_KEY" > .env

Start the gateway

docker compose up -d
docker compose ps

Add provider keys and create one unified key

Open the local dashboard at http://localhost:3001 and add the API keys you obtained from supported providers. FreeLLMAPI aggregates those provider accounts; installing the software alone does not create free provider quota.

After at least one provider key is accepted, copy the unified FreeLLMAPI key shown by the dashboard. Applications use this unified key when calling your local gateway. Keep provider keys and the unified key out of screenshots, shell history and source control.

Verify the OpenAI-compatible endpoint

List the models served by your own gateway first. Then send a small chat-completions request with the auto route. Replace the placeholder with the unified key from your dashboard; do not paste a real secret into public documentation or a shared terminal transcript.

List available models

curl http://localhost:3001/v1/models \
  -H "Authorization: Bearer <unified-key>"

Send a test request

curl http://localhost:3001/v1/chat/completions \
  -H "Authorization: Bearer <unified-key>" \
  -H "Content-Type: application/json" \
  -d '{"model":"auto","messages":[{"role":"user","content":"Reply with: gateway ready"}]}'

Connect Claude Code, Codex CLI or another agent

FreeLLMAPI provides setup commands for common coding agents. Claude Code uses the server root because it appends its own Anthropic Messages path. Codex CLI and other OpenAI-compatible agents use the /v1 base URL internally. Use --dry-run first if you want to inspect a proposed configuration change.

The setup tools read the live catalog from your gateway, merge the new provider into the client configuration and create a backup where supported. Review the resulting file before making the new route your default.

Claude Code

npx freellmapi setup-claude --url http://localhost:3001 --api-key <unified-key> --dry-run

Codex CLI

npx freellmapi setup-codex --url http://localhost:3001 --api-key <unified-key> --dry-run

OpenCode

npx freellmapi setup-opencode --url http://localhost:3001 --api-key <unified-key> --dry-run

Update and troubleshoot the gateway

Start with container state and logs. A dashboard that does not load usually means the container did not start, port 3001 is already in use, or Docker is unavailable. A 401 response usually means the client is missing the unified key or is using the wrong type of token.

A 429 response still reflects provider limits. The router can fail over while another configured provider or key remains available, but it cannot create unlimited quota. If you expose the service beyond localhost, follow the official LAN guidance and treat the gateway as a sensitive credential-bearing service.

Read container status and logs

docker compose ps
docker compose logs -f freellmapi

Update the Docker image

docker compose pull
docker compose up -d

FAQ

FreeLLMAPI installation questions

Is FreeLLMAPI completely free?

The core router is open-source software. Your actual model access comes from the quotas and terms of the provider accounts you add. Optional catalog services and provider overages can have separate costs.

Do I still need API keys from LLM providers?

Yes. FreeLLMAPI combines keys and free tiers that you obtain from supported providers. The local unified key is a credential for your gateway, not a replacement for the upstream provider accounts.

Does FreeLLMAPI provide unlimited LLM usage?

No. Routing and failover can use several free tiers more efficiently, but every upstream account still has rate limits, quotas and acceptable-use rules.

Can I use FreeLLMAPI for a team or production service?

Treat that as a separate architecture decision. The project describes the gateway as local-first, single-user and intended for personal experimentation; it is not a managed multi-tenant service with an SLA.

What base URL should I use?

OpenAI-compatible clients generally use http://localhost:3001/v1. Claude Code uses the server root, http://localhost:3001, because its client appends the Anthropic Messages path.

Official sources checked

Commands and product boundaries were reviewed against the official project sources below. Fast-moving software can change after the review date.

By Open Source Alternatives · Page updated