API Integration Development Guide
Qwen3-MT provides a standardized API service interface, and developers can complete the integration through the following steps:
- Acquisition Voucher::
1) Register for a Model Studio account
2) At https://qwenlm.github.io/blog/qwen-mt/申请API Key - environmental preparation::
Ensure a Python 3.8+ environment with the requests library installed:pip install requests
- base call::
Refer to the following Python sample code:import requests
data = {
"source_text": "待翻译文本",
"source_lang": "zh",
"target_lang": "en",
"domain": "legal"
}
response = requests.post(API_ENDPOINT, headers=headers, json=data)
Advanced Integration Features::
- batch file: Pass text_array in data to realize parallel translation of multiple texts.
- terminology binding: Associate pre-stored thesaurus IDs with the terminology parameter
- conversational memory: Maintaining context consistency with memory_id
Note: API default QPS limit is 10 times/second, enterprise users can contact AliCloud to adjust the quota. Response data is in JSON format, need to deal with possible 400/500 status code.
This answer comes from the articleQwen3-MT: An Intelligent Translation Tool Supporting 92 LanguagesThe