AI translation

AI translation with large language models, supporting translation between 34 languages

Endpoint

POST
https://api-fanyi.qzhua.net/api/v1/translate

Request headers

NameDescription
Content-Typeapplication/json
AuthorizationFormat: `Bearer YourAPIKey`. You can get an API key from your avatar at the top -> Admin panel -> API Key.

Request parameters

NameTypeRequiredDescription
textstringYesThe text to translate.
sourceLangstringNoSource language code, default `auto`.
targetLangstringNoTarget language code, default `en`.
mode"default" | "style" | "structured"NoTranslation mode, default `default`.
stylestringNoOnly used in `style` mode, e.g. `professional`.
formatTypestringNoOnly used in `structured` mode, e.g. `JSON`, `Markdown`.
glossaryArray<{ sourceText: string; targetText: string }>NoGuests can send a glossary with the request; for signed-in users the backend reads the account glossary automatically.
temporaryGlossaryArray<{ sourceText: string; targetText: string }>NoRequest-scoped terms apply only to this translation and are not saved to the account. Guests and signed-in users can send up to 50 entries. Source and target must be non-empty single lines of at most 128 Unicode characters; source terms must be unique. Signed-in users’ account glossary remains active; temporary terms take precedence on an exact source match. Example: [{"sourceText":"Elena","targetText":"艾琳娜"}].
streambooleanNo`true` returns SSE, `false` returns JSON.

Rate limit

Limited per account in requests per minute (RPM). Text translation, OCR, speech translation and document translation share one counter, with these limits: Free 120 / minute, VIP 300 / minute, SVIP 600 / minute, administrators unlimited. Exceeding the limit returns 429 with the error code RATE_LIMIT_EXCEEDED. Signed-out visitors are limited separately by IP, and this rule doesn't apply to them.

Supported languages

常用

auto自动检测
zh简体中文
zh-Hant繁体中文
en英语
ja日语
ko韩语
fr法语
de德语
ru俄语
es西班牙语
pt葡萄牙语
it意大利语

亚洲

ar阿拉伯语
tr土耳其语
th泰语
vi越南语
ms马来语
id印尼语
tl他加禄语
hi印地语
km高棉语
my缅甸语
fa波斯语
gu古吉拉特语
ur乌尔都语
te泰卢固语
mr马拉地语
he希伯来语
bn孟加拉语
ta泰米尔语
kk哈萨克语

欧洲

pl波兰语
cs捷克语
nl荷兰语
uk乌克兰语

Try it online

Check the request body and the response.

Request body preview
{
  "text": "你好,世界",
  "sourceLang": "auto",
  "targetLang": "en",
  "mode": "default"
}
Actual response
{
  "text": "The actual response will appear here"
}

Response example

JSON
{
  "text": "Hello, world"
}