LibreChat · custom endpoint

Connect LibreChat with one explicit YAML endpoint.

Store the provider key server-side, point LibreChat at the Primordial AI https://www.primoraihub.com/v1 API root, fetch current models, and verify plain chat before enabling model-dependent features.

Updated 2026-08-24librechat.yamlEnvironment variable/v1/modelsChat Completions

Use a server-managed custom endpoint

Add the key to LibreChat's server-side .env, then define a custom endpoint whose baseURL is https://www.primoraihub.com/v1. Replace the model placeholder with one exact ID returned by the authenticated model-list request before restarting.

# .env — keep this file out of source control
PRIMORDIAL_API_KEY=YOUR_SERVER_SIDE_KEY
# librechat.yaml
version: 1.3.5
cache: true

endpoints:
  custom:
    - name: "Primordial AI"
      apiKey: "${PRIMORDIAL_API_KEY}"
      baseURL: "https://www.primoraihub.com/v1"
      models:
        default:
          - "MODEL_ID_FROM_V1_MODELS"
        fetch: true
      modelDisplayLabel: "Primordial AI"

The configuration schema changes between LibreChat releases. The version shown above matches the official example observed on 2026-08-24; use the value required by your installed release if its current documentation differs.

What the evidence proves

LibreChat's official custom-config guide says a Docker setup needs the YAML file in the expected location, mounted into the API container, and followed by a restart. Its custom-endpoint reference defines baseURL, apiKey, required models.default, and optional models.fetch.

CheckObserved 2026-08-24Conclusion
GET /v1/models without a keyHTTP 401The route reaches authentication; this is not a successful model-fetch test.
POST /v1/chat/completions without a keyHTTP 401The route reaches authentication; this is not a successful LibreChat conversation.
YAML load, model fetch, streaming, tools, vision, RAG, memory, and MCPNot independently tested with LibreChat in this guideValidate the installed release, one model, and each optional feature separately.

OpenAI-compatible custom endpoints do not inherit every LibreChat capability. LibreChat's compatibility documentation marks several features as model-dependent or tied to a different endpoint type.

Discover a real fallback model first

Run this from a trusted shell before editing YAML. It validates the same server-side key and prints only current model IDs:

test -n "$PRIMORDIAL_API_KEY" || {
  echo "PRIMORDIAL_API_KEY is not set" >&2
  exit 1
}

curl --fail-with-body --silent --show-error \
  https://www.primoraihub.com/v1/models \
  -H "Authorization: Bearer $PRIMORDIAL_API_KEY" \
  | jq -r '.data[]?.id'

Put one returned ID under models.default. LibreChat requires a fallback list even when fetch: true; do not leave the literal placeholder in production.

Make the configuration visible to LibreChat

  1. Back up the current LibreChat configuration.
  2. Add PRIMORDIAL_API_KEY to the server-side environment file without quotes or trailing spaces.
  3. Add the custom endpoint to the existing librechat.yaml; merge it instead of replacing unrelated endpoints.
  4. Confirm the YAML file is mounted into the LibreChat API container according to the installed release's official deployment instructions.
  5. Validate YAML syntax, restart LibreChat, and inspect startup logs for schema or environment-variable errors.

Do not print the environment value while diagnosing the mount. Confirm only that the variable is present and non-empty.

Test the narrowest useful path

  1. Sign in to LibreChat and select the Primordial AI custom endpoint.
  2. Confirm the picker contains an exact ID returned by GET /v1/models.
  3. Start a chat with tools, files, vision, memory, and other optional features disabled.
  4. Send a short prompt and check both LibreChat's server log and Primordial AI usage without logging credentials.
  5. Enable at most one optional feature per test and record its model, endpoint, request shape, and result.

A successful plain chat verifies only that one installed LibreChat release, one custom endpoint, one model, and one request path worked at that time.

Troubleshoot by failure stage

SymptomLikely boundaryNext check
Custom endpoint is absentYAML location, mount, schema, or restartCompare the installed release with the official custom-config guide and inspect startup logs.
Model list returns 401Key interpolation or credential stateTest the server-side key directly; remove quotes, whitespace, and accidental Bearer prefixes.
Model fetch fails but the endpoint appears/models response or network pathTest from inside the LibreChat API container and keep one verified fallback ID.
Models appear but chat returns 404Wrong API root or duplicated routeUse the exact /v1 baseURL, not the full chat-completions URL.
Plain chat works but tools or vision failModel or optional-feature semanticsDisable the feature and verify its exact request against current documentation.
429, 5xx, or timeoutRate, upstream, or container networkFollow the API error decision guide and use bounded retries only where safe.

Treat the LibreChat host as a credential boundary

A server-managed provider key can be consumed by every LibreChat user allowed to use that endpoint. Use a dedicated constrained key, restrict endpoint access, keep .env out of source control, protect the admin surface, and monitor usage.

LibreChat also supports user-provided keys, but key flow and model-fetch behavior vary by release and configuration. Verify that mode separately before exposing it to multiple users.

Frequently asked questions

What baseURL belongs in librechat.yaml?

Use https://www.primoraihub.com/v1. Do not append /chat/completions.

Why is models.default required when fetch is true?

LibreChat documents models.default as required and uses it as a fallback if model fetching fails.

Why does the endpoint not appear after editing YAML?

Check the file location, container mount, schema version, YAML indentation, environment interpolation, and whether LibreChat was restarted.

Does plain chat prove every LibreChat feature works?

No. Tools, vision, RAG, memory, MCP, streaming details, and other features require separate model- and endpoint-specific verification.