Skip to Content
API 文档Audio语音转写

音频转写

音频转文本,支持开发者上传音频文件,获取音频文件对应的文本内容。

请求地址

POST https://api.stepfun.com/v1/audio/transcriptions

请求参数

  • model string required
    需要使用的模型名称,固定为 step-asr

  • response_format string required
    输出的文件格式。 - 支持 jsontextsrtvtt

  • file File required
    音频文件

    • 支持格式: flac, mp3, mp4, mpeg, mpga, m4a, ogg, wav,webm,aac,opus
      - 文件大小限制:小于 100MB
  • hotwords string optional
    热词列表,JSON String 格式,需要为可解析的 JSON List。如 ["1","2","3","4","abc"]

请求响应

根据 response_format,返回对应格式的内容

  • text string
    识别所得文字
{ "text": "测试录制音频" }

示例

curl -L 'https://api.stepfun.com/v1/audio/transcriptions' \ -H "Authorization: Bearer $STEP_API_KEY" \ -F 'model="step-asr"' \ -F 'response_format="json"' \ -F 'file=@"sample.mp3"'
Last updated on