# LibreChat

> Add a custom endpoint in librechat.yaml to bring TokRouter into a self-hosted LibreChat.

Add a custom endpoint in `librechat.yaml`:

```yaml
version: 1.2.8
endpoints:
  custom:
    - name: "TokRouter"
      apiKey: "${TOKROUTER_API_KEY}"
      baseURL: "https://api.tokrouter.dev/v1"
      models:
        default: ["claude-opus-5-5", "gpt-5.4-mini", "deepseek-v4-pro"]
        fetch: true
      titleConvo: true
      modelDisplayLabel: "TokRouter"
```

Provide the key in `.env`:

```bash
TOKROUTER_API_KEY=sk-xxxxxxxx
```

Restart LibreChat and a `TokRouter` group appears in the model selector.

<Callout type="info" title="fetch: true">
`fetch: true` makes LibreChat call `/v1/models`, so newly published models appear without editing the
config. `models.default` is only the default selection.
</Callout>

`version` must match what your LibreChat release supports; the snippet above is the 1.2.x form.
