SuperAPI AI 工具集

openai-whisper-api

编程与开发

查看项目

更新于 10-16 09:48

技能介绍

用途:调用 OpenAI 的 /v1/audio/transcriptions 接口,把音频文件转写为文本,适合已有音频需要生成文字记录的场景。

主要能力:默认使用 gpt-4o-transcribe 模型,输出为与输入同名的 .txt 文件。可通过 --model 切换 gpt-4o-mini-transcribe、gpt-4o-transcribe-diarize(带说话人分离)或 whisper-1;--language 指定语言,--prompt 提供提示(如说话人姓名),--json 输出 JSON,--out 指定输出路径。

使用方式:{baseDir}/scripts/transcribe.sh /path/to/audio.m4a 为基本调用;例如 {baseDir}/scripts/transcribe.sh /path/to/audio.ogg --model gpt-4o-transcribe --out /tmp/transcript.txt、{baseDir}/scripts/transcribe.sh /path/to/audio.ogg --model gpt-4o-transcribe-diarize --json,或 {baseDir}/scripts/transcribe.sh /path/to/audio.m4a --language en。

配置:设置 OPENAI_API_KEY,或在 OpenClaw 配置文件中配置 apiKey;可选设置 OPENAI_BASE_URL 以指向兼容代理或本地网关。

限制:托管 API 上传上限为 25 MB;支持的格式包括 mp3、mp4、mpeg、mpga、m4a、wav、webm。使用 diarize 时会发送 chunking_strategy=auto 并拒绝 --prompt。其余细节暂未提供。