Skip to main content
LibreChat is a self-hosted, ChatGPT-style web interface with support for many providers. RuAPI is added as a custom endpoint in librechat.yaml — after that, the RuAPI models you list show up in the model picker.

Prerequisites

1

RuAPI account and API key

Console → API Keys → create an sk-... key. Every account in your LibreChat will use this key, so give it a budget: turn off Unlimited and enter an amount. The balance tops up in USDT — see Top-up.
2

LibreChat

Install per the LibreChat docs (usually Docker): git clone https://github.com/LibreChat-AI/LibreChat.git, cd LibreChat, cp .env.example .env.

Setup

1

Add the key to .env

2

Mount librechat.yaml into the container (Docker)

The container does not read librechat.yaml on its own — the file has to be mounted. Copy the example with cp docker-compose.override.yml.example docker-compose.override.yml and uncomment the services: line and the config block:
3

Add RuAPI to librechat.yaml

Create librechat.yaml next to .env:
4

Restart LibreChat

docker compose down && docker compose up -d. Open http://localhost:3080 — a RuAPI provider with the models from default appears in the model picker.
fetch: true instead of a manual list pulls the whole RuAPI catalog via /v1/models, image and video models included, so listing the IDs you need in default is usually tidier. LibreChat sends a separate request to title every new chat; without titleModel it uses the chat’s own model, so hand titles to deepseek-flash.

Claude with prompt caching: a separate Anthropic endpoint

Claude works through the OpenAI-compatible custom endpoint too, but LibreChat sends no cache_control marks there, so only RuAPI auto-caching applies: on the first turn of a new conversation at most the system prompt is cached, and after a gap of more than 5 minutes the cache expires and the whole chat history is billed again. Add a second item under custom with provider: "anthropic" — LibreChat then talks to Claude in the native Anthropic format and turns prompt caching on by itself (see Prompt caching):
List the Claude models by hand: model auto-fetch is not used for provider: "anthropic". Thinking is on by default in this endpoint, and thinking tokens are billed as output.

Verify

In the UI, pick the RuAPI provider and a model, then send a message. A reply plus an entry in RuAPI Console → Usage Logs confirms the wiring.

Troubleshooting

  • Check that librechat.yaml is mounted into the container via docker-compose.override.yml (the “Mount librechat.yaml into the container” step).
  • Check the indentation in librechat.yaml (YAML is whitespace-sensitive) and that the block sits under endpoints.custom. Parse errors show up in docker compose logs api.
  • Make sure the containers were restarted after your edits.
  • 401: RUAPI_KEY in .env must hold the full RuAPI key (sk-...), and apiKey must reference it via ${RUAPI_KEY}.
  • 404: the OpenAI-compatible endpoint needs baseURL https://www.ruapi.ai/v1 with /v1; the provider: "anthropic" endpoint needs https://www.ruapi.ai without /v1.
Until the first top-up only claude-haiku-5-5, deepseek-flash and gpt-6-luna work. Error codes — Errors.
Check titleConvo: true and that titleModel points to an available model.