## Basic tool info Model name: tencent/Hy-MT2-7B Model description: Tencent’s Hy-MT2-7B is an open-weights multilingual translation model for 30+ languages. It follows glossary, style, and format instructions for faithful output. Model cover: https://cdn.wiro.ai/uploads/models/tencent-hy-mt2-7b-cover.webp Model categories: - tool - bf16 - persistent - fast-inference - price-list - translate Run Task Endpoint (POST): https://api.wiro.ai/v1/Run/tencent/hy-mt2-7b Get Task Detail Endpoint (POST): https://api.wiro.ai/v1/Task/Detail ## Model Inputs: - name: prompt label: Text help: The text to translate. The source language is detected automatically, so there is no source language to pick. Long documents are fine: the output length grows with the input. type: textarea default: 今天,我们很高兴地宣布推出全新的智能翻译服务。它支持三十多种语言之间的互译,能够准确理解上下文,并保留原文的语气和格式。无论是商务邮件、产品说明还是日常对话,您都可以获得自然流畅的译文。 - name: targetLng label: Target Language help: The language to translate into. Hy-MT2 covers 33 languages plus Traditional Chinese, Cantonese and minority languages (Tibetan, Kazakh, Mongolian, Uyghur). type: select default: English options: - value: "Arabic" label: Arabic - value: "Bengali" label: Bengali - value: "Burmese" label: Burmese - value: "Cantonese" label: Cantonese - value: "Chinese" label: Chinese - value: "Czech" label: Czech - value: "Dutch" label: Dutch - value: "English" label: English - value: "Filipino" label: Filipino - value: "French" label: French - value: "German" label: German - value: "Gujarati" label: Gujarati - value: "Hebrew" label: Hebrew - value: "Hindi" label: Hindi - value: "Indonesian" label: Indonesian - value: "Italian" label: Italian - value: "Japanese" label: Japanese - value: "Kazakh" label: Kazakh - value: "Khmer" label: Khmer - value: "Korean" label: Korean - value: "Malay" label: Malay - value: "Marathi" label: Marathi - value: "Mongolian" label: Mongolian - value: "Persian" label: Persian - value: "Polish" label: Polish - value: "Portuguese" label: Portuguese - value: "Russian" label: Russian - value: "Spanish" label: Spanish - value: "Tamil" label: Tamil - value: "Telugu" label: Telugu - value: "Thai" label: Thai - value: "Tibetan" label: Tibetan - value: "Traditional Chinese" label: Traditional Chinese - value: "Turkish" label: Turkish - value: "Ukrainian" label: Ukrainian - value: "Urdu" label: Urdu - value: "Uyghur" label: Uyghur - value: "Vietnamese" label: Vietnamese - name: terminology label: Terminology help: Glossary the translation must follow: one "source=translation" pair per line or separated by ";", e.g. "kredi kartı=credit card; fatura=invoice". Use only one of Terminology, Style, Preferences, Keep Delimiters, Format Type and Context per run. type: textarea default: - name: style label: Style help: Tone or register the translation must follow, e.g. "formal business email", "casual chat", "marketing copy". Use only one of Terminology, Style, Preferences, Keep Delimiters, Format Type and Context per run. type: text default: - name: preferences label: Preferences help: Extra instructions for this translation, one per line or separated by ";", e.g. "Keep brand names in English; Use metric units". Use only one of Terminology, Style, Preferences, Keep Delimiters, Format Type and Context per run. type: textarea default: - name: keepDelimiters label: Keep Delimiters help: Keep separators such as |, ###, or tabs exactly as they are, same count and same places. Useful for subtitle lines or segmented text that is split again after translation. Use only one of Terminology, Style, Preferences, Keep Delimiters, Format Type and Context per run. type: checkbox default: false - name: formatType label: Format Type help: Set this when the text is structured data or markup. Only the user-facing text is translated; keys, tags, code and placeholders such as {name}, {{var}} or %s stay untouched. Use only one of Terminology, Style, Preferences, Keep Delimiters, Format Type and Context per run. type: select default: None options: - value: "None" label: None - value: "JSON" label: JSON - value: "XML" label: XML - value: "YAML" label: YAML - value: "HTML" label: HTML - value: "Markdown" label: Markdown - name: context label: Context help: Background information that helps with ambiguous words, e.g. "A conversation about rivers and fishing" turns "bank" into a riverbank. The context itself is not translated. Use only one of Terminology, Style, Preferences, Keep Delimiters, Format Type and Context per run. type: textarea default: - name: temperature label: Temperature help: Sampling temperature. 0 gives deterministic (greedy) output; 0.7 is the model's recommended value. type: float default: 0.7 - name: topP label: Top P help: Nucleus sampling: only tokens within this cumulative probability are considered. 0.6 is the model's recommended value; 1.0 disables it. type: float default: 0.6 - name: topK label: Top K help: Only the K most likely tokens are considered at each step. 20 is the model's recommended value; 0 disables it. type: number default: 20 - name: repetitionPenalty label: Repetition Penalty help: Discourages repeated words. 1.05 is the model's recommended value; 1.0 disables it. type: float default: 1.05 - name: maxNewTokens label: Maximum New Tokens help: Upper limit on the length of the translation, in tokens. 0 is automatic: twice the input length, at least 4096. If the translation hits the limit, the output is cut off and a warning is logged. type: number default: 0 - name: seed label: Seed help: Leave empty for a random seed. The same seed with identical inputs reproduces the same translation. type: text default: ## Integration Header Prepare ```bash # Sign up Wiro dashboard and create project export YOUR_API_KEY="{{useSelectedProjectAPIKey}}"; export YOUR_API_SECRET="XXXXXXXXX"; # unix time or any random integer value export NONCE=$(date +%s); # hmac-SHA256 (YOUR_API_SECRET+Nonce) with YOUR_API_KEY export SIGNATURE="$(echo -n "${YOUR_API_SECRET}${NONCE}" | openssl dgst -sha256 -hmac "${YOUR_API_KEY}" | awk '{print $NF}')"; ``` ## Run Command - Make HTTP Post Request ```bash curl -X POST "https://api.wiro.ai/v1/Run/tencent/hy-mt2-7b" -H "Content-Type: multipart/form-data" -H "x-api-key: ${YOUR_API_KEY}" -H "x-nonce: ${NONCE}" -H "x-signature: ${SIGNATURE}" -d '{ "prompt": "今天,我们很高兴地宣布推出全新的智能翻译服务。它支持三十多种语言之间的互译,能够准确理解上下文,并保留原文的语气和格式。无论是商务邮件、产品说明还是日常对话,您都可以获得自然流畅的译文。", "targetLng": "English", "terminology": "", "style": "", "preferences": "", "keepDelimiters": false, "formatType": "None", "context": "", "temperature": "0.7", "topP": "0.6", "topK": 20, "repetitionPenalty": "1.05", "maxNewTokens": 0, "seed": "", "callbackUrl": "You can provide a callback URL; Wiro will send a POST request to it when the task is completed." }'; ``` ## Run Command - Response ```json { "errors": [], "taskid": "2221", "socketaccesstoken": "eDcCm5yyUfIvMFspTwww49OUfgXkQt", "result": true } ``` ## Get Task Detail - Make HTTP Post Request with Task ID ```bash curl -X POST "https://api.wiro.ai/v1/Task/Detail" -H "Content-Type: multipart/form-data" -H "x-api-key: ${YOUR_API_KEY}" -H "x-nonce: ${NONCE}" -H "x-signature: ${SIGNATURE}" -d '{ "taskid": "2221" }'; ``` ## Get Task Detail - Make HTTP Post Request with Socket Access Token ```bash curl -X POST "https://api.wiro.ai/v1/Task/Detail" -H "Content-Type: multipart/form-data" -H "x-api-key: ${YOUR_API_KEY}" -H "x-nonce: ${NONCE}" -H "x-signature: ${SIGNATURE}" -d '{ "tasktoken": "eDcCm5yyUfIvMFspTwww49OUfgXkQt" }'; ``` ## Get Task Detail - Response ```json { "total": "1", "errors": [], "tasklist": [ { "id": "2221", "uuid": "15bce51f-442f-4f44-a71d-13c6374a62bd", "socketaccesstoken": "eDcCm5yyUfIvMFspTwww49OUfgXkQt", "parameters": {}, "debugoutput": "", "debugerror": "", "starttime": "1734513809", "endtime": "1734513813", "elapsedseconds": "6.0000", "status": "task_postprocess_end", "createtime": "1734513807", "canceltime": "0", "assigntime": "1734513807", "accepttime": "1734513807", "preprocessstarttime": "1734513807", "preprocessendtime": "1734513807", "postprocessstarttime": "1734513813", "postprocessendtime": "1734513814", "totalcost": "0.003510000000", "chargedcost": "0.002808000000", "discountamount": "0.000702000000", "outputs": [ { "id": "6bc392c93856dfce3a7d1b4261e15af3", "name": "0.png", "contenttype": "image/png", "parentid": "6c1833f39da71e6175bf292b18779baf", "uuid": "15bce51f-442f-4f44-a71d-13c6374a62bd", "size": "202472", "addedtime": "1734513812", "modifiedtime": "1734513812", "accesskey": "dFKlMApaSgMeHKsJyaDeKrefcHahUK", "url": "https://cdn1.wiro.ai/6a6af820-c5050aee-40bd7b83-a2e186c6-7f61f7da-3894e49c-fc0eeb66-9b500fe2/0.png" } ], "size": "202472" } ], "result": true } ``` totalcost is the list price. chargedcost is the amount actually billed after any discount (a store fee is included on store runs); discountamount is the discount. chargedcost is null until the charge is recorded (shortly after task_postprocess_end) and "0" for a failed or cancelled task. ## Kill Task - Make HTTP Post Request with Task ID ```bash curl -X POST "https://api.wiro.ai/v1/Task/Kill" -H "Content-Type: multipart/form-data" -H "x-api-key: ${YOUR_API_KEY}" -H "x-nonce: ${NONCE}" -H "x-signature: ${SIGNATURE}" -d '{ "taskid": "534574" }'; ``` ## Kill Task - Make HTTP Post Request with Socket Access Token ```bash curl -X POST "https://api.wiro.ai/v1/Task/Kill" -H "Content-Type: multipart/form-data" -H "x-api-key: ${YOUR_API_KEY}" -H "x-nonce: ${NONCE}" -H "x-signature: ${SIGNATURE}" -d '{ "socketaccesstoken": "ZpYote30on42O4jjHXNiKmrWAZqbRE" }'; ``` ## Kill Task - Response ```json { "errors": [], "tasklist": [ { "id": "534574", "uuid": "15bce51f-442f-4f44-a71d-13c6374a62bd", "name": "", "socketaccesstoken": "ZpYote30on42O4jjHXNiKmrWAZqbRE", "parameters": { "inputImage": "https://api.wiro.ai/v1/File/mCmUXgZLG1FNjjjwmbtPFr2LVJA112/inputImage-6060136.png" }, "debugoutput": "", "debugerror": "", "starttime": "1734513809", "endtime": "1734513813", "elapsedseconds": "6.0000", "status": "task_cancel", "cps": "0.000585000000", "totalcost": "0.003510000000", "guestid": null, "projectid": "699", "modelid": "598", "description": "", "basemodelid": "0", "runtype": "model", "modelfolderid": "", "modelfileid": "", "callbackurl": "", "marketplaceid": null, "createtime": "1734513807", "canceltime": "0", "assigntime": "1734513807", "accepttime": "1734513807", "preprocessstarttime": "1734513807", "preprocessendtime": "1734513807", "postprocessstarttime": "1734513813", "postprocessendtime": "1734513814", "pexit": "0", "categories": "["tool","image-to-image","quick-showcase","compare-landscape"]", "outputs": [ { "id": "6bc392c93856dfce3a7d1b4261e15af3", "name": "0.png", "contenttype": "image/png", "parentid": "6c1833f39da71e6175bf292b18779baf", "uuid": "15bce51f-442f-4f44-a71d-13c6374a62bd", "size": "202472", "addedtime": "1734513812", "modifiedtime": "1734513812", "accesskey": "dFKlMApaSgMeHKsJyaDeKrefcHahUK", "foldercount": "0", "filecount": "0", "ispublic": 0, "expiretime": null, "url": "https://cdn1.wiro.ai/6a6af820-c5050aee-40bd7b83-a2e186c6-7f61f7da-3894e49c-fc0eeb66-9b500fe2/0.png" } ], "size": "202472" } ], "result": true } ``` ## Cancel Task - Make HTTP Post Request (For tasks on queue) ```bash curl -X POST "https://api.wiro.ai/v1/Task/Cancel" -H "Content-Type: multipart/form-data" -H "x-api-key: ${YOUR_API_KEY}" -H "x-nonce: ${NONCE}" -H "x-signature: ${SIGNATURE}" -d '{ "taskid": "634574" }'; ``` ## Cancel Task - Response ```json { "errors": [], "tasklist": [ { "id": "634574", "uuid": "15bce51f-442f-4f44-a71d-13c6374a62bd", "name": "", "socketaccesstoken": "ZpYote30on42O4jjHXNiKmrWAZqbRE", "parameters": { "inputImage": "https://api.wiro.ai/v1/File/mCmUXgZLG1FNjjjwmbtPFr2LVJA112/inputImage-6060136.png" }, "debugoutput": "", "debugerror": "", "starttime": "1734513809", "endtime": "1734513813", "elapsedseconds": "6.0000", "status": "task_cancel", "cps": "0.000585000000", "totalcost": "0.003510000000", "guestid": null, "projectid": "699", "modelid": "598", "description": "", "basemodelid": "0", "runtype": "model", "modelfolderid": "", "modelfileid": "", "callbackurl": "", "marketplaceid": null, "createtime": "1734513807", "canceltime": "0", "assigntime": "1734513807", "accepttime": "1734513807", "preprocessstarttime": "1734513807", "preprocessendtime": "1734513807", "postprocessstarttime": "1734513813", "postprocessendtime": "1734513814", "pexit": "0", "categories": "["tool","image-to-image","quick-showcase","compare-landscape"]", "outputs": [ { "id": "6bc392c93856dfce3a7d1b4261e15af3", "name": "0.png", "contenttype": "image/png", "parentid": "6c1833f39da71e6175bf292b18779baf", "uuid": "15bce51f-442f-4f44-a71d-13c6374a62bd", "size": "202472", "addedtime": "1734513812", "modifiedtime": "1734513812", "accesskey": "dFKlMApaSgMeHKsJyaDeKrefcHahUK", "foldercount": "0", "filecount": "0", "ispublic": 0, "expiretime": null, "url": "https://cdn1.wiro.ai/6a6af820-c5050aee-40bd7b83-a2e186c6-7f61f7da-3894e49c-fc0eeb66-9b500fe2/0.png" } ], "size": "202472" } ], "result": true } ``` ## Task Status Information This section defines the possible task status values returned by the API when polling for task completion. ### Completed Task Statuses (Polling can stop) These indicate that the task has reached a terminal state — either success or failure. Once any of these is received, polling should stop. - task_postprocess_end : Task completed successfully and post-processing is done. - task_cancel : Task was cancelled by the user or system. ### Running Task Statuses (Continue polling) These statuses indicate that the task is still in progress. Polling should continue if one of these is returned. - task_queue : Task is waiting in the queue. - task_accept : Task has been accepted for processing. - task_assign : Task is being assigned to a worker. - task_preprocess_start : Preprocessing is starting. - task_preprocess_end : Preprocessing is complete. - task_start : Task execution has started. - task_output : Output is being generated.