任务队列
Base URL:http://<host>:8080
鉴权(除 /healthz 外):X-Api-Key · Authorization: Bearer <pw> · ?token=<pw>
支持格式:.wav .mp3 .flac .ogg .m4a .aac .opus .aiff 及视频 .mp4 .mkv .mov .avi .ts …(自动提取音轨)
| 方法 | 路径 | 说明 |
|---|---|---|
| POST | /api/tasks | 上传音频/视频(multipart: file)→ 202 + 任务 |
| GET | /api/tasks | 任务列表(新→旧) |
| GET | /api/tasks/{id} | 任务详情(完成时含 result) |
| DELETE | /api/tasks/{id} | 删除任务及其音频 → 204 |
| POST | /api/tasks/{id}/retry | 失败/跳过后重新排队 → 202 |
| POST | /api/tasks/{id}/skip | 放弃失败任务,队列继续 → 202 |
| GET | /api/tasks/{id}/transcript | 仅转写结果(完成后) |
| 方法 | 路径 | 说明 |
|---|---|---|
| POST | /v1/audio/transcriptions | 同步转写,返回结果(无需轮询)。字段:file(必填)、response_format=json(默认)|text|verbose_json|srt|vtt、model/language(兼容接受,识别自动检测语种) |
# 默认 json:{"text":"..."} curl -H "Authorization: Bearer $PW" -F "[email protected]" \ http://localhost:8080/v1/audio/transcriptions # 字幕 curl -H "Authorization: Bearer $PW" -F "[email protected]" -F "response_format=srt" \ http://localhost:8080/v1/audio/transcriptions
# 上传任务(异步) curl -H "X-Api-Key: $PW" -F "[email protected]" http://localhost:8080/api/tasks # 轮询 + 取结果 curl -H "X-Api-Key: $PW" http://localhost:8080/api/tasks/<id> curl -H "X-Api-Key: $PW" http://localhost:8080/api/tasks/<id>/transcript # 健康检查(免鉴权) curl http://localhost:8080/healthz
请输入 ASR_PASSWORD 设置的访问密码。验证后本次会话不再提示。