Models → Pricing → Docs → Blog → Changelog → Contact → Status →
Get started freeLog in

LibreChat Custom Endpoint Setup (librechat.yaml)

LibreChat adds OpenAI-compatible services through a custom endpoint in librechat.yaml. This is a field-by-field reference for a FreeModel endpoint, plus the Docker step most people miss.

LibreChat is an open-source chat interface you host yourself. Besides its built-in providers, it lets you add any OpenAI-compatible service as a custom endpoint in a YAML file. That is how you connect FreeModel: one block in librechat.yaml, one line in .env.

The block

# librechat.yaml
version: 1.2.1   # use the version from your LibreChat release's example file
cache: true

endpoints:
  custom:
    - name: "FreeModel"
      apiKey: "${FREEMODEL_API_KEY}"
      baseURL: "https://freemodel.in/v1"
      models:
        default: ["gpt-6-luna", "glm-5.3-flash"]
        fetch: false
      titleConvo: true
      titleModel: "gpt-6-luna"
      modelDisplayLabel: "FreeModel"

And in the .env file next to it:

FREEMODEL_API_KEY=fm_your_key_here

If your librechat.yaml already has an endpoints: section, add the FreeModel item to the existing custom: list instead of creating a second one.

Field reference

FieldFreeModel valueNotes
name"FreeModel"Label shown in the endpoint menu
apiKey"${FREEMODEL_API_KEY}"Reads the key from .env, so the YAML holds no secret
baseURL"https://freemodel.in/v1"Ends at /v1; LibreChat adds the endpoint path
models.defaultlist of idsExact ids from GET /v1/models
models.fetchfalse or truetrue loads the full catalogue from /v1/models
titleConvotrueAsks a model to name each new conversation
titleModela free modelThe model used for those titles
modelDisplayLabel"FreeModel"Name shown above replies

fetch or a fixed list?

With fetch: true, users see the whole catalogue. On a free key that includes premium models the key cannot use: Claude models other than Haiku 5.5, GPT-6 Astra, Gemini and others answer 403 upgrade_required. A fixed default list of the models your plan covers avoids that confusion. On a paid plan every model is available, so fetching is fine.

The free models are GPT-6.2 Astra, GPT-6 Luna, Grok 4.6, Grok 4.7, Claude Haiku 5.5, GLM-5.3 Flash, Qwen 3.8 Omni Flash and DeepSeek V4.1 Flash 1017. Ids must be exact; FreeModel does not map names like gpt-4o to another model. Capabilities and context sizes are on the models page.

Titles cost tokens

titleConvo is a separate request for every new conversation. It is small, but it is billed like any other request: input and output tokens both count. Pointing titleModel at a free model such as GPT-6 Luna keeps it cheap. Set titleConvo: false to turn it off.

Docker: make sure the file is mounted

This is the step that is most often missed. In the standard Docker Compose setup, LibreChat only sees librechat.yaml if it is mounted into the API container. LibreChat's own documentation recommends a docker-compose.override.yml for this, so you do not edit the main compose file:

# docker-compose.override.yml
services:
  api:
    volumes:
      - type: bind
        source: ./librechat.yaml
        target: /app/librechat.yaml

Then restart:

docker compose down
docker compose up -d

LibreChat reads the YAML at start-up, so every change needs a restart. Check the API container logs afterwards; config errors, such as a bad indent, are reported there.

Adding paid models later

When you move to a paid plan, add the ids you want to default, or switch to fetch: true, and restart. For example:

      models:
        default: ["gpt-6-luna", "claude-sonnet-5", "gpt-6.1-sol"]
        fetch: false

Keep titleModel on a low-multiplier model even then. Each model uses plan tokens at its own rate: Claude Sonnet 5 counts 3× and GPT-6.1 Sol 1.75×, while models such as glm-5.3-flash count 1×, so the same title costs several times more from a premium model. Every paid plan reaches every model, and unused tokens can be refunded at any time.

Per-user keys

By default the whole instance shares the key in .env, and every chat is billed to it. If you want each user to bring their own FreeModel key, LibreChat accepts apiKey: "user_provided"; users then enter a key in the interface. Requests per minute are counted per FreeModel account (all keys of one account share the limit: 60 on the free plan, from 120 on Starter up to 1,500 on Ultra), so users who bring keys from their own accounts do not use up the instance's limit.

Check before you debug LibreChat

curl https://freemodel.in/v1/chat/completions \
  -H "Authorization: Bearer fm_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"model": "gpt-6-luna", "messages": [{"role": "user", "content": "ping"}]}'

If this answers, the key and model are fine and the problem is in the YAML, the mount, or .env. The request format is documented in Chat Completions.

Errors

  • Endpoint missing from the menu — file not mounted, YAML error, or container not restarted.
  • 401 — FREEMODEL_API_KEY not set in .env, or the key is revoked.
  • 403 upgrade_required — a free key asked for a paid model.
  • 404 model_not_found — an id in default or titleModel is not listed.
  • 402 — tokens used up (tokens_exhausted); nothing is charged for the rejection.
  • 429 — requests-per-minute limit reached (per account, or a lower per-key limit); consider per-user keys from their own accounts.
  • 503 — the model is temporarily unavailable; try later or pick another.

Paid plans are prepaid for 30 days from $1.20, with no auto-renew; see pricing. Running Open WebUI instead? See the Open WebUI guide.

FAQ

Should I use fetch: true or a fixed model list?

A fixed default list is better on a free key, because it shows only models that key can use. fetch: true loads the whole catalogue from GET /v1/models.

Why is my FreeModel endpoint not showing in LibreChat?

Usually the container is not reading librechat.yaml, or the YAML has an indentation error. Check the LibreChat logs at start-up; they report config problems.

Do conversation titles cost tokens?

Yes. With titleConvo enabled, LibreChat makes an extra request per new conversation. Point titleModel at a free model to keep that cheap.

Can I let each user enter their own key?

LibreChat supports a user_provided value for apiKey, so each user enters a key in the interface. Each user then needs their own FreeModel key.

Ready to build?

Grab a free API key — 1M tokens on 8 free models after a one-time Telegram verification, no card. Every model from $1.20.