Skip to content

Set up LibreChat with a 5abeer key: custom endpoints

Add 5abeer to self-hosted LibreChat as custom endpoints in librechat.yaml, keep keys in .env and run Claude, GPT or Gemini from your balance.

Updated November 1, 2026Markdown version

To set up LibreChat with a 5abeer key, add one custom endpoint per provider under endpoints.custom in librechat.yaml. Set baseURL to https://api.5abeer.ai/v1, point apiKey at a variable in .env, list a model id such as claude-sonnet-5.5 under models.default, then restart LibreChat. Requests are paid from your 5abeer balance.

What you need#

  • A self-hosted LibreChat instance. The examples below assume the Docker Compose install.
  • A 5abeer API key for each provider you want. A key works with one provider's models only, so a Claude key runs Claude models (create a key).
  • Some balance on your account (how to pay).

A 5abeer subscription key will not work here. Plans are for the supported apps, and LibreChat is not one of them. Create an API key that is paid from your balance.

How LibreChat custom endpoints work#

LibreChat reads extra providers from librechat.yaml. Each entry under endpoints.custom is an OpenAI compatible connection with its own name, key, base URL and model list, and it shows up as its own entry in the endpoint selector.

LibreChat's docs list four required fields: name, apiKey, baseURL and models. They also warn that if one of them is missing, the endpoint is dropped silently, with no error in the logs. 5abeer serves the OpenAI Chat Completions format at /v1 for Claude, GPT and Gemini models, so one custom endpoint per key covers each family.

OpenAI-compatiblehttps://api.5abeer.ai/v1Authorization: Bearer <KEY>
Anthropic-compatiblehttps://api.5abeer.aix-api-key: <KEY>
Geminihttps://api.5abeer.ai/v1betax-goog-api-key: <KEY>

librechat.yaml example for 5abeer#

  1. Create one key per provider#

    In the dashboard, open API → Keys, choose New key and pick Claude. Repeat for GPT, and for Gemini if you want it. Copy each key when it appears.

  2. Put the keys in .env#

    Add one variable per key to the .env file in your LibreChat folder. The names are yours to choose; they only need to match librechat.yaml.

    .env
    KHABEER_CLAUDE_KEY=your-5abeer-claude-key
    KHABEER_GPT_KEY=your-5abeer-gpt-key
    KHABEER_GEMINI_KEY=your-5abeer-gemini-key
  3. Write librechat.yaml#

    Create librechat.yaml next to docker-compose.yml. For GPT and Gemini, copy the id from the models list in place of the placeholder.

    librechat.yaml
    version: 1.3.18
    endpoints:
      custom:
        - name: '5abeer Claude'
          apiKey: '${KHABEER_CLAUDE_KEY}'
          baseURL: 'https://api.5abeer.ai/v1'
          models:
            default: ['claude-sonnet-5.5', 'claude-opus-5.5']
            fetch: false
          titleConvo: true
          titleModel: 'current_model'
          modelDisplayLabel: '5abeer Claude'
        - name: '5abeer GPT'
          apiKey: '${KHABEER_GPT_KEY}'
          baseURL: 'https://api.5abeer.ai/v1'
          models:
            default: ['YOUR_GPT_MODEL_ID']
            fetch: false
          titleConvo: true
          titleModel: 'current_model'
          modelDisplayLabel: '5abeer GPT'
        - name: '5abeer Gemini'
          apiKey: '${KHABEER_GEMINI_KEY}'
          baseURL: 'https://api.5abeer.ai/v1'
          models:
            default: ['YOUR_GEMINI_MODEL_ID']
            fetch: false
          titleConvo: true
          titleModel: 'current_model'
          modelDisplayLabel: '5abeer Gemini'

    version is the config schema version from LibreChat's quick start; if your LibreChat release ships a newer one, use that. Drop the Gemini block if you don't need it.

  4. Mount the file with docker-compose.override.yml#

    LibreChat's Docker image does not see the file until you mount it. Add this to docker-compose.override.yml:

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

    LibreChat reads the config at start, so restart it after every change:

    Terminal
    docker compose down && docker compose up -d

    Open LibreChat, pick 5abeer Claude in the endpoint selector, choose claude-sonnet-5.5 and send a short message. If a reply comes back, the setup works.

What each field does:

  • name: a unique name, shown as the title in the endpoint selector.
  • apiKey: the key. The '${KHABEER_CLAUDE_KEY}' form reads it from .env, so the key never sits in the YAML file.
  • baseURL: https://api.5abeer.ai/v1 for every endpoint.
  • models.default: the ids the model picker shows. Put claude-sonnet-5.5 first.
  • models.fetch: false keeps the list you typed. Type each id exactly as on the models list.
  • titleConvo and titleModel: turn on chat titles; 'current_model' writes the title with the model of that chat.
  • modelDisplayLabel: the label next to the model icon.

LibreChat with Claude: the built-in Anthropic endpoint#

LibreChat also has a built-in Anthropic endpoint, set in .env. Its reference lists ANTHROPIC_API_KEY, ANTHROPIC_MODELS and ANTHROPIC_REVERSE_PROXY, described as "Reverse proxy for Anthropic". With a 5abeer Claude key, set the reverse proxy to the Anthropic format URL, which has no /v1:

.env
ANTHROPIC_API_KEY=your-5abeer-claude-key
ANTHROPIC_REVERSE_PROXY=https://api.5abeer.ai
ANTHROPIC_MODELS=claude-sonnet-5.5,claude-opus-5.5

This route uses the Anthropic Messages format. Pick one route for Claude, the custom endpoint or this one, so your users don't see the same models twice.

Which model to pick in LibreChat#

Start with claude-sonnet-5.5 for everyday chat and writing. Move to claude-opus-5.5 for long, hard tasks where the extra cost pays off. These are the current Claude models:

per 1M tokens

Official price from the provider's page, checked October 19, 2026.

All models and prices

The official price next to ours, with the date it was read:

Claude Sonnet 5.5 price per 1M tokens
Input$0.60Official price: $2
Output$3Official price: $10

Official price from the provider's page, checked October 19, 2026.

For the GPT and Gemini endpoints, take the ids from these lists, with a key for that provider:

per 1M tokens

Official price from the provider's page, checked October 19, 2026.

All models and prices
per 1M tokens

Official price from the provider's page, checked October 19, 2026.

All models and prices

Claude, GPT and Gemini in one LibreChat: one key per provider#

Each 5abeer key works with one provider's models. If you put a GPT id under the Claude endpoint, the request returns MODEL_PLATFORM_NOT_ALLOWED. That is why the example has one endpoint per key, each with its own variable. All keys draw on the same balance.

Secure your self-hosted LibreChat#

You run the server, so you decide who can use your balance.

  • Close sign-ups. LibreChat's .env reference lists ALLOW_REGISTRATION with a default of true. Create your own accounts, then set ALLOW_REGISTRATION=false.
  • Serve LibreChat only over HTTPS, behind a reverse proxy with a certificate. Logins and chats should never travel as plain text.
  • Keep keys only in .env or your host's secrets store. librechat.yaml should hold ${...} references, never a key. Keep .env out of Git.
  • On a shared instance, give LibreChat its own keys and set a spend limit, an expiry date and an IP allow-list on each one (key controls). A leaked key can then spend only what you allowed.

Keep LibreChat API costs under control#

Each request is paid from your balance by the tokens it uses, at the model's 5abeer price (pricing and balance). A long chat sends its earlier messages again with each reply, so long threads cost more per message. Chat titles add one small request per new chat; set titleConvo: false if you don't want them. Separate keys per endpoint also keep each provider's usage apart in the dashboard.

Common errors and fixes#

  • The endpoint does not appear: one of name, apiKey, baseURL or models is missing, or librechat.yaml is not mounted. Check the override file and restart.
  • INVALID_API_KEY or a 401: the key is wrong, revoked or not loaded. Check that the variable name in .env matches the ${...} reference, then restart.
  • MODEL_PLATFORM_NOT_ALLOWED: the model belongs to another provider than the key. Move it to the matching endpoint.
  • Wrong base URL: custom endpoints use https://api.5abeer.ai/v1. ANTHROPIC_REVERSE_PROXY uses https://api.5abeer.ai, without /v1.
  • Model not found: the id has a typo. Copy it from the models list.
  • INSUFFICIENT_BALANCE: your balance doesn't cover the request. Top up and retry.

Every code and what it means is in Errors and fixes.

Questions#

Can I use my 5abeer subscription in LibreChat?#

No. Plans run only the supported apps, and LibreChat is not one of them. Create an API key and pay for LibreChat usage from your balance.

Is LibreChat's custom endpoint OpenAI compatible?#

Yes. A custom endpoint talks the OpenAI format, and 5abeer serves it at https://api.5abeer.ai/v1 for Claude, GPT and Gemini models.

Why do I need separate keys for Claude and GPT?#

A 5abeer key works with one provider's models only. Create one key per provider, add one custom endpoint per key, and both use the same balance.

Should I turn on models.fetch?#

You can, but keep fetch: false and type the ids yourself. If you do fetch, check each id against the 5abeer models list.

Can each user bring their own 5abeer key?#

Yes. LibreChat accepts apiKey: 'user_provided', which lets each user enter a key in the app and pay from their own balance.

Can the built-in Anthropic endpoint use a 5abeer key?#

Yes, with a Claude key. Set ANTHROPIC_REVERSE_PROXY to https://api.5abeer.ai and the key in ANTHROPIC_API_KEY.

Sources#

Checked on 2026-11-01: