Compatibility boundary
Use LibreChat’s OpenAI-compatible custom endpoint path
LibreChat’s official custom endpoint object supports an endpoint name, API key, base URL, and model list. An endpoint without a native provider setting uses the OpenAI-compatible custom endpoint behavior. This tutorial maps that documented shape to ScriptEngine’s verified bearer-authenticated /v1/models and /v1/chat/completions surface.
LibreChat can expose additional parameters, tools, files, and provider-specific modes. Those client features are not automatically supported by every model behind an OpenAI-compatible chat endpoint. Establish ordinary text chat first and only enable a feature after testing its exact request.
Use LibreChat’s official custom endpoint reference for the current YAML schema. The field names and defaults may change between LibreChat releases.
Requirements
Discover a model and prepare a private key
- Run LibreChat using its current official installation instructions.
- Create a private ScriptEngine API key and store it in the environment used by LibreChat.
- Use that key to discover a current model ID before writing
librechat.yaml.
export SCRIPTENGINE_API_KEY="YOUR_PRIVATE_KEY"
curl https://scriptengine.org/v1/models \
-H "Authorization: Bearer $SCRIPTENGINE_API_KEY"
Use an exact text-capable ID returned by the authenticated response. If you disable model fetching, list that ID under models.default; do not rely on a stale screenshot or a model name copied from another provider.
Configuration
Define the custom endpoint in librechat.yaml
Place this endpoint block in the LibreChat configuration file used by your deployment. Keep the API key in an environment variable and start with one known model.
endpoints:
custom:
- name: ScriptEngine
apiKey: ${SCRIPTENGINE_API_KEY}
baseURL: https://scriptengine.org/v1
models:
default:
- MODEL_ID_FROM_DISCOVERY
fetch: true
titleConvo: true
titleTiming: immediate
modelDisplayLabel: ScriptEngine
If your LibreChat version does not fetch the catalog correctly, set fetch: false and keep the discovered ID in models.default. Do not set provider: anthropic; that selects the native Anthropic Messages path rather than the OpenAI-compatible path described here.
Verification
Test the same request outside LibreChat
A direct request gives you a clean baseline before you investigate YAML, Docker environment loading, or UI behavior.
curl https://scriptengine.org/v1/chat/completions \
-H "Authorization: Bearer $SCRIPTENGINE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"model":"MODEL_ID_FROM_DISCOVERY","messages":[{"role":"user","content":"Reply with exactly: LibreChat connected"}]}'
Once the direct call succeeds, restart LibreChat so it reads the environment and YAML configuration, select the ScriptEngine endpoint, and repeat the short prompt. Avoid sending private documents until the basic path is confirmed.
Troubleshooting
Resolve common LibreChat errors
- 401 or unauthorized
- Check that the container or process received
SCRIPTENGINE_API_KEY. Run/v1/modelswith that same environment and rotate the key if it was copied into logs or a repository. - Model list is empty
- Confirm that
baseURLis exactlyhttps://scriptengine.org/v1and that model fetching is enabled. If fetching is unavailable in your release, list a current discovered ID manually. - 404 or duplicated route
- Set the API root in
baseURL, not the full/chat/completionspath. LibreChat appends the OpenAI-compatible route. - Tools, files, or vision fail
- Return to the text-only baseline. A chat-completions success does not establish tool calling, image input, embeddings, audio, or Responses API support.
Cost and safety
Control context and prepaid spend
LibreChat conversations can grow as history and attachments accumulate. Start with a small prepaid balance, check the current model rates, and monitor usage in the ScriptEngine workspace. The published 86% figure is a dated, model-specific reference maximum rather than a guaranteed LibreChat discount.
Keep the key in environment configuration and never commit librechat.yaml with a real secret. ScriptEngine currently publishes no uptime or response-time SLA; production users should set their own timeouts, backups, and recovery plan.
Sources and next steps
Use the official LibreChat schema for upgrades
This page was checked August 4, 2026 against LibreChat’s custom endpoint documentation and ScriptEngine’s published API contract. Re-check the official reference after upgrading LibreChat.