AI translation
AI translation with large language models, supporting translation between 34 languages
Endpoint
POST
https://api-fanyi.qzhua.net/api/v1/translateRequest headers
| Name | Description |
|---|---|
| Content-Type | application/json |
| Authorization | Format: `Bearer YourAPIKey`. You can get an API key from your avatar at the top -> Admin panel -> API Key. |
Request parameters
| Name | Type | Required | Description |
|---|---|---|---|
| text | string | Yes | The text to translate. |
| sourceLang | string | No | Source language code, default `auto`. |
| targetLang | string | No | Target language code, default `en`. |
| mode | "default" | "style" | "structured" | No | Translation mode, default `default`. |
| style | string | No | Only used in `style` mode, e.g. `professional`. |
| formatType | string | No | Only used in `structured` mode, e.g. `JSON`, `Markdown`. |
| glossary | Array<{ sourceText: string; targetText: string }> | No | Guests can send a glossary with the request; for signed-in users the backend reads the account glossary automatically. |
| temporaryGlossary | Array<{ sourceText: string; targetText: string }> | No | Request-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":"艾琳娜"}]. |
| stream | boolean | No | `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"
}