---
title: "LibreChat 中转配置：librechat.yaml 自定义端点"
canonical: https://relayswitch.ai/zh/guides/librechat
generated: 2026-11-12T04:32:50.477Z
source: https://api.relayswitch.io/v1/catalog
base_url: https://api.relayswitch.io/v1
---

配置教程 · 核对于 2026-10-31

# LibreChat 中转配置

在 librechat.yaml 里加一个自定义端点：baseURL 带 /v1，密钥放 .env，模型 id 写进 models.default。

## 配置步骤

1.  在 `.env` 里加一行 `RELAYSWITCH_KEY`，值是完整密钥。
2.  在 `librechat.yaml` 的 `endpoints.custom` 下加一项，`apiKey` 写成 `${RELAYSWITCH_KEY}`，从 `.env` 读取。
3.  `baseURL` 填 `https://api.relayswitch.io/v1`，保留 `/v1`；LibreChat 自己拼 `/chat/completions`。
4.  `models.default` 列出模型页上的 id，例如 `claude-sonnet-5-5`；`fetch: false` 让下拉列表只显示这几个。
5.  `titleModel` 填一个便宜的小模型，用来给对话起标题。
6.  用 Docker 部署时，在 `docker-compose.override.yml` 里把 `./librechat.yaml` 挂载到 `/app/librechat.yaml`，然后重启。

yaml

1`# .env`

2`RELAYSWITCH_KEY=sk-relay-你的密钥`

3

4`# librechat.yaml`

5`version: 1.3.18`

6`cache: true`

7`endpoints:`

8 `custom:`

9 `- name: 'RelaySwitch'`

10 `apiKey: '${RELAYSWITCH_KEY}'`

11 `baseURL: 'https://api.relayswitch.io/v1'`

12 `models:`

13 `default: ['claude-sonnet-5-5', 'gpt-5.5', 'gemini-3.5-flash', 'deepseek-v4-pro', 'glm-5.3']`

14 `fetch: false`

15 `titleConvo: true`

16 `titleModel: 'claude-haiku-5-5'`

17 `modelDisplayLabel: 'RelaySwitch'`

资料来源：LibreChat 文档 [Custom Endpoint 字段](https://www.librechat.ai/docs/configuration/librechat_yaml/object_structure/custom_endpoint) 与 [自定义端点快速上手](https://www.librechat.ai/docs/quick_start/custom_endpoints)（读取于 2026-10-31）。

## 推荐模型

id 照抄到模型字段。价格渲染时读取自目录；人民币为参考价，计费以美元为准。

| 模型 | 开发商 | 输入 / 百万 | 输出 / 百万 |
| --- | --- | --- | --- |
| [Claude Sonnet 5.5](https://relayswitch.ai/zh/models/claude-sonnet-5-5)claude-sonnet-5-5 | Anthropic | $1.20≈ ¥8.16 | $3.00≈ ¥20.41 |
| [GPT-5.5](https://relayswitch.ai/zh/models/gpt-5.5)gpt-5.5 | OpenAI | $1.80≈ ¥12.25 | $9.00≈ ¥61.24 |
| [Gemini 3.5 Flash](https://relayswitch.ai/zh/models/gemini-3.5-flash)gemini-3.5-flash | Google | $1.50≈ ¥10.21 | $9.00≈ ¥61.24 |
| [DeepSeek V4 Pro 0423](https://relayswitch.ai/zh/models/deepseek-v4-pro)deepseek-v4-pro | DeepSeek | $0.792≈ ¥5.39 | $2.376≈ ¥16.17 |
| [GLM 5.3](https://relayswitch.ai/zh/models/glm-5.3)glm-5.3 | Z.ai | $0.3178≈ ¥2.16 | $0.9987≈ ¥6.80 |

美元 / 百万 tokens，人民币参考价按 ECB 2026-11-11 汇率

## 一次会话多少钱

30 轮对话：每轮 2,000 输入 tokens、500 输出 tokens。这个大小是假设；控制台的用量页显示每次请求的真实 tokens 和费用。

| 模型 | 一次会话 |
| --- | --- |
| GLM 5.3glm-5.3 | $0.034≈ ¥0.232 |
| DeepSeek V4 Pro 0423deepseek-v4-pro | $0.0832≈ ¥0.566 |
| Claude Sonnet 5.5claude-sonnet-5-5 | $0.117≈ ¥0.796 |
| Gemini 3.5 Flashgemini-3.5-flash | $0.225≈ ¥1.53 |
| GPT-5.5gpt-5.5 | $0.243≈ ¥1.65 |

按目录实时价计算；人民币参考价按 ECB 2026-11-11 汇率。

## 验证是否接通

先用 curl 列出密钥能调用的模型 id，再在工具里发第一条消息。

bash

1`curl https://api.relayswitch.io/v1/models \`

2 `-H "Authorization: Bearer sk-relay-你的密钥"`

两条都通，剩下的问题就在工具的字段里。请求几秒内出现在控制台的用量页。

常见问题

## 常见问题

LibreChat 接入时最常见的五个问题。

打开控制台

一分钟内拿到密钥

[获取密钥](https://app.relayswitch.io/console?lang=zh)

或发邮件至 [hello@relayswitch.io](mailto:hello@relayswitch.io)

### 

### 

### 

### 

### 

相关页面

-   [全部配置教程](https://relayswitch.ai/zh/guides)
-   [文档](https://relayswitch.ai/zh/docs)
-   [充值](https://relayswitch.ai/zh/pay)
-   [每日真实模型检测](https://relayswitch.ai/zh/proof)
-   [模型与价格](https://relayswitch.ai/zh/models)
-   [English guide](https://relayswitch.io/guides/librechat)

## 在 LibreChat 里用一个密钥调用全部模型

USDT 充值，按 token 预付，无订阅。Base URL https://api.relayswitch.io/v1。

[模型与价格](https://relayswitch.ai/zh/models)[获取密钥](https://app.relayswitch.io/console?lang=zh)

