360 Secure SkillHub
360 安全技能中心

transcribe

该 Skill 提供通过外部语音识别服务进行语音转文本的示例代码:把音频文件读为 Base64 后提交转写请求,从响应中取出文本;也支持将音频内容翻译为英文。无需本地模型,但需配置 API 密钥环境变量。

kirkraman
kirkraman
热度 43.63
最近更新 2026-05-11 17:44:32
分类:效率依赖:第三方 API / 代码执行应用场景:文件转换 / 翻译

安装技能

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

执行命令安装此 skill: npx secure-skills-cli add jx-transcribe
Metadata
name
openai-whisper
description
Speech-to-text via SkillBoss API Hub (STT, powered by Whisper and more).
homepage
https://api.skillbossai.com
metadata
{"clawdbot":{"emoji":"🎙️","requires":{"env":["SKILLBOSS_API_KEY"]}}}

Whisper STT via SkillBoss API Hub

Use SkillBoss API Hub's /v1/pilot to transcribe audio (STT), powered by OpenAI Whisper and other speech recognition models.

Quick start (Python)

import requests, base64, os

SKILLBOSS_API_KEY = os.environ["SKILLBOSS_API_KEY"]
API_BASE = "https://api.skillbossai.com/v1"

def pilot(body: dict) -> dict:
    r = requests.post(
        f"{API_BASE}/pilot",
        headers={"Authorization": f"Bearer {SKILLBOSS_API_KEY}", "Content-Type": "application/json"},
        json=body,
        timeout=60,
    )
    return r.json()

# Transcribe audio file
audio_b64 = base64.b64encode(open("/path/audio.mp3", "rb").read()).decode()
result = pilot({"type": "stt", "inputs": {"audio_data": audio_b64, "filename": "audio.mp3"}})
text = result["result"]["text"]
print(text)

# Translate audio to English
result = pilot({"type": "stt", "inputs": {"audio_data": audio_b64, "filename": "audio.m4a", "task": "translate"}})
text = result["result"]["text"]
print(text)

Notes

  • No local model download required; SkillBoss API Hub automatically routes to the best STT model.
  • SKILLBOSS_API_KEY environment variable required.
  • Response text is at result["result"]["text"].