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

# LibreChat

> Add Opper as a custom endpoint in LibreChat, the self-hosted open-source AI chat platform

[LibreChat](https://www.librechat.ai) is an open-source AI chat platform (MIT, [source](https://github.com/danny-avila/LibreChat)) — a self-hosted, multi-user ChatGPT-style interface with conversation branching, presets, and file uploads.

It takes any OpenAI-compatible provider as a custom endpoint in `librechat.yaml`.

## Setup

Add Opper under `endpoints.custom`:

```yaml theme={null}
endpoints:
  custom:
    - name: 'Opper'
      apiKey: '${OPPER_API_KEY}'
      baseURL: 'https://api.opper.ai/v3/compat'
      models:
        default: ['anthropic/claude-sonnet-4-6', 'openai/gpt-5.5']
        fetch: true
      titleConvo: true
      modelDisplayLabel: 'Opper'
```

Then set the key in your `.env` and restart:

```bash theme={null}
OPPER_API_KEY=your-opper-api-key
```

`fetch: true` makes LibreChat pull the catalog from `GET /v3/compat/models` at startup, so the picker fills itself. Set it to `false` and rely on `models.default` if you'd rather pin an explicit list.

<Note>
  Use the `${VAR}` env-var syntax rather than pasting the key into `librechat.yaml` — the file is usually committed alongside your deployment.
</Note>

## Choosing a model

With `fetch: true`, LibreChat lists everything your key can reach, filtered by your [model access rules](/control-plane/rules/model-access). The catalog is large, so a curated `models.default` list is often the nicer experience for end users.

## Multi-user usage

LibreChat is typically multi-tenant. Forward per-user tags with the `X-Opper-Tags` header to break usage down by user or workspace in Opper analytics — see [Tags and usage attribution](/build/gateway/usage-attribution).

## Troubleshooting

<AccordionGroup>
  <Accordion title="The endpoint doesn't appear">
    LibreChat reads `librechat.yaml` at startup only. Restart the container or process after editing it.
  </Accordion>

  <Accordion title="The model list is huge">
    Set `fetch: false` and list the models you want in `models.default`.
  </Accordion>

  <Accordion title="401 Unauthorized">
    The `${OPPER_API_KEY}` reference is resolved from LibreChat's environment, not your shell. Confirm it's in the `.env` the process actually loads.
  </Accordion>
</AccordionGroup>

## Related

<CardGroup cols={2}>
  <Card title="Tags and usage attribution" icon="tag" href="/build/gateway/usage-attribution">
    Split usage per user or workspace.
  </Card>

  <Card title="Open WebUI" icon="https://mintcdn.com/opper/H-iiE_tAhHpUz1kK/images/tools/open-webui.svg?fit=max&auto=format&n=H-iiE_tAhHpUz1kK&q=85&s=f0c41d00db16b95e8ed4887e9f4b7c54" href="/integrations/chat/open-webui" width="500" height="500" data-path="images/tools/open-webui.svg">
    The other self-hosted chat workspace.
  </Card>
</CardGroup>
