360 Secure SkillHub
360 安全技能中心

Cloudflare Whisper Worker

该 Skill 说明如何通过已部署的 Cloudflare Worker Whisper 端点把 wav、mp3、m4a、ogg、webm 等音频文件转写为文本,包含 Bearer 令牌鉴权、原始音频字节提交、JSON 响应中提取纯文本以及常见错误处理说明。

lotfinity
lotfinity
热度 70.74
最近更新 2026-05-17 13:27:02
分类:效率依赖:代码执行 / 第三方 API应用场景:文件转换 / 自动化脚本

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add cloudflare-whisper-worker
Metadata
name
cloudflare-whisper-worker
description
Transcribe audio using a deployed Cloudflare Worker Whisper endpoint. Use when converting voice/audio files (wav, mp3, m4a, ogg, webm) to text through the custom /transcribe API, including bearer-token auth, plain-text extraction, and quick CLI transcription workflows.

Cloudflare Whisper Worker

Use this skill to transcribe audio through the deployed Whisper Worker API.

Endpoint

  • Base URL: https://lotfi-whisper-worker.medtouradmin.workers.dev
  • Route: POST /transcribe
  • Auth: Authorization: Bearer <API_TOKEN>
  • Body: raw audio bytes (--data-binary @file)

Required environment variable

Set token once per shell:

export WHISPER_WORKER_TOKEN="<your_token>"

Transcribe a file (JSON response)

curl -sS -X POST "https://lotfi-whisper-worker.medtouradmin.workers.dev/transcribe" \
  -H "content-type: audio/wav" \
  -H "authorization: Bearer $WHISPER_WORKER_TOKEN" \
  --data-binary "@audio.wav"

Transcribe and return only text

curl -sS -X POST "https://lotfi-whisper-worker.medtouradmin.workers.dev/transcribe" \
  -H "content-type: audio/wav" \
  -H "authorization: Bearer $WHISPER_WORKER_TOKEN" \
  --data-binary "@audio.wav" \
| jq -r '.result.text // .text // .result.response // empty'

Content-Type guide

  • WAV: audio/wav
  • MP3: audio/mpeg
  • M4A: audio/mp4
  • OGG/OPUS: audio/ogg
  • WEBM: audio/webm

Common errors

  • 401 Unauthorized: missing/invalid bearer token
  • 400 Empty audio body: file path wrong or empty file
  • 400 Send raw audio...: invalid content-type header
  • 500: worker/runtime/model error; retry and inspect full JSON