API 文档
交互式测试快速开始
Vowise API 提供简单易用的语音转文字服务。只需一个 API 密钥即可开始。
认证
所有 API 请求都需要在 Header 中包含您的 API 密钥:
Authorization: Bearer YOUR_API_KEY
注意:为了向后兼容,转录API也支持 X-API-Key 头部
语音转文字端点
POST
https://api.vowise.com/transcribe
请求参数
audio
必需音频文件 (支持格式: WAV, MP3, M4A, WebM, MP4, MPGA, MPEG, OGG)
prompt
可选自定义提示词,用于优化转录结果。如未提供,将自动使用您在后台设置的默认提示词
dict
可选自定义词典,JSON 数组格式。如未提供,将自动从您的后台词典加载。格式: [{"misspelling": "错误词", "correct_spelling": "正确词"}]
请求示例
使用 cURL:
curl -X POST https://api.vowise.com/transcribe \
-H "Authorization: Bearer YOUR_API_KEY" \
-F "audio=@/path/to/audio.wav" \
-F "prompt=Interview about AI technology" \
-F 'dict=[{"misspelling":"AI","correct_spelling":"Artificial Intelligence"}]'
使用 Python:
import requests
import json
url = "https://api.vowise.com/transcribe"
headers = {"Authorization": "Bearer YOUR_API_KEY"}
with open("audio.wav", "rb") as audio_file:
files = {"audio": audio_file}
data = {
"prompt": "Interview about AI technology",
"dict": json.dumps([
{"misspelling": "AI", "correct_spelling": "Artificial Intelligence"}
])
}
response = requests.post(url, headers=headers, files=files, data=data)
print(response.json())
使用 JavaScript:
const formData = new FormData();
formData.append('audio', audioFile);
formData.append('prompt', 'Interview about AI technology');
formData.append('dict', JSON.stringify([
{misspelling: 'AI', correct_spelling: 'Artificial Intelligence'}
]));
const response = await fetch('https://api.vowise.com/transcribe', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY'
},
body: formData
});
const result = await response.json();
console.log(result);
响应格式
成功响应 (200 OK):
{
"success": true,
"transcription": "Your transcribed text will appear here...",
"duration": 45.5,
"credits_used": 1,
"remaining_credits": 99
}
错误响应:
{
"success": false,
"error": "Invalid API key",
"code": "INVALID_API_KEY"
}
词典管理端点
使用词典API管理您的专有名词和术语,提高特定领域的转录准确度。
获取用户词典
GET
https://api.vowise.com/api/v1/dictionary
请求头
Authorization: Bearer YOUR_API_KEY
响应示例
{
"success": true,
"dictionary": [
{
"misspelling": "Claude Code",
"correct_spelling": "Claude Code",
"is_replacement": true
},
{
"misspelling": "Vowise",
"correct_spelling": "Vowise",
"is_replacement": false
}
],
"count": 2,
"dict_string": "Claude Code → Claude Code; Vowise → Vowise",
"prompt_preview": "请注意以下词汇的正确识别:'Claude Code' 应为 'Claude Code'...",
"user_id": "user-uuid-here"
}
添加或更新词典条目
POST
https://api.vowise.com/api/v1/dictionary/add
请求体参数
misspelling
必需需要被替换或提示的词汇
correct_spelling
必需正确的拼写或替换词
is_replacement
可选是否为替换型(true)或提示型(false),默认为 true
请求示例
curl -X POST https://api.vowise.com/api/v1/dictionary/add \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"misspelling": "AI",
"correct_spelling": "Artificial Intelligence",
"is_replacement": true
}'
Python 示例
import requests
url = "https://api.vowise.com/api/v1/dictionary/add"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
}
data = {
"misspelling": "AI",
"correct_spelling": "Artificial Intelligence",
"is_replacement": True
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
删除词典条目
DELETE
https://api.vowise.com/api/v1/dictionary/delete
请求参数
misspelling
必需要删除的词典条目
请求示例
curl -X DELETE "https://api.vowise.com/api/v1/dictionary/delete?misspelling=AI" \
-H "Authorization: Bearer YOUR_API_KEY"
词典使用说明
替换型词典:
转录结果中的词汇会被直接替换。适用于缩写、专有名词等。
例如: "AI" → "Artificial Intelligence"
提示型词典:
为语音识别模型提供上下文提示,提高识别准确度。
例如: "Claude Code" 作为专有名词提示
最佳实践:
- 为常用的专业术语添加词典条目
- 使用替换型词典统一缩写的展开形式
- 使用提示型词典保留原始发音但提高识别准确度
- 定期更新词典以包含新的术语
错误代码
代码 | 描述 |
---|---|
INVALID_API_KEY | API 密钥无效或未提供 |
INSUFFICIENT_CREDITS | 积分不足 |
INVALID_AUDIO_FORMAT | 不支持的音频格式 |
FILE_TOO_LARGE | 文件过大(最大 25MB) |
RATE_LIMIT_EXCEEDED | 请求频率超限 |
使用限制
- 最大文件大小: 25MB
- 最大音频时长: 30分钟
- 请求频率限制: 60次/分钟
- 支持的语言: 英语、中文、西班牙语、法语、德语、意大利语、葡萄牙语、荷兰语等
iOS 快捷指令集成
您可以通过 iOS 快捷指令直接使用 Vowise API。下载我们预配置的快捷指令,添加您的 API 密钥即可使用。
需要帮助?
如果您有任何问题或需要帮助,请联系我们的支持团队:
[email protected]