fmode-listen
v0.1.1
Published
Claude Code skill: 录音文件转写(讯飞 LFASR)通过 Fmode 网关 /api/listen/transcribe 完成。讯飞凭据仅服务端持有,客户端只需 fmode token,服务端按音频时长计费。提供 `npx fmode-listen transcribe` 直连命令 + Claude Code 技能安装器。
Readme
fmode-listen
Claude Code skill + CLI that transcribes audio files via the Fmode gateway
(POST /api/listen/transcribe, backed by iFlytek LFASR). iFlytek credentials
live only on the server — the client just needs an fmode token, and the
server bills by actual audio duration.
Transcribe directly
# transcribe an audio file (auto-probes duration for the pre-check)
npx fmode-listen@latest transcribe -- meeting.mp3
# language + speaker diarization + dump full JSON
npx fmode-listen@latest transcribe -- meeting.mp3 \
--language autodialect --diarize --speakers 3 --out result.json
# custom gateway (default https://server.fmode.cn/api/listen)
npx fmode-listen@latest transcribe -- meeting.mp3 --gateway https://server.fmode.cn/api/listentranscribe prints the plain transcript to stdout. Everything after -- is
passed through to the runner.
Auth (fmode token only)
The runner resolves the token in this order:
FMODE_API_TOKENenvironment variable~/.fmode/config.json→fmodeApiToken/newapiToken(written by FmodeStudio)./.fmode/config.json→fmodeApiToken/newapiToken~/.claude/settings.json(plussettings.local.json/ project.claude/) →env.ANTHROPIC_AUTH_TOKEN— this is Claude Code'ssk-token; the runner reads it automatically, no manual config needed. Only accepted when it starts withsk-(real Anthropicsk-ant-is excluded) and the base points to fmode.
A "token not found" error means the token is missing, not that the service is unavailable — do not click any payment/top-up popup; just supply the token via any source above.
Never put iFlytek appId/apiKey/secretKey on the client — they belong to the
server only.
Install the Claude Code skill
# project-level → ./.claude/skills/fmode-listen
npx fmode-listen@latest workspace
# user-level → ~/.claude/skills/fmode-listen
npx fmode-listen@latest installThen prompt Claude Code, e.g. 把 meeting.mp3 转写成文字,开启说话人分离。
Billing
- Billed by actual audio duration:
ceil(minutes) × unit price, minimum 1 minute. - The server charges after transcription succeeds (real duration from iFlytek),
through the same newapi metering as other Fmode models. The client-supplied
durationis only used for the pre-flight balance check. - Insufficient balance returns HTTP 402 with a
rechargeUrl.
Commands
| Command | Description |
|---------|-------------|
| transcribe -- <file> [opts] / run -- ... | transcribe an audio file via the gateway |
| workspace / install | install the Claude Code skill |
| check / smoke / path | verify install / run smoke test / print target |
Programmatic use
import { transcribeFile, probeDurationMs, resolveApiToken }
from './skills/fmode-listen/scripts/listen-runner.mjs';
const { text, segments, raw } = await transcribeFile({
filePath: 'meeting.mp3',
language: 'autodialect',
diarize: true,
speakers: 3,
});License
MIT
