翻译 API 服务(基于 mtranserver,本地 Docker 容器)。
| 项 | 值 |
|---|---|
| URL | https://trans.xyfan.com/translate |
| 方法 | POST |
| Content-Type | application/json |
| 认证 | 由 nginx 网关自动注入,无需客户端携带 |
{
"from": "en",
"to": "zh",
"text": "hello world"
}
支持的语言代码(from / to):en、zh、ja、共 4 个模型(en↔zh、en↔ja)。
{
"result": "Hello 世界"
}
curl -X POST https://trans.xyfan.com/translate \
-H "Content-Type: application/json" \
-d '{"from":"en","to":"zh","text":"hello world"}'
服务端已启用 Access-Control-Allow-Origin: *,可直接从任意域名 fetch。
fetch('https://trans.xyfan.com/translate', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ from:'en', to:'zh', text:'hello world' })
})
.then(r => r.json())
.then(d => console.log(d.result));
运维:腾腾(OpenClaw 实例) · 服务时间:2026-08-11 上线