Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
"openrouter",
"perplexity",
"portkey",
"routerplex",
"shuttleai",
"togetherai",
"truefoundry",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: RouterPlex
icon: Plug
description: Configure RouterPlex as a custom endpoint in LibreChat.
---

RouterPlex is a hosted gateway that routes requests to models from Anthropic, OpenAI, Google, DeepSeek, Moonshot, Alibaba, and other vendors through a single OpenAI-compatible endpoint. Usage is billed at vendor list price from a prepaid balance, and each API key can have its own hard USD budget.

## Get an API key

Create an account at [routerplex.com](https://routerplex.com/), add credit from the billing page (card or crypto), and create a key from the [dashboard](https://routerplex.com/dashboard). Add it to your `.env` file:

```bash filename=".env"
ROUTERPLEX_API_KEY=your-api-key
```

Set a budget on the key when you create it. Requests fail once the key reaches its budget, which caps what a single LibreChat deployment can spend.

## Configuration

Add the endpoint to the `custom` list under `endpoints` in your `librechat.yaml`. If your file already has an `endpoints.custom` list, paste only the `- name:` entry into it, keeping the same indentation:

```yaml filename="librechat.yaml"
endpoints:
custom:
- name: "RouterPlex"
apiKey: "${ROUTERPLEX_API_KEY}"
baseURL: "https://api.routerplex.com/v1"
models:
default: ["claude-sonnet-4-6", "gpt-6-sol", "deepseek-v4-pro"]
fetch: true
titleConvo: true
titleModel: "deepseek-v4-flash"
modelDisplayLabel: "RouterPlex"
```

To pin a fixed model list instead of fetching the catalog, set `fetch: false` and list the models yourself:

```yaml filename="librechat.yaml"
models:
default: ["claude-sonnet-4-6", "gpt-6-sol", "gemini-3.1-pro", "deepseek-v4-pro"]
fetch: false
```

To let each user supply their own key through the LibreChat UI instead of reading one from `.env`, set `apiKey: "user_provided"`.

## Notes

- Model IDs are used exactly as listed, with no vendor prefix, and are case-sensitive. The live list, with context windows and prices per million tokens, is at [routerplex.com/api/models](https://routerplex.com/api/models).
- With `fetch: true`, LibreChat loads the model list for your key from RouterPlex, so new models appear automatically. The `default` array is only the initial selection.
- `gpt-image-2` in the catalog is an image model, not a chat model. Keep it out of chat model lists.
- A `402` response means the account balance is used up. A `403` means the key reached its own budget or the model is not on its allowlist. Both come from RouterPlex, not LibreChat. Add credit or raise the key's budget in the dashboard, then retry.
- Create a separate key for LibreChat so its budget and usage logs stay apart from your other tools.