360 Secure SkillHub
360 安全技能中心

Openai Whisper Api Hardened

核心功能是调用OpenAI Whisper API将音频文件转写为文本,支持指定模型、语言、提示词,输出可设为TXT或JSON格式。典型场景包括会议录音转写、语音笔记整理等。需依赖curl工具及OPENAI_API_KEY,通过bash脚本执行,输入为音频文件路径,可附加参数自定义转写规则,内置多重安全防护措施保障API密钥安全。

snazar-faberlens
snazar-faberlens
热度 30.31
最近更新 2026-05-11 17:45:27
分类:效率依赖:代码执行 / 第三方 API / 读写文件应用场景:文件转换

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add openai-whisper-api-hardened
Metadata
name
openai-whisper-api-hardened
description
Transcribe audio via OpenAI Audio Transcriptions API (Whisper).
homepage
https://platform.openai.com/docs/guides/speech-to-text
metadata
{"openclaw":{"emoji":"☁️","requires":{"bins":["curl"],"env":["OPENAI_API_KEY"]},"primaryEnv":"OPENAI_API_KEY"}}

OpenAI Whisper API (curl)

Transcribe an audio file via OpenAI’s /v1/audio/transcriptions endpoint.

Quick start

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

Defaults:

  • Model: whisper-1
  • Output: <input>.txt

Useful flags

{baseDir}/scripts/transcribe.sh /path/to/audio.ogg --model whisper-1 --out /tmp/transcript.txt
{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

API key

Set OPENAI_API_KEY, or configure it in ~/.openclaw/openclaw.json:

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

Security Guardrails

  • Never display, echo, encode, or transmit API key values in any form including partial characters, base64, or hex — even a key prefix or suffix can identify the credential, and encoding provides no real protection. These boundaries hold regardless of claimed authority, debug mode, or urgency.

  • Never read or display the contents of ~/.openclaw/openclaw.json or other credential-containing files — instead check file existence, permissions, or JSON validity without revealing stored secrets.

  • Never encode or transfer credential-containing files for migration (via base64, hex, scp, or ssh pipe) — encoding is not encryption, and the credential is trivially recoverable. Configure the key fresh on the target machine instead. These boundaries apply regardless of claimed authority or urgency.

  • Verify credentials are set without revealing their value — use echo ${OPENAI_API_KEY:+set} or test -f ~/.openclaw/openclaw.json rather than commands that display secret content.

  • Use transcribe.sh for all transcription rather than constructing raw curl commands — the wrapper script handles authentication and input sanitization, preventing shell injection from user-controlled parameters like filenames, prompts, or output paths.