Use LibreChat with a private API
Connect LibreChat to the private Morse API: set it up, pick a model, and check it works.
LibreChat is an open-source, self-hosted chat app that puts many providers' models in one interface. It speaks the OpenAI API, so it works with Morse: give it the base URL https://inference.trymorse.ai/v1 and a Morse API key, and its requests run on Morse's private inference, where Morse keeps nothing and no provider learns who you are.
Before you start
In the console, open API keys and make a key for LibreChat alone, with a spend limit, so a runaway session can't spend all your credits. See Limit a key.
Then add it to the .env file in your LibreChat folder:
MORSE_API_KEY=sk_morse_...Set up LibreChat
Add Morse as an endpoint
Add Morse under
endpoints.custominlibrechat.yaml, in your LibreChat folder. It names Morse's base URL and the variable your key is in.fetch: truelists every model Morse serves, anddefaultis the list LibreChat shows first.librechat.yaml version: 1.3.19 cache: true endpoints: custom: - name: "Morse" apiKey: "${MORSE_API_KEY}" baseURL: "https://inference.trymorse.ai/v1" models: default: ["moonshotai/kimi-k2.7-code"] fetch: true titleConvo: true titleModel: "current_model" modelDisplayLabel: "Morse"Mount the file
With Docker, copy
docker-compose.override.yml.exampletodocker-compose.override.ymland mount the file there:docker-compose.override.yml services: api: volumes: - type: bind source: ./librechat.yaml target: /app/librechat.yamlRestart LibreChat
LibreChat reads the file and the key as it starts.
Terminal docker compose down && docker compose up -d
Which model to pick
| Model | Context | Input / output | Why |
|---|---|---|---|
moonshotai/kimi-k2.7-code | 262.1K | $0.95 / $4 | Kimi's coding model. It doesn't reason, so it starts writing sooner. |
moonshotai/kimi-k3.1-pro | 1M | $2 / $10 | Reasons, and reads images. |
z-ai/glm-5.3 | 1M | $1.40 / $4.40 | Reasons, and takes tools at TEE too. |
deepseek/deepseek-v4-pro-0813 | 1M | $1.32 / $3.96 | Reasons, at a lower price. |
z-ai/glm-5.3-flash | 1M | $0.15 / $0.50 | Cheap and fast for small edits, and takes tools at TEE too. |
Prices are in dollars per million tokens, on each model's default endpoint. Every model is on the models page.
Check it works
Open LibreChat, choose Morse in the endpoint menu, then moonshotai/kimi-k2.7-code, and send a message. The reply streams in from Morse, and LibreChat titles the chat with the same model.
Keep it private
A request runs on its model's default privacy tier. To hold LibreChat to a tier, such as one where only attested hardware reads your prompts, set a privacy floor on its key. See Privacy tiers and Provider routing.
If something goes wrong
| What you see | What to do |
|---|---|
401 | The key is missing or wrong. Check that MORSE_API_KEY is set where LibreChat starts, and that the key isn't revoked. |
402 | Add credits, or raise the key's limit. Morse holds credit for a request's output limit before it starts. See Holds. |
404 | Use a model's id exactly as the table above writes it, lab and all. |
Every code is in Errors. For other tools, see Coding agents and editors.