# 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: 2026-11-01

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](https://5abeer.ai/en/docs/start/keys.md#create)).
- Some balance on your account ([how to pay](https://5abeer.ai/en/docs/start/payment.md)).

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.

| Format | Base URL | Key header |
| --- | --- | --- |
| OpenAI | `https://api.5abeer.ai/v1` | `Authorization: Bearer <KEY>` |
| Anthropic | `https://api.5abeer.ai` | `x-api-key: <KEY>` |
| Gemini | `https://api.5abeer.ai/v1beta` | `x-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`.

```bash
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](https://5abeer.ai/en/models) in place of the placeholder.

```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`:

```yaml
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:

```bash
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](https://5abeer.ai/en/models).
- `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`:

```bash
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`](https://5abeer.ai/en/models/claude-sonnet-5.5) for everyday chat and writing. Move to [`claude-opus-5.5`](https://5abeer.ai/en/models/claude-opus-5.5) for long, hard tasks where the extra cost pays off. These are the current Claude models:

| Model | Id | Input (ours) | Output (ours) | Context |
| --- | --- | --- | --- | --- |
| Claude Sonnet 5.5 | `claude-sonnet-5.5` | $0.60 | $3 | 1M |
| Claude Opus 5.5 | `claude-opus-5.5` | $1.20 | $6 | 1M |
| Claude Fable 5.1 | `claude-fable-5.1` | $3 | $15 | — |

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

Claude Sonnet 5.5 (`claude-sonnet-5.5`) per 1M tokens: input $0.60 (official $2), output $3 (official $10). Official price checked October 19, 2026.

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

| Model | Id | Input (ours) | Output (ours) | Context |
| --- | --- | --- | --- | --- |
| GPT-6.1 Sol | `gpt-6.1-sol` | $0.60 | $3 | 922K |
| GPT-6 Astra | `gpt-6-astra` | $3 | $15 | — |
| GPT-6 Sol | `gpt-6-sol` | $0.60 | $3 | 922K |

| Model | Id | Input (ours) | Output (ours) | Context |
| --- | --- | --- | --- | --- |
| Gemini 4 Argon | `gemini-4-argon` | $0.60 | $3 | — |
| Gemini 2.5 Pro | `gemini-2.5-pro` | $0.38 | $3 | 1M |

## 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`](https://5abeer.ai/en/docs/help/errors.md#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](https://5abeer.ai/en/docs/start/keys.md#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](https://5abeer.ai/en/docs/start/pricing.md)). 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`](https://5abeer.ai/en/docs/help/errors.md#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`](https://5abeer.ai/en/docs/help/errors.md#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](https://5abeer.ai/en/models).
- [`INSUFFICIENT_BALANCE`](https://5abeer.ai/en/docs/help/errors.md#INSUFFICIENT_BALANCE): your balance doesn't cover the request. Top up and retry.

Every code and what it means is in [Errors and fixes](https://5abeer.ai/en/docs/help/errors.md).

## 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`.

> Ready to connect LibreChat? [Create an API key](https://5abeer.ai/en/docs/start/keys.md#create) for each provider you want, then see every model and price on the [5abeer API page](https://5abeer.ai/en/api). Running a similar chat app? See [Open WebUI](https://5abeer.ai/en/guides/open-webui-api-key), or compare [subscription and API](https://5abeer.ai/en/guides/ai-subscription-vs-api).

## Sources

Checked on 2026-11-01:

- LibreChat docs: [Custom endpoints quick start](https://www.librechat.ai/docs/quick_start/custom_endpoints), [Custom endpoint object structure](https://www.librechat.ai/docs/configuration/librechat_yaml/object_structure/custom_endpoint) and [.env configuration](https://www.librechat.ai/docs/configuration/dotenv)
- 5abeer docs: [API keys](https://5abeer.ai/en/docs/start/keys.md), [Base URLs](https://5abeer.ai/en/docs/start/base-urls.md) and [Errors and fixes](https://5abeer.ai/en/docs/help/errors.md)

> 5abeer is an independent service, not affiliated with LibreChat, OpenAI, Anthropic or Google.
