360 Secure SkillHub
360 安全技能中心

openai-whisper-api

通过 shell 脚本调用 OpenAI 音频转写接口,把本地音频文件转写为文本,默认写入同名 .txt;支持选择 gpt-4o-transcribe 系列或 whisper-1、指定语言与提示词、输出 JSON,说话人分离模型会自动分块并拒绝提示词,直连服务有 25 MB 上传上限。

azizbrownint
azizbrownint
热度 26.90
最近更新 2026-09-16 05:21:01
分类:效率依赖:代码执行 / 读写文件 / 第三方 API应用场景:文件转换 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add azizbrownint/openai-whisper-api
Metadata
name
openai-whisper-api
description
OpenAI Audio Transcriptions API via curl; gpt-4o-transcribe, mini, diarize, or whisper-1.
homepage
https://platform.openai.com/docs/guides/speech-to-text
metadata
{"openclaw":{"emoji":"🌐","requires":{"bins":["curl","node"],"env":["OPENAI_API_KEY"]},"primaryEnv":"OPENAI_API_KEY","install":[{"id":"brew","kind":"brew","formula":"curl","bins":["curl"],"label":"Install curl (brew)"}]}}

OpenAI transcriptions API

Transcribe audio through /v1/audio/transcriptions. Set OPENAI_BASE_URL for an OpenAI-compatible proxy or local gateway.

Quick start

{baseDir}/scripts/transcribe.sh /path/to/audio.m4a

Defaults:

  • Model: gpt-4o-transcribe
  • Output: <input>.txt

Useful flags

{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-mini-transcribe
{baseDir}/scripts/transcribe.sh /path/to/audio.ogg --model gpt-4o-transcribe-diarize --json
{baseDir}/scripts/transcribe.sh /path/to/audio.ogg --model whisper-1
{baseDir}/scripts/transcribe.sh /path/to/audio.m4a --language en
{baseDir}/scripts/transcribe.sh /path/to/audio.m4a --prompt "Speaker names: Peter, Daniel"
{baseDir}/scripts/transcribe.sh /path/to/audio.m4a --json --out /tmp/transcript.json

Notes:

  • Supported upload formats include mp3, mp4, mpeg, mpga, m4a, wav, webm.
  • 25 MB upload limit on the hosted API.
  • Use diarize for speaker labels; script sends chunking_strategy=auto and rejects --prompt.

API key

Set OPENAI_API_KEY, or configure it in the active OpenClaw config file ($OPENCLAW_CONFIG_PATH, default ~/.openclaw/openclaw.json). Optionally set OPENAI_BASE_URL:

{
  skills: {
    "openai-whisper-api": {
      apiKey: "OPENAI_KEY_HERE",
    },
  },
}