Overview
LibreChat is an open-source, self-hosted chat interface. Adding the AI Gateway as a custom endpoint routes every conversation through Orq.ai, exposing the full model catalog with unified tracing and cost tracking.Custom endpoints exist only in
librechat.yaml; LibreChat has no UI for adding an OpenAI-compatible provider. This page covers model routing and tracing only.Prerequisites
- Docker installed
- Active Orq.ai account
- Orq.ai API key
Setup
1
Install LibreChat
Clone the repository and create the environment file. For other install methods, see the LibreChat Docker guide:
2
Add the API key to .env
3
Add the AI Gateway endpoint to librechat.yaml
Add a custom endpoint under a single top-level With
endpoints key:fetch: true, the picker is populated live from the AI Gateway, so every enabled model appears automatically; default is only a fallback. Use provider-prefixed IDs (for example openai/gpt-5.6-sol) from Workspace Settings → Models.4
Mount the config and restart
LibreChat reads
librechat.yaml only when it is mounted into the container. After mounting, recreate the containers so the new .env and config are loaded:Apple Silicon: the default MongoDB image requires AVX instructions that Apple Silicon does not expose under virtualization, so the
mongodb container crash-loops. Pin mongo:4.4.18 in docker-compose.override.yml to fix it.Configuration Reference
Troubleshooting
The orq endpoint or its models do not appear
The orq endpoint or its models do not appear
The custom endpoint did not load. Confirm
ORQ_API_KEY is set in .env, that there is exactly one top-level endpoints key in librechat.yaml, and that the file is mounted into the container. See the LibreChat config docs.Only a few models appear in the picker
Only a few models appear in the picker
The endpoint is running with
fetch: false. Set fetch: true to populate the picker from the AI Gateway catalog, and confirm baseURL is https://my.orq.ai/v3/router.Requests do not appear in Orq.ai Traces
Requests do not appear in Orq.ai Traces
Confirm
apiKey resolves to a valid Orq.ai API key and baseURL is https://my.orq.ai/v3/router. Requests sent to another endpoint will not appear in Traces.Two requests traced per message
Two requests traced per message
titleConvo: true fires a second call to titleModel to name the conversation. This is expected. Set titleConvo: false to disable it, or point titleModel at a cheaper model.