API规划
- 作者仓库星标 1,187
- 叉子 185
- 作者更新于 2026年6月14日 10:01
- 作者仓库 claude-code-skills
- 领域
- 通用
- 兼容 Agent
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- 信任分
- 88 / 100 · 社区维护
- 作者 / 版本 / 许可
- @daymade · 未声明 license
- Token 消耗评级
- 低消耗
- 接入复杂程度
- 需简单配置
- 是否需要外部 API Key
- 需要 · Vendor-specific
- 兼容的系统
- 未声明(默认跨平台)
- 底层运行要求
- Python
- 文件与系统权限
-
- 只读
- 允许写入 / 修改
- 读取环境变量
- 网络行为
- 允许外网请求
- 安装命令数
- 26 条
档案由构建时根据 SKILL.md 与安装命令自动衍生,可能与作者实际意图存在差异。
需要注意: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: stepfun-asr
description: Transcribe audio with StepFun's stepaudio-2.5-asr — an SSE endpoint (NOT /v1/audio/transcription…
category: 通用
runtime: Python
---
# stepfun-asr 输出预览
## PART A: 任务判断
- 适用问题:通用任务拆解、检查和交付。
- 输入要求:目标材料、限制条件、期望输出和验收方式。
- 证据边界:围绕“Why this skill exists — three traps that cost hours / Config and auth / Quick start — single file”读取原文规则,不把推断写成作者承诺。
## PART B: 执行结果
- **01** 任务判断:确认你的需求是否属于通用任务拆解、检查和交付,并标出输入、限制和预期结果。
- **02** 执行计划:优先按“Why this skill exists — three traps that cost hours / Config and auth / Quick start — single file”拆成步骤,说明每一步会读取什么、修改什么、产出什么。
- **03** 交付结果:给出可复制的命令、文件改动、检查清单或内容草稿,并说明如何继续迭代。
- **04** 风险边界:结合 读取文件、写入/修改文件、读取环境变量、会按任务需要访问外部网络、需要准备 Vendor-specific API Key 给出执行前确认项。
## Running Rules
- 读取文件、写入/修改文件、读取环境变量;会按任务需要访问外部网络;需要准备 Vendor-specific API Key。
- 先小样例验证,再放大到真实任务。
- 交付时同时给结果、检查口径和下一步迭代建议。 原文出现了 `/v1`、`/path` 这类斜杠命令;如果你的 Agent 支持命令触发,优先用命令开场,再补充目标和边界。
告诉 Agent 目标文件或材料、期望结果、不可改范围、是否允许联网或执行命令。本 Skill 的权限画像是:读取文件、写入/修改文件、读取环境变量。
先用一个小任务确认它会围绕“Why this skill exists — three traps that cost hours / Config and auth / Quick start — single file”工作;涉及文件或命令时,先看 diff、日志、预览或测试结果。
检查最终产物是否包含明确结果、必要证据和下一步动作;如果输出泛泛而谈,就补充输入、边界和验收标准后重跑。
---
name: stepfun-asr
description: Transcribe audio with StepFun's stepaudio-2.5-asr — an SSE endpoint (NOT /v1/audio/transcription…
category: 通用
source: daymade/claude-code-skills
---
# stepfun-asr
## 什么时候使用
- stepfun-asr 是一个通用扩展技能,按 SKILL 适合处理通用任务拆解、检查、交付和复盘,核心价值是把输入、判断、执行、验证和交付边界固定下来,避免 Agent 泛泛回答。 把任务拆成可执行、可检查、可继续迭代的步骤;使用前要…
- 面向通用任务拆解、检查和交付,优先处理能明确输入、步骤和验收标准的工作。
## 需要提供什么
- 目标材料、目录范围、期望结果和不可改动内容。
- 是否允许联网、执行命令、读写文件或调用外部服务。
## 执行规则
- 围绕「Why this skill exists — three traps that cost hours / Config and auth / Quick start — single file」组织步骤,不把推断写成作者事实。
- 读取文件、写入/修改文件、读取环境变量;会按任务需要访问外部网络;需要准备 Vendor-specific API Key。
- 先跑小样例,确认结果可检查后再扩大任务范围。
## 输出要求
- 给出最终产物、关键证据、验证方式和下一步动作。
- 信息不足时标记 unknown,不编造命令、平台或依赖。 作者原文负责流程事实;仓库文件负责来源和命令;流狐只补充适用场景、限制和质量判断。
skill "stepfun-asr" {
输入层 -> 用户目标 + 目标文件 + 禁止范围 + 验收标准
上下文层 -> Why this skill exists — three traps that cost hours / Config and auth / Quick start — single file
规则层 -> SKILL.md 触发条件 / 执行顺序 / 输出格式
运行层 -> Python | 读取文件、写入/修改文件、读取环境变量 | 会按任务需要访问外部网络
安全层 -> 需要准备 Vendor-specific API Key + 小任务验证 + diff / 日志复核
输出层 -> 可复制结果 + 检查清单 + 下一步迭代
} StepFun stepaudio-2.5-asr
Transcribe audio with StepFun's stepaudio-2.5-asr (released 2026-04, verified 2026-04-23). Long audio in one call, no chunking — but only if the request hits the right endpoint with the right body shape. The wrong endpoint returns an error that looks identical to "model doesn't exist", which is the #1 reason this skill exists.
Companion: for TTS with
stepaudio-2.5-tts(the sibling model), use thestepfun-ttsskill — they share an API key but live on different endpoints with different body shapes.
Why this skill exists — three traps that cost hours
Wrong endpoint, wrong error.
stepaudio-2.5-asrdoes not live on/v1/audio/transcriptions(that endpoint serves the olderstep-asrfamily). It lives on/v1/audio/asr/sse— SSE streaming, JSON body, base64 audio. Sending it to the wrong endpoint returns{"error":{"message":"model stepaudio-2.5-asr not supported"}}, which is identical in structure to a genuinely nonexistent model name. People waste hours filing whitelist tickets.Plan key vs Normal key, silent failure. StepFun's "Plan" subscription keys (cheap, text-only) cannot call audio endpoints, but the failure manifests as a 4xx with no auth-shaped error message. If your account has a Plan subscription, you need a separate "Normal" key from the same console.
SSE error events are real. Censorship can fire on the ASR side too (rarely). Don't assume only
transcript.text.deltaandtranscript.text.doneevents arrive — handletype: errorevents in the stream or you'll silently drop them.
Config and auth
API key resolves in this order (fail-fast, no defaults):
$STEPFUN_API_KEYenvironment variable${CLAUDE_PLUGIN_DATA}/config.jsonwith{"api_key": "..."}(cross-session persistence)
First-time setup:
mkdir -p "${CLAUDE_PLUGIN_DATA}" && cat > "${CLAUDE_PLUGIN_DATA}/config.json" <<EOF
{"api_key": "<paste Normal key here>"}
EOF
If the user has not set a key, ask them to paste it — do not guess or use a placeholder. Get keys at https://platform.stepfun.com/ → API Keys. Use a Normal key, not a Plan key.
Quick start — single file
python3 scripts/asr_transcribe.py /path/to/audio.mp3
Output: plain text transcription on stdout.
For machine-readable output with usage / timing:
python3 scripts/asr_transcribe.py /path/to/audio.mp3 --json
For non-Chinese audio:
python3 scripts/asr_transcribe.py /path/to/audio.mp3 --language en
The script handles base64 encoding, the nested {audio: {data, input: {transcription, format}}} body, SSE parsing, and the misleading-endpoint pitfall. Prefer it over hand-rolled HTTP calls unless integrating into a larger pipeline.
Decision table
| Scenario | Action |
|---|---|
| Short clip (< 5 min), Chinese or English, mp3/wav/ogg/opus | python3 scripts/asr_transcribe.py audio.mp3 |
| Long audio (5-30 min) | Same script — 32K context handles it in a single call, no chunking needed |
| Audio > 30 min | Split with ffmpeg before sending; the API rejects oversized payloads |
| Need usage/billing data | Add --json to capture usage.input_tokens / usage.total_tokens from transcript.text.done |
| Highly repetitive content (same phrase 5+ times, > 90s) | Cross-validate with step-asr-1.1 — see repetition hallucination in references/known_issues.md |
Hit model stepaudio-2.5-asr not supported |
Wrong endpoint. Switch from /v1/audio/transcriptions to /v1/audio/asr/sse |
| Hit silent 4xx auth failure | Verify your key is "Normal" not "Plan" — Plan keys cannot call audio endpoints |
| Need to write raw HTTP (no Python) | Read references/api_reference.md for exact JSON body and SSE event shapes |
Supported audio formats
The script auto-detects from extension; pass --format to override:
| Extension | Format flag | Notes |
|---|---|---|
.mp3 |
mp3 |
Most common, default |
.wav |
wav |
Lossless |
.ogg |
ogg |
OGG container |
.opus |
ogg |
Opus codec in OGG container — pass through unchanged |
.pcm |
pcm |
Raw PCM — also requires format.rate, format.channel, format.bits (see API reference) |
For mp4/m4a/webm/etc., transcode to one of the above first via ffmpeg. Production pipelines often pre-transcode everything to OGG/Opus 16kHz mono to minimize base64 payload size.
Capacity and performance (verified 2026-04-23)
- 32K context window — single-call upper limit, no chunking needed for ≤ 30 min audio
- ~85-101× RTF on long audio (17.4 min audio → 10.4s wall clock)
- ~5.3× speedup vs step-asr-1.1 at the 100s+ length range
- Only ~2× speedup at the 5-15s range — the LLM spin-up cost dominates short clips. If your workload is many short clips, the migration ROI is modest
Common error patterns
| Error response | Actual cause | Fix |
|---|---|---|
"model stepaudio-2.5-asr not supported" on /v1/audio/transcriptions |
Wrong endpoint | Switch to /v1/audio/asr/sse (script does this) |
| Silent 4xx with no auth message | Using a "Plan" key on audio endpoint | Get a "Normal" key from the StepFun console |
| ASR returns 3-4× expected character count | Repetition hallucination on highly-repetitive audio | Cross-validate with step-asr-1.1; see references/known_issues.md |
data: {"type":"error","message":"content blocked..."} mid-stream |
Censorship fired on user-uploaded content | Handle SSE error event explicitly; don't assume only delta/done arrive |
More edge cases in references/known_issues.md.
Design invariants (do not break)
- Always pass through SSE — don't try to buffer the response with a non-streaming client. The model emits
transcript.text.deltafor long audio;transcript.text.donecarries the authoritative full text andusage. Reject the SSE format entirely and you'll get nothing. - Take final text from
transcript.text.done.text— concatenated deltas can drift on edge cases. Deltas are for progressive UI; thedoneevent is the source of truth. - Handle
errorevents in the stream — don't treat the SSE stream as if only success events arrive. A blocked-content event mid-stream returnstype: errorwith nodoneevent. - Fail-fast on missing API key — never default to a placeholder or empty string. The script does this; preserve the behavior in any wrapper.
When to read references
references/api_reference.md— exact JSON request body, all fields, all SSE event types, response examples. Read when writing raw HTTP calls instead of using the bundled script.references/known_issues.md— repetition hallucination details, the wrong-endpoint diagnostic trail, Plan-vs-Normal key gotcha, ASR-side censorship handling, pricing opacity. Read when debugging anomalous output or evaluating whether to migrate fromstep-asr-1.1.
Pricing (verified 2026-04-23, volatile)
stepaudio-2.5-asr is in invitation beta as of 2026-04-23 — no public per-minute rate. The step-asr-1.1 baseline is 2.2 元/小时. The invitation PDF mentions "成本直降 80%" implying ~0.4 元/小时, but this is not yet on the pricing page. Re-verify at https://platform.stepfun.com/docs/zh/guides/pricing/details before quoting to stakeholders.
Next Step
ASR transcripts almost always benefit from one of two downstream steps. After producing the transcript, suggest the natural next skill:
Transcription complete. The output is raw text from the model — common next steps:
Options:
A) transcript-fixer — clean up ASR errors (homophones, segmentation, filler words). Recommended if the recording is a real-world conversation, podcast, or interview rather than read-aloud text
B) meeting-minutes-taker — turn the transcript into structured minutes with decisions, action items, and speaker attribution. Recommended if the recording is a meeting
C) No thanks — the raw transcript is what I needed
Skip the suggestion when the user has already specified the downstream tool, or when the transcription was clearly a one-off lookup (e.g., "what does this 15-second clip say?").
先判断是否适合
作者设计意图
作者的方法与取舍
边界和复核