Put the whole catalog behind one LibreChat endpoint
LibreChat is the open-source, self-hosted ChatGPT-style chat interface, and any OpenAI-compatible API can be added to it as a custom endpoint in librechat.yaml. One entry pointing at Router One puts GPT, Claude, Gemini, and DeepSeek family models in the endpoint menu for every user on your instance — and each conversation is traced for cost on the gateway, so a shared deployment stops being one opaque bill.
Configure LibreChat to use the Router One base URL
Add an entry under endpoints.custom in librechat.yaml — the file is mounted into the API container as /app/librechat.yaml — with the gateway base URL, an apiKey that references a variable from your .env file, and models.fetch set to true so the list is pulled from the gateway's /models endpoint. The models.default array is the fallback shown if that fetch fails, and titleConvo lets the endpoint name new conversations with the model in use:
# librechat.yaml — add under your existing endpoints: key
endpoints:
custom:
- name: "Router One"
apiKey: "${ROUTER_ONE_API_KEY}"
baseURL: "https://api.router.one/v1"
models:
default: ["<model-id-from-/models>"]
fetch: true
titleConvo: true
titleModel: "current_model"
modelDisplayLabel: "Router One"
# .env
ROUTER_ONE_API_KEY=sk-your-router-one-keyWhich model ID should LibreChat send?
Copy the exact model ID from the /models page — IDs are case-sensitive, and the page lists each model's context window, capabilities, and current per-token rates. Create a dedicated API key per tool with its own maxSpend cap, so one runaway tool can't affect other workloads.
Verify the LibreChat call in your request trace
After your first request, open Dashboard → Logs to see its full trace: model, tokens, cost, latency, and status code. From here every LibreChat call has a ledger and a trail instead of being a black box.
FAQ
Should I use models.fetch or a static model list?
Use fetch: true when you want every catalog model to appear as soon as it exists — LibreChat queries the gateway's /models endpoint, and the default array is only the fallback if that request fails. Use fetch: false with an explicit default list when you want to curate what users see, say three models with the exact IDs from /models; users can then only pick what you listed.
Can users bring their own Router One key?
Yes — set apiKey to user_provided instead of an environment reference and LibreChat asks each user for a key in the UI. Each user's spend then lands on their own key and its own trace, which is the simplest way to split a shared instance's bill without touching your wallet.
Which models can LibreChat use through the gateway?
Any chat-capable model in the catalog — GPT, Claude, Gemini, Grok, DeepSeek, GLM, MiniMax, and Doubao families. The /models page is the source of truth for model IDs and per-token rates.
Does this work from Mainland China?
Yes. The gateway is reachable from Mainland China without a VPN, and the configuration is identical to the global setup.
How do I debug a 401/403/429?
Open Dashboard → Logs first to see whether requests reached the gateway and with what status, then walk the error-codes reference to check env vars, key status, and limits.