---
title: "LibreChat custom endpoint: security model setup"
canonical: https://pentestllm.ai/guides/librechat
generated: 2026-11-18T03:35:56.586Z
source: https://pentestllm.ai/guides/librechat
base_url: https://api.pentestllm.ai/v1
---

# LibreChat custom endpoint for security models

Point a LibreChat custom endpoint at the security catalog: the endpoints.custom block in librechat.yaml, the key variable in .env, the /v1 base URL, a models.default list and a cheap titleModel. Plus the Docker mount, what a chat costs and how to read each error.

Steps checked November 6, 2026 · prices as of November 18, 2026

If your team already lives in LibreChat, you do not need a second chat app for engagement work. A custom endpoint in `librechat.yaml` takes any OpenAI-compatible API, and that includes the security-tuned and abliterated builds here: the ones that read a scope, review a proof of concept against an in-scope host or draft a finding without declining. One YAML block, billed per token. The same ids also drop into [Open WebUI](https://pentestllm.ai/guides/open-webui) and [OpenCode](https://pentestllm.ai/guides/opencode).

## What you need

A running LibreChat install, a key from the [console](https://app.pentestllm.ai/console), and write access to two files. The custom endpoint is a single entry under `endpoints.custom` in `librechat.yaml` at the project root: name, key reference, base URL, model ids. The key itself lives in `.env`; LibreChat’s docs prefer that `apiKey` points at an environment variable rather than holding the secret. On Docker, `docker-compose.override.yml` binds the YAML into the container, and a restart picks it up.

## Shortest path to a first reply

1. Make a key in the [console](https://app.pentestllm.ai/console), then write it into `.env` beside `docker-compose.yml`:

```
# .env
PENTESTLLM_API_KEY=sk-ptl-live-…
```

1. Drop the block below into `librechat.yaml`. The `models.default` ids are one reasonable set for engagement work; swap in any id from the [models page](https://pentestllm.ai/models), security builds included, spelled exactly as shown there:

```
# librechat.yaml
version: 1.3.18
cache: true
endpoints:
  custom:
    - name: 'PentestLLM'
      apiKey: '${PENTESTLLM_API_KEY}'
      baseURL: 'https://api.pentestllm.ai/v1'
      models:
        default:
          - 'glm-5.3-uncensored'
          - 'deepseek-v4-pro-uncensored'
          - 'deepseek-v4.1-flash-abliterated'
          - 'glm-5.3-abliterated'
          - 'glm-5.3-flash-uncensored'
        fetch: false
      titleConvo: true
      titleModel: 'glm-5.3-flash-uncensored'
      modelDisplayLabel: 'PentestLLM'
```

1. Make sure the override file still mounts the YAML, and restart the stack:

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

Run `docker compose down && docker compose up -d`. On the next page load the endpoint selector shows your chosen name, and the model menu under it holds exactly the ids from `models.default`. Pick one, paste a scope document or a chunk of recon output, and ask for a prioritised list of what to test first. Want to try the same build before touching YAML? The [playground](https://pentestllm.ai/playground) runs it with no install.

## The fields, one by one

- name: PentestLLM what the endpoint selector displays; must be set and must not repeat another endpoint
- apiKey: ${PENTESTLLM_API_KEY} pulls the sk-ptl- key out of .env; the value user_provided instead asks every user for their own key
- baseURL: https://api.pentestllm.ai/v1 keep the /v1; LibreChat adds /chat/completions on its own, so leave directEndpoint alone
- models.default: the ids above the model menu while fetch is false; mandatory
- models.fetch: false set to true, it pulls every id the key can reach into the menu
- titleConvo, titleModel: glm-5.3-flash-uncensored auto-generated chat titles, and the cheap build that writes them
- modelDisplayLabel: PentestLLM the name shown next to the assistant icon; defaults to "AI"

## Which build, and what a chat costs

Every turn in LibreChat resends the full conversation in the OpenAI format, which any build on the models page accepts. The figures below price a single turn of 2,000 input tokens and 500 output tokens at the catalog rates of 2026-11-18.

| Model | One turn | One title |
| --- | --- | --- |
| [GLM-5.3 Uncensored](https://pentestllm.ai/models/glm-5.3-uncensored) | $0.00099 | $0.0003 |
| [DeepSeek V4 Pro Uncensored](https://pentestllm.ai/models/deepseek-v4-pro-uncensored) | $0.0029 | $0.001 |
| [DeepSeek V4.1 Flash Abliterated](https://pentestllm.ai/models/deepseek-v4.1-flash-abliterated) | $0.0025 | $0.00088 |
| [GLM-5.3 Abliterated](https://pentestllm.ai/models/glm-5.3-abliterated) | $0.0065 | $0.0023 |
| [GLM-5.3 Flash Uncensored](https://pentestllm.ai/models/glm-5.3-flash-uncensored) | $0.00039 | $0.00011 |

The opening turn on GLM-5.3 Uncensored comes to $0.00099. Because `titleConvo` is on, every fresh chat also fires one title request, roughly 1,000 tokens in and 20 out: $0.0003 if GLM-5.3 Uncensored wrote it, $0.00011 on GLM-5.3 Flash Uncensored. That gap is the reason the example names a separate titleModel.

| Model | Build | Input $/M | Output $/M |
| --- | --- | --- | --- |
| [GLM-5.3 Uncensored](https://pentestllm.ai/models/glm-5.3-uncensored) glm-5.3-uncensored | Uncensored | $0.282 | $0.846 |
| [DeepSeek V4 Pro Uncensored](https://pentestllm.ai/models/deepseek-v4-pro-uncensored) deepseek-v4-pro-uncensored | Uncensored | $0.97 | $1.94 |
| [DeepSeek V4.1 Flash Abliterated](https://pentestllm.ai/models/deepseek-v4.1-flash-abliterated) deepseek-v4.1-flash-abliterated | Abliterated | $0.8488 | $1.6975 |
| [GLM-5.3 Abliterated](https://pentestllm.ai/models/glm-5.3-abliterated) glm-5.3-abliterated | Abliterated | $2.1825 | $4.365 |
| [GLM-5.3 Flash Uncensored](https://pentestllm.ai/models/glm-5.3-flash-uncensored) glm-5.3-flash-uncensored | Uncensored | $0.1053 | $0.3685 |

Prices per million tokens, read from the live catalog on 2026-11-18.

## Prove the key works before blaming LibreChat

On the host that runs LibreChat, ask the API which models the key may call. Each id you listed under `models.default` must appear in the response:

```bash
curl https://api.pentestllm.ai/v1/models -H "Authorization: Bearer sk-ptl-live-…"
```

Next, fire one streamed completion, the same shape LibreChat sends. The `-i` flag shows the response headers; the request id among them is what to quote to support.

```bash
curl -i https://api.pentestllm.ai/v1/chat/completions \
  -H "Authorization: Bearer sk-ptl-live-…" \
  -H "Content-Type: application/json" \
  -d '{"model": "glm-5.3-uncensored", "messages": [{"role": "user", "content": "Reply with the single word ok."}], "stream": true}'
```

Both succeed but LibreChat still fails? Then the fault is in the YAML or the volume mount. Read the container log right after `docker compose up`.

## When it breaks

- No sign of the endpoint in the selector: either the YAML never reached the container, or it failed to parse. The log after `docker compose up` points at the offending line.
- `401 invalid_api_key`: a bad or revoked key, or the variable in `.env` is spelled differently from the one inside `apiKey`.
- `402 insufficient_balance`: not enough credit for this request; add funds in the console. `402 monthly_limit_reached` is the monthly cap you put on the key doing its job.
- `404 model_not_found`: one of the `models.default` entries is not a live id, usually because a display name went in where the id belongs.
- `429 rate_limited`: the key is over its rate limit. Everyone on the same endpoint shares that one key and its limit, so a busy team hits it sooner. Honour the `retry-after` header.
- The menu lists the whole catalog instead of your short list: `fetch` is true. Flip it to `false` and curate `models.default`.

## Where this came from

The field names, the environment-variable form of `apiKey`, the `/v1` base URL rule and the Docker mount were read from LibreChat’s documentation on 2026-11-06: [Custom Endpoint Object Structure](https://www.librechat.ai/docs/configuration/librechat_yaml/object_structure/custom_endpoint) and the [Custom Endpoints quick start](https://www.librechat.ai/docs/quick_start/custom_endpoints). Every price on this page is pulled from the live catalog when it renders.

## Questions

### Which file holds a LibreChat custom endpoint?

librechat.yaml at the project root. The endpoint is one list item under endpoints.custom carrying name, apiKey, baseURL and models. With Docker, bind the file in through docker-compose.override.yml and restart.

### Should the baseURL end in /v1?

It should: https://api.pentestllm.ai/v1. LibreChat appends /chat/completions itself, matching its own OpenAI-compatible examples. Use directEndpoint only when your URL is already the complete completions path.

### Can every tester on the team use their own key?

Yes. Write apiKey: user_provided and each person pastes a key into the endpoint's settings, spending from their own balance. With the environment-variable form, the whole instance shares the one key in .env.

### Do the security builds speak the OpenAI format?

Every id on the models page does, security-tuned, abliterated and uncensored alike. They all answer /v1/chat/completions on the same key, so copy the id as it appears there straight into models.default. See the models page.

### What am I paying for when I run LibreChat this way?

Tokens only. LibreChat is free software; the API bills per token at the live catalog prices from a prepaid balance that never expires, with no subscription required. A small titleModel keeps the automatic titles close to free.

Every model above is on the [uncensored model list](https://pentestllm.ai/models) with its live price per million tokens. [Per-token pricing](https://pentestllm.ai/pricing) sets the whole catalog side by side, and the [family directory](https://pentestllm.ai/uncensored) groups the builds by base model.

[Get a key](https://app.pentestllm.ai/console) Prepaid from $10, no subscription.

## New models and price changes, once a month.

New uncensored builds with their prices, price moves, and what the daily model check found.
