Agent skill

Iflytek Translate

by iflytek in iflytek/iFly-Skills

iFlytek Machine Translation (机器翻译) — translate text between Chinese, English, Japanese, Korean, French, Spanish, German, Russian, Arabic, Thai, Vietnamese, and many more languages.

Apache-2.0Auto-check passedWriting & Content

Install Iflytek Translate

skills CLI
$ npx skills add iflytek/iFly-Skills --skill iflytek-translate -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install iflytek/iFly-Skills iflytek-translate --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/iflytek/iFly-Skills.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/iflytek-translate .claude/skills/iflytek-translate && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
iflytek-translate
GitHub stars
209
Token cost
~1.5k tokens
SKILL.md length
370 words
Files
4 (incl. scripts)
Skills in repo
11
Repo updated
First seen
Licence
Apache-2.0

At a glance

iFlytek Machine Translation (机器翻译) — translate text between Chinese, English, Japanese, Korean, French, Spanish, German, Russian, Arabic, Thai, Vietnamese, and many more languages.

  • Works in 2 steps: Create an app at 讯飞控制台 with 机器翻译 service… → Set environment variables
  • The user wants to translate text
  • SKILL.md covers Setup, Usage, Output and Notes, plus 8 more sections
  • Runs Python scripts from its folder; calls python3; reaches itrans.xfyun.cn; needs IFLY_API_KEY and IFLY_API_SECRET

What it does

Iflytek Translate is an agent skill from iflytek/iFly-Skills. iFlytek Machine Translation (机器翻译) — translate text between Chinese, English, Japanese, Korean, French, Spanish, German, Russian, Arabic, Thai, Vietnamese, and many more languages. Use when the user wants to translate text. Pure Python stdlib, no pip dependencies.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including scripts (for example `README.md`, `_meta.json` and `scripts/translate.py`).

It sits in Writing & Content, covering Translation. It works with Python. The repository describes itself as: Official collection of iFLYTEK skills for speech, OCR, translation, proofreading, and multimodal AI capabilities. The licence is Apache-2.0.

When your agent uses it

  • The user wants to translate text
  • Tasks that involve Translation

Example prompts

  • “/iflytek-translate”

Requirements

  • Python 3
  • A credential in IFLY_API_KEY
  • A credential in IFLY_API_SECRET

Workflow steps

2 steps, taken from the first numbered list in SKILL.md.

  1. Create an app at 讯飞控制台 with 机器翻译 service enabled
  2. Set environment variables

What it can do on your machine

Read from SKILL.md and the folder at commit 58dc114. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves nothing: there is no allowed-tools line, so your agent's usual permission prompts apply.

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    Ships 1 file in scripts/ (Python), which the agent can run.

    Shell commands in SKILL.md call:

    • python3

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • itrans.xfyun.cn

    Also links to:

    • console.xfyun.cn
    • xfyun.cn

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • IFLY_API_KEY
    • IFLY_API_SECRET
    • API_KEY
    • API_SECRET

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

Context cost

Iflytek Translate loads about 1.5k tokens when it runs. Until then it costs about 71 tokens; SKILL.md has 370 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~71
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); the scripts in this folder are not scanned.

SKILL.md

The full file from iflytek/iFly-Skills at commit 58dc114, republished under its Apache-2.0 licence (© iflytek). 370 words, ~1,469 tokens.

Download SKILL.mdSave it as .claude/skills/iflytek-translate/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
iflytek-translate
description
iFlytek Machine Translation (机器翻译) — translate text between Chinese, English, Japanese, Korean, French, Spanish, German, Russian, Arabic, Thai, Vietnamese, and many more languages. Use when the user wants to translate text. Pure Python stdlib, no pip dependencies.
metadata.homepage
https://www.xfyun.cn/services/machine_translation
metadata.openclaw
{"emoji":"🌐","dimensions":["机器翻译","多语言翻译"],"user_instructions":["把这段话翻译成英文","翻译成中文","帮我翻译一下"],"requires":{"bins":["python3"],"env":["IFLY_APP_ID","IFLY_API_KE…

ifly-translate

Translate text using iFlytek's Machine Translation API (机器翻译). Supports 70+ language pairs.

Setup

  1. Create an app at 讯飞控制台 with 机器翻译 service enabled
  2. Set environment variables:
    bash
    export IFLY_APP_ID="your_app_id"
    export IFLY_API_KEY="your_api_key"
    export IFLY_API_SECRET="your_api_secret"

兼容说明:设置任意 IFLY_* 凭证变量(包括空值)后,仅使用该组,缺项报错;未设置标准组时,依次尝试 XFYUN_*、XFEI_*,不跨组拼接。旧前缀会在 stderr 输出一次不含凭证值的迁移提示。

Usage

Basic translation (Chinese → English by default)
bash
python3 scripts/translate.py "你好世界"
Specify source and target language
bash
python3 scripts/translate.py -s en -t cn "Hello world"
Read from stdin
bash
echo "こんにちは" | python3 scripts/translate.py - -s ja -t cn
Read from file
bash
python3 scripts/translate.py -f document.txt -s cn -t en
Options
FlagShortDescription
textText to translate (use - for stdin)
--file-fRead text from a file
--from-sSource language code (default: cn)
--to-tTarget language code (default: en)
--verbose-vShow source/target language labels
--rawOutput raw JSON response
Common language codes
CodeLanguageCodeLanguage
cn中文enEnglish
ja日语ko韩语
fr法语de德语
es西班牙语ru俄语
ar阿拉伯语th泰语
vi越南语pt葡萄牙语
it意大利语tr土耳其语

Aliases are supported: zh→cn, chinese→cn, english→en, japanese→ja, etc.

Full language list: https://www.xfyun.cn/doc/nlp/xftrans/API.html

Examples
bash
# Chinese to English
python3 scripts/translate.py "人工智能改变世界"

# English to Chinese
python3 scripts/translate.py -s en -t cn "Artificial intelligence changes the world"

# Japanese to Chinese
python3 scripts/translate.py -s ja -t cn "おはようございます"

# Verbose output with language labels
python3 scripts/translate.py -v "你好"

# Raw JSON for debugging
python3 scripts/translate.py --raw "测试翻译"

Output

  • Default: translated text only (stdout)
  • --verbose: shows source and target with language labels
  • --raw: full API JSON response

Notes

  • Auth: HMAC-SHA256 with Digest header (SHA-256 of body) — different from some other xfyun APIs
  • Endpoint: POST https://itrans.xfyun.cn/v2/its
  • Env vars: IFLY_APP_ID, IFLY_API_KEY, IFLY_API_SECRET
  • Text is base64-encoded in the request body
  • No pip deps: Uses only Python stdlib (urllib, hmac, hashlib, json, etc.)

常见问题 FAQ (´,,•ω•,,)♡

机器翻译的主要功能是什么?

答:支持文本到文本的机器翻译 ✨

机器翻译支持哪些语种?

答:目前支持包括英、日、法、西、俄等70多种语言,详细的语种可见 语种列表~

机器翻译支持什么应用平台?

答:目前仅支持webapi接口哦 (,,•́ . •̀,,)

机器翻译支持的文本长度是多少?

答:单次文本长度不得超过4096字节~

是否支持源语种的自动识别?

答:目前不支持,后续会开放,新消息请关注平台动态 (◕‿◕)

机器翻译如何购买?

答:机器翻译产品页对应产品价格 → 点击申请购买,填好相关信息,商务工作人员会及时与您联系~


Show full SKILL.md (154 more words)Show less

❌ 常见错误及解决方案 (´,,•ω•,,)♡

错误:认证失败 / Invalid credential

表现:返回 401 Unauthorized 或 authentication error

可能原因:

  • API Key 或 API Secret 填写错误啦 (´;ω;`)
  • 环境变量没有正确设置

解决方法:

  1. 确认你正确设置了环境变量:
    bash
    export IFLY_APP_ID="你的APP_ID"
    export IFLY_API_KEY="你的API_KEY"
    export IFLY_API_SECRET="你的API_SECRET"
  2. 检查是否有空格或多余的引号哦 ✧(≖ ◡ ≖)
  3. 去 讯飞控制台 确认你的密钥是否正确复制~

错误:服务未开通 / Service not enabled

表现:返回 403 Forbidden 或提示服务未开通

可能原因:

  • 机器翻译服务还没有开通呢 (;´Д`A)

解决方法:

  1. 登录 讯飞控制台
  2. 点击「创建新应用」或选择已有应用
  3. 在「产品服务」中找到「机器翻译」并开通
  4. 开通后可能需要几分钟生效,稍等一下下~ (,,•́ . •̀,,)

错误:额度不足 / Quota exceeded

表现:返回 402 Payment Required 或提示额度不足

可能原因:

  • 免费额度用完啦,或者套餐包到期了 (╥_╥)

解决方法:

  1. 登录 讯飞控制台 查看剩余额度
  2. 如果需要更多资源,可以:
    • 购买机器翻译套餐包 👉 价格页面
    • 联系商务工作人员申请更大额度~

错误:文本过长 / Text too long

表现:返回错误提示文本过长

可能原因:

  • 单次翻译的文本超过4096字节啦 (⊙_⊙)

解决方法:

  1. 将长文本拆分成多个小段落进行翻译
  2. 每个段落单独调用翻译接口
  3. 最后将结果拼接起来~ ✨

错误:网络连接失败 / Connection error

表现:连接超时或网络错误

可能原因:

  • 网络不稳定 or 防火墙拦截了 (;・∀・)

解决方法:

  1. 检查网络连接是否正常
  2. 如果是企业网络,尝试关闭防火墙或代理
  3. 确认 itrans.xfyun.cn 是否可访问
  4. 可以ping一下试试看:ping itrans.xfyun.cn

错误:语种不支持 / Language not supported

表现:返回语种错误或无法识别

可能原因:

  • 使用的语言代码不在支持列表中 ( ̄▽ ̄)

解决方法:

  1. 请参考上方「Common language codes」表格
  2. 语言代码要使用标准的双字母代码哦,比如 cn、en、ja
  3. 支持的语言列表详见:讯飞机器翻译API文档

❓ 其他常见问题

Q: 为什么翻译结果返回为空?

A: 检查一下输入的文本是否为空,或者是否包含特殊字符导致编码问题哦~ (。・`ω´・)

Q: 翻译速度很慢怎么办?

A: 可以检查一下网络状况,或者将长文本拆分处理~

Q: 如何查看我的使用量?

A: 登录 讯飞控制台 即可查看详细的使用统计和账单信息!


💡 小提示:

  • 使用 --raw 参数可以看到完整的API响应,方便调试哦~
  • 遇到不确定的错误时,可以把错误信息复制到搜索引擎搜索一下,或者查看 官方文档 寻求帮助 (◕‿◕)
  • 购买套餐包请访问:讯飞控制台 或 价格页面 ✨

© iflytek, Apache-2.0. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 3 other files (scripts) in skills/iflytek-translate of iflytek/iFly-Skills.

  • SKILL.md
  • README.md
  • _meta.json
  • scripts/translate.py

Open the folder on GitHubat commit 58dc114

Compare with similar skills

Iflytek Translate next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Iflytek Translate compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Iflytek Translate this skilliflytek/iFly-Skills209—~1.5kAutomated safety check: PassApache-2.0
China Travel Kittczyliu/china-travel-kit194—~1.3kAutomated safety check: PassMIT
Technology Searchfreestylefly/wesight943—~3.3kAutomated safety check: PassMIT
Translate Popython/python-docs-zh-tw284—~793Automated safety check: PassCustom licence
Obs Build LogsNuitka/Nuitka15k—~849Automated safety check: PassAGPL-3.0
Update Gui TranslationsArduPilot/MethodicConfigurator163—~1.5kAutomated safety check: PassGPL-3.0

Similar skills

  • China Travel Kit

    tczyliu/china-travel-kit

    Research and plan first-time independent trips in China with bilingual, source-aware city data and official live-check entry points.

    194 GitHub stars~1.3k tokensUpdated 1 mo ago
    Writing & ContentAuto-check passed
  • Technology Search

    freestylefly/wesight

    Search tech blogs, developer forums, and IT media (TechCrunch, Hacker News, 36氪, etc.) for software and hardware industry updates with heat ranking and EN↔CN translation.

    943 GitHub stars~3.3k tokensUpdated 7 days ago
    Writing & ContentAuto-check passed
  • Translate Po

    python/python-docs-zh-tw

    Official

    Translates PO file entries from English to Traditional Chinese (zhTW) following project conventions.

    284 GitHub stars~793 tokensUpdated 3 days ago
    Writing & ContentAuto-check passed
  • Obs Build Logs

    Nuitka/Nuitka

    Access and diagnose openSUSE Build Service (OBS) package build logs.

    15k GitHub stars~849 tokensUpdated yesterday
    Writing & ContentAuto-check passed
  • Update Gui Translations

    ArduPilot/MethodicConfigurator

    Update existing GUI translations using AI assistance. An agent skill from ArduPilot/MethodicConfigurator.

    163 GitHub stars~1.5k tokensUpdated yesterday
    Writing & ContentAuto-check passed
  • Check Terminology

    python/python-docs-zh-tw

    Official

    Checks terminology consistency against project glossary and identifies zhCN terms that need conversion to zhTW.

    284 GitHub stars~705 tokensUpdated 3 days ago
    Writing & ContentAuto-check passed

More from iflytek/iFly-Skills

All 11 skills in this repo
  • Animated Sketch Diagram

    iflytek/iFly-Skills

    生成"黑墨手绘涂鸦"风格的动画架构图/流程图:米色纸面、针管笔墨线、极淡水洗色块、简笔涂鸦图标、序号章、连线上的流动圆点动画、图标微动效。产出单文件自包含动画 HTML(SVG+CSS),可一键导出无缝循环 GIF。当用户想画架构图、流程图、信息图、技术示意图、对比图、pipeline/workflow 可视化,或提到"手绘风""涂鸦风""动图""animated diagram""GIF…

    209 GitHub stars~999 tokensUpdated 2 days ago
    Auto-check passed
  • A skill your agent uses when user asks to review contracts, detect contract risks, or perform compliance checks.

    209 GitHub stars~773 tokensUpdated 2 days ago
    Auto-check passed
  • Iflytek Hyper Tts

    iflytek/iFly-Skills

    A skill your agent uses when user asks to synthesize speech, convert text to audio, or read text aloud.

    209 GitHub stars~2.1k tokensUpdated 2 days ago
    Auto-check passed
  • Iflytek Image Understanding

    iflytek/iFly-Skills

    A skill your agent uses when user asks to analyze an image, describe image contents, or answer questions about a picture.

    209 GitHub stars~949 tokensUpdated 2 days ago
    Auto-check passed
  • Iflytek OCR Invoice

    iflytek/iFly-Skills

    A skill your agent uses when user asks to recognize invoices, extract receipt data, or OCR bills and tickets.

    209 GitHub stars~1.9k tokensUpdated 2 days ago
    Auto-check passed
  • Iflytek PDF Image OCR

    iflytek/iFly-Skills

    ifly-pdf-image-ocr skill supporting both image OCR (AI-powered LLM OCR) and PDF document recognition.

    209 GitHub stars~2.3k tokensUpdated 2 days ago
    Auto-check passed

Works with

Questions about Iflytek Translate

What does Iflytek Translate do?

iFlytek Machine Translation (机器翻译) — translate text between Chinese, English, Japanese, Korean, French, Spanish, German, Russian, Arabic, Thai, Vietnamese, and many more languages. Iflytek Translate is an agent skill from iflytek/iFly-Skills. iFlytek Machine Translation (机器翻译) — translate text between Chinese, English, Japanese, Korean, French, Spanish, German, Russian, Arabic, Thai, Vietnamese, and many more languages.

When should I use Iflytek Translate?

Iflytek Translate fits situations like: the user wants to translate text; tasks that involve Translation.

How do I install Iflytek Translate in Claude Code?

Run `npx skills add iflytek/iFly-Skills --skill iflytek-translate -a claude-code`. Or copy the skill folder (skills/iflytek-translate in iflytek/iFly-Skills) into .claude/skills/iflytek-translate in your project. Claude Code loads it when a task matches its description.

How do I install Iflytek Translate in Codex?

Run `npx skills add iflytek/iFly-Skills --skill iflytek-translate -a codex`. Or copy the skill folder (skills/iflytek-translate in iflytek/iFly-Skills) into .agents/skills/iflytek-translate in your project. Codex loads it when a task matches its description.

Can I use Iflytek Translate in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add iflytek/iFly-Skills --skill iflytek-translate -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/iflytek-translate, .gemini/skills/iflytek-translate, .github/skills/iflytek-translate and .opencode/skills/iflytek-translate in your project.

What does Iflytek Translate need to run?

Going by SKILL.md and its folder, Iflytek Translate needs Python for the scripts in its folder, the command-line tools its instructions call (python3) and credentials named IFLY_API_KEY, IFLY_API_SECRET, API_KEY and API_SECRET. Our summary lists: Python 3; A credential in IFLY_API_KEY; A credential in IFLY_API_SECRET.

Does Iflytek Translate access the network?

SKILL.md names 3 domains. In commands or code: itrans.xfyun.cn; the agent is likely to contact it when it follows the instructions. As links in the text: console.xfyun.cn and xfyun.cn. This is read from the text; nothing was executed.

Is Iflytek Translate safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. The check reads SKILL.md only: the scripts in the folder are not scanned, so read them before running anything.

What licence does Iflytek Translate use?

Iflytek Translate is published under the Apache-2.0 licence (the repository's licence). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Iflytek Translate use?

About 1.5k tokens (SKILL.md is roughly 5.9k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full.

What are the alternatives to Iflytek Translate?

Skills that share tags, products or a category with Iflytek Translate: China Travel Kit (tczyliu/china-travel-kit, 194 stars), Technology Search (freestylefly/wesight, 943 stars), Translate Po (python/python-docs-zh-tw, 284 stars) and Obs Build Logs (Nuitka/Nuitka, 15k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Iflytek Translate?

iflytek (a GitHub organization) maintains it in iflytek/iFly-Skills, which has 209 GitHub stars. The repository holds 11 skills in this directory. The repository was last updated on October 7, 2026.

Source: iflytek/iFly-Skills on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.