---
title: "LibreChat custom endpoint in librechat.yaml (OpenAI API)"
description: "Add BroadNet Inference to LibreChat as an OpenAI-compatible custom endpoint in librechat.yaml, with the key in .env, the model list, title model and fixes."
url: https://broadrouter.com/guides/librechat-custom-endpoint/
lang: en
updated: 2026-11-16
publisher: BroadRouter (a BroadNet site); API by BroadNet Inference, https://inference.broadnet.ai
---

# Add BroadNet Inference to LibreChat as a custom endpoint

Updated 2026-11-16

In librechat.yaml, add an entry under endpoints.custom with name BroadNet, apiKey set to an environment reference such as BROADNET\_API\_KEY, baseURL https://inference.broadnet.ai/v1, and models.default listing BroadNet IDs like broadnet/glm-5.3. Put the key in .env, mount the file into the container on Docker, and restart LibreChat. LibreChat adds /chat/completions to the base URL itself.

LibreChat is an open-source chat app that supports OpenAI-compatible services as **custom endpoints**. You define them in `librechat.yaml`, keep keys in `.env`, and, on Docker, mount the YAML file into the container. BroadRouter is BroadNet’s own site; the steps follow [LibreChat’s custom endpoint guide](https://www.librechat.ai/docs/quick_start/custom_endpoints).

## Setup

1.  **Mount librechat.yaml (Docker only).** Copy `docker-compose.override.yml.example` to `docker-compose.override.yml` and make sure the volume is active:

```yaml
services:
  api:
    volumes:
      - type: bind
        source: ./librechat.yaml
        target: /app/librechat.yaml
```

2.  **Add the endpoint** to `librechat.yaml` in the project root, under `endpoints.custom`:

```yaml
endpoints:
  custom:
    - name: 'BroadNet'
      apiKey: '${BROADNET_API_KEY}'
      baseURL: 'https://inference.broadnet.ai/v1'
      models:
        default:
          - 'broadnet/glm-5.3'
          - 'broadnet/qwen3.8-27b'
          - 'broadnet/deepseek-v4.1-flash'
          - 'broadnet/gemma-4-26b-a4b'
        fetch: false
      titleConvo: true
      titleModel: 'broadnet/gemma-4-26b-a4b'
      modelDisplayLabel: 'BroadNet'
```

Keep any top-level keys your file already has, such as `version`.

3.  **Set the key** in `.env`:

```bash
BROADNET_API_KEY=your-broadnet-key
```

4.  **Restart LibreChat.** With Docker: `docker compose down && docker compose up -d`. For a local install, restart with `npm run backend`. BroadNet then appears in the endpoint selector.

## Field notes

-   **baseURL.** LibreChat appends `/chat/completions` itself, so use the `/v1` root above. Don’t set `directEndpoint: true`; that option is for a baseURL that already is the full completions URL.
-   **fetch: false.** This is LibreChat’s default; we set it to make the choice visible. BroadNet’s docs describe `GET /v1/models` as public catalog metadata for monitors, so listing models in `default` is more predictable.
-   **titleModel.** LibreChat writes a title for each chat with an extra request. A small, cheap model without reasoning keeps that call short. BroadNet’s docs don’t list reasoning for Gemma 4 VL 26B.
-   **user\_provided.** Set `apiKey: 'user_provided'` if each user should enter their own BroadNet key in the UI. LibreChat stores each user’s key encrypted and asks for it the first time they pick the endpoint.
-   **Unique name.** A second endpoint with the same name, ignoring case, silently replaces the first. If you already have an entry called BroadNet, rename one.
-   **No literal keys.** LibreChat’s docs recommend the `${VAR}` reference over a key typed into `librechat.yaml`, which would sit in the file in plain text.

## Which model to pick

| Use | Model |
| --- | --- |
| Default chat, tools, JSON | [GLM 5.3](https://broadrouter.com/models/glm-5.3/) |
| Images and Arabic | [Qwen3.8 27B](https://broadrouter.com/models/qwen3.8-27b/) |
| Long documents, 1M context | [DeepSeek V4.1 Flash](https://broadrouter.com/models/deepseek-v4.1-flash/) |
| Titles and quick replies | [BroadNet Gemma 4 VL 26B](https://broadrouter.com/models/gemma-4-vl-26b/) |

Of these models, only Gemma 4 VL 26B runs on the $5 starting credit, which also covers the two Transcribe models. Compare prices on the [pricing page](https://broadrouter.com/pricing/).

## Troubleshooting

-   **The endpoint doesn’t appear.** Check that `name`, `baseURL`, `apiKey` and `models.default` are spelled right and indented inside `endpoints.custom`. LibreChat drops incomplete entries without a log line. On Docker, confirm the bind mount is uncommented in `docker-compose.override.yml`.
-   **“Missing API Key for BroadNet”.** `BROADNET_API_KEY` isn’t in `.env`, or LibreChat wasn’t restarted. The endpoint still appears; the error shows only when you send a message.
-   **401 from the provider.** The key is wrong, expired, or the pay-as-you-go allowance is used up.
-   **Model errors.** Each ID must match BroadNet’s exactly, with the `broadnet/` prefix. GLM 5.3, Qwen3.8 27B and DeepSeek V4.1 Flash need a top-up.
-   **Empty replies.** DeepSeek V4.1 Flash, GLM 5.3 and Qwen3.8 27B reason first, and reasoning counts toward `max_tokens`. If you set a small max output in LibreChat’s parameters, raise it. [Why answers come back empty](https://broadrouter.com/guides/reasoning-tokens-empty-response/).
-   **429 with many users.** One pay-as-you-go key allows 30 requests a minute and 4 at once, shared by everyone on the endpoint. Title requests count too. `user_provided` keys spread the load. See [errors and retries](https://broadrouter.com/guides/errors-and-retries/).
-   **Plan keys.** An [unlimited plan session](https://broadrouter.com/guides/unlimited-llm-api-sessions/) runs one request at a time and can’t be shared, so it doesn’t suit a multi-user LibreChat.

## Terms in this guide

[Pay-as-you-go](https://broadrouter.com/glossary/pay-as-you-go/)

Pay-as-you-go is a pricing model in which you pay only for what you use, metered per unit such as tokens, requests or audio minutes, with no subscription or minimum commitment. Most LLM APIs bill this way, from a prepaid balance or a periodic invoice.

[Base URL](https://broadrouter.com/glossary/base-url/)

A base URL is the fixed root address of an API, such as https://api.example.com/v1, that a client puts in front of every endpoint path, such as /chat/completions. In OpenAI-compatible SDKs, changing the base URL, together with the API key and model ID, points the same code at a different provider.

[API key](https://broadrouter.com/glossary/api-key/)

An API key is a secret string that identifies and authorizes a client calling an API. LLM APIs usually expect it in an Authorization: Bearer header, and anyone who holds the key can make requests that are billed to the account that owns it.

[Concurrency](https://broadrouter.com/glossary/concurrency/)

Concurrency is the number of requests a client has in flight at the same time. LLM APIs often cap it per key or plan, separately from requests per minute, because each open request holds GPU capacity until its response has finished.

[Prepaid credit](https://broadrouter.com/glossary/prepaid-credit/)

Prepaid credit is money added to an API account before use. Each request deducts its cost from the balance, and when the balance runs out, metered requests stop until you top up. It caps spend at what you have paid in.

[Rate limit](https://broadrouter.com/glossary/rate-limit/)

A rate limit is a cap an API places on how much a client can use it in a time window, such as requests per minute or tokens per minute. Requests over the limit are refused, usually with HTTP 429 Too Many Requests, until usage falls back under it.

[Tool calling](https://broadrouter.com/glossary/tool-calling/)

Tool calling, also called function calling, is an LLM API feature in which the model returns a structured request to run a function the developer has defined, with JSON arguments. The application runs the function and sends the result back; the model never runs code itself.

## Questions

### Why doesn't my BroadNet endpoint appear in LibreChat?

LibreChat drops a custom endpoint with no error or log line if name, baseURL, apiKey or models.default is missing or misspelled. On Docker, also check that librechat.yaml is mounted at /app/librechat.yaml and that you restarted.

### Can each user bring their own BroadNet key?

Yes. Set apiKey to user\_provided. LibreChat then asks each user for a key the first time they pick the endpoint and stores it encrypted.

### Why does LibreChat show "Missing API Key for BroadNet"?

The variable referenced in apiKey isn't set in .env. The endpoint still shows in the selector, and the error appears only when you send a message. Add the variable, then restart LibreChat.

### Should the LibreChat baseURL include /chat/completions?

No. LibreChat appends /chat/completions to baseURL by default. Use https://inference.broadnet.ai/v1. Only set directEndpoint to true when the URL you enter is already the full completions endpoint.

## Related guides

-   [Connect Open WebUI to BroadNet Inference](https://broadrouter.com/guides/open-webui-openai-api/)
-   [Why a reasoning model returns an empty answer](https://broadrouter.com/guides/reasoning-tokens-empty-response/)
-   [BroadNet Inference error codes and when to retry](https://broadrouter.com/guides/errors-and-retries/)
-   [Lock API keys to your servers with IP allow-lists](https://broadrouter.com/guides/api-keys-ip-allow-lists/)
-   [All tools that work with BroadNet Inference](https://broadrouter.com/integrations/): SDKs, coding agents, chat UIs and automation tools, with exact settings for each

Try it on your real workload. New accounts start with $5 of credit for Gemma and transcription. DeepSeek, GLM and Qwen3.8 need a top-up.

[Get started](https://inference.broadnet.ai/account/?utm_source=broadrouter&utm_medium=referral&utm_campaign=guides-librechat-custom-endpoint&utm_content=page-cta) ·

**Sources**

-   [LibreChat docs, Custom Endpoints quick start (checked 2026-11-14)](https://www.librechat.ai/docs/quick_start/custom_endpoints)
-   [LibreChat docs, Custom Endpoint object structure (checked 2026-11-14)](https://www.librechat.ai/docs/configuration/librechat_yaml/object_structure/custom_endpoint)
-   [BroadNet Inference API reference (checked 2026-11-16)](https://inference.broadnet.ai/docs?utm_source=broadrouter&utm_medium=referral&utm_campaign=guides-librechat-custom-endpoint&utm_content=sources)
