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.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
Install LibreChat
Add the API key to .env
.env file:<orq-api-key> with the key from Organization > API Keys.Add the AI Gateway endpoint to librechat.yaml
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-4o) from Workspace Settings → Models.Mount the config and restart
librechat.yaml only when it is mounted into the container. After mounting, recreate the containers so the new .env and config are loaded:mongodb container crash-loops. Pin mongo:4.4.18 in docker-compose.override.yml to fix it.Configuration Reference
| Field | Description |
|---|---|
name | Endpoint label shown in the model picker. |
apiKey | References the .env variable holding the Orq.ai key, e.g. ${ORQ_API_KEY}. |
baseURL | Set to https://api.orq.ai/v3/router for all AI Gateway models. |
models.fetch | When true, populates the picker live from the catalog. Recommended. |
models.default | Fallback list of provider-prefixed IDs. |
titleConvo | When true, fires a second call to titleModel to name each conversation. |
titleModel | Model used to generate conversation titles. |
Troubleshooting
The orq endpoint or its models do not appear
The orq endpoint or its models do not appear
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
fetch: false. Set fetch: true to populate the picker from the AI Gateway catalog, and confirm baseURL is https://api.orq.ai/v3/router.Requests do not appear in Orq.ai Traces
Requests do not appear in Orq.ai Traces
apiKey resolves to a valid Orq.ai API key and baseURL is https://api.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.