本次请求
接口速查
全部接口都不需要 Key。渠道用 模型名前缀 区分:microsoft/mt、google/mt、volcengine/mt、bilibili/llm;也可用 mt / llm 走默认渠道。
1. 机器翻译(DeepLX 格式,陪读蛙 / Pot / 沉浸式翻译通用)
curl -s http://127.0.0.1:3100/translate \
-H "Content-Type: application/json" \
-d '{"text":"Hello world","source_lang":"auto","target_lang":"ZH"}'
2. 机器翻译(DeepL 官方格式)
curl -s http://127.0.0.1:3100/v2/translate \
-H "Content-Type: application/json" \
-d '{"text":["Hello world"],"target_lang":"ZH"}'
3. 大模型翻译(OpenAI 格式,支持 stream)
curl -s http://127.0.0.1:3100/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{"model":"bilibili/llm","messages":[{"role":"user","content":"Translate into Chinese:\n\nHello world"}]}'
# 也可以直接用官方模型(GET /v1/models 里列出的任意 id,原样透传)
-d '{"model":"Index-Translate-9B","messages":[...]}'
4. 指定渠道(三种写法等价)
POST /google/translate # 路径前缀
POST /translate?channel=google # 查询参数
POST /translate -d '{"text":"hi","target_lang":"ZH","model":"google/mt"}'
客户端接入
陪读蛙 readfrog
设置 → API 提供商 → DeepLX:接口地址填
http://你的域名/translate;或选 OpenAI 兼容,BaseURL 填 http://你的域名/v1,模型填 bilibili/llm沉浸式翻译
翻译服务 → DeepLX(自定义):
http://你的域名/translate;或 OpenAI:BaseURL http://你的域名/v1,模型 bilibili/llmPot / KISS / Bob
DeepL 自定义接口:
http://你的域名/v2/translate,密钥随意填(不校验)NextChat / LobeChat
OpenAI 接口地址
http://你的域名/v1,模型 bilibili/llm若部署时设置了 ACCESS_TOKEN,请在密钥处填入该令牌(支持 Authorization: Bearer 与 DeepL-Auth-Key 两种写法)。