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.
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.
https://api.5abeer.ai/v1Authorization: Bearer <KEY>https://api.5abeer.aix-api-key: <KEY>https://api.5abeer.ai/v1betax-goog-api-key: <KEY>librechat.yaml example for 5abeer#
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.
Put the keys in .env#
Add one variable per key to the
.envfile in your LibreChat folder. The names are yours to choose; they only need to matchlibrechat.yaml..envKHABEER_CLAUDE_KEY=your-5abeer-claude-key KHABEER_GPT_KEY=your-5abeer-gpt-key KHABEER_GEMINI_KEY=your-5abeer-gemini-keyWrite librechat.yaml#
Create
librechat.yamlnext todocker-compose.yml. For GPT and Gemini, copy the id from the models list in place of the placeholder.librechat.yamlversion: 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'versionis 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.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.ymlservices: api: volumes: - type: bind source: ./librechat.yaml target: /app/librechat.yamlRestart and test#
LibreChat reads the config at start, so restart it after every change:
Terminaldocker compose down && docker compose up -dOpen LibreChat, pick 5abeer Claude in the endpoint selector, choose
claude-sonnet-5.5and 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/v1for every endpoint.models.default: the ids the model picker shows. Putclaude-sonnet-5.5first.models.fetch:falsekeeps the list you typed. Type each id exactly as on the models list.titleConvoandtitleModel: 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:
ANTHROPIC_API_KEY=your-5abeer-claude-key
ANTHROPIC_REVERSE_PROXY=https://api.5abeer.ai
ANTHROPIC_MODELS=claude-sonnet-5.5,claude-opus-5.5This 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:
Claude Sonnet 5.5DefaultInput$0.60Output$3Context1M
Claude Opus 5.5Input$1.20Output$6Context1M
Claude Fable 5.1Input$3Output$15Context—
Official price from the provider's page, checked October 19, 2026.
All models and pricesThe official price next to ours, with the date it was read:
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:
GPT-6.1 SolInput$0.60Output$3Context922K
GPT-6 AstraInput$3Output$15Context—
GPT-6 SolInput$0.60Output$3Context922K
Official price from the provider's page, checked October 19, 2026.
All models and prices
Gemini 4 ArgonInput$0.60Output$3Context—
Gemini 2.5 ProInput$0.38Output$3Context1M
Official price from the provider's page, checked October 19, 2026.
All models and pricesClaude, 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
.envreference listsALLOW_REGISTRATIONwith a default oftrue. Create your own accounts, then setALLOW_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
.envor your host's secrets store.librechat.yamlshould hold${...}references, never a key. Keep.envout 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,baseURLormodelsis missing, orlibrechat.yamlis not mounted. Check the override file and restart. INVALID_API_KEYor a 401: the key is wrong, revoked or not loaded. Check that the variable name in.envmatches 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_PROXYuseshttps://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:
- LibreChat docs: Custom endpoints quick start, Custom endpoint object structure and .env configuration
- 5abeer docs: API keys, Base URLs and Errors and fixes
Related guides
- Run Open WebUI with Claude and GPT via 5abeer API keysConnect Open WebUI to 5abeer: one OpenAI-compatible connection per key, the /v1 base URL and a Model IDs allowlist, in the UI or with env vars.
- AI subscription vs API: the difference and which you needAn AI subscription runs the provider's own apps for a fixed price. An API bills your own code by usage. How they differ and how to choose.
- Cline API key: use Claude and GPT in Cline with 5abeerConnect Cline to 5abeer with the OpenAI Compatible provider, paste your API key and run Claude, GPT or Gemini models from your balance.
Ready to start?
Pick a plan that runs the official apps, or create an API key to use from your own code.