> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ruapi.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# LibreChat

> How to add RuAPI to LibreChat as a custom endpoint via librechat.yaml

[LibreChat](https://www.librechat.ai) 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, all RuAPI models show up in the model picker.

## Prerequisites

<Steps>
  <Step title="RuAPI account and API key">
    Console → **Tokens** → create an `sk-...` key. The balance tops up in USDT — see [Top-up](/en/topup).
  </Step>

  <Step title="A running LibreChat">
    Install per the [LibreChat docs](https://www.librechat.ai/docs) (usually Docker).
  </Step>
</Steps>

## Setup

<Steps>
  <Step title="Add the key to .env">
    ```bash theme={null}
    RUAPI_KEY=sk-YOUR_KEY
    ```
  </Step>

  <Step title="Describe the endpoint in librechat.yaml">
    ```yaml theme={null}
    endpoints:
      custom:
        - name: "RuAPI"
          apiKey: "${RUAPI_KEY}"
          baseURL: "https://www.ruapi.ai/v1"   # with /v1
          models:
            default: ["claude-opus-4-8"]        # exact names on the pricing page
            fetch: true                          # pull the full catalog via /v1/models
          titleConvo: true
          titleModel: "claude-opus-4-8"
    ```
  </Step>

  <Step title="Restart LibreChat">
    Reload the config (restart the container). A **RuAPI** provider appears in the UI.
  </Step>
</Steps>

<Note>
  `fetch: true` pulls the model list automatically via `/v1/models`. If you'd rather not auto-list, drop `fetch` and list the IDs you want in `default`.
</Note>

## Verify

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

## Troubleshooting

<AccordionGroup>
  <Accordion title="The RuAPI provider didn't appear">
    * Check the indentation in `librechat.yaml` (YAML is whitespace-sensitive) and that the block sits under `endpoints.custom`.
    * Make sure the container reloaded the config after your edits.
  </Accordion>

  <Accordion title="Empty model list / 401">
    * `baseURL` must be `https://www.ruapi.ai/v1` with `/v1`.
    * The `RUAPI_KEY` in `.env` must hold the RuAPI token (`sk-...`), and `apiKey` must reference it via `${RUAPI_KEY}`.
  </Accordion>

  <Accordion title="Conversation titles aren't generated">
    Check `titleConvo: true` and that `titleModel` points to an available model.
  </Accordion>
</AccordionGroup>
