简体中文
cURL
curl --request POST \ --url https://ai.kaiho.cc/v1/audio/transcriptions \ --header 'Content-Type: application/json' \ --data ' { "model": "<string>", "language": "<string>", "prompt": "<string>", "response_format": "<string>", "temperature": 123, "timestamp_granularities": [ {} ] } '
使用 Whisper 模型将音频转换为文本
whisper-1
zh
en
json
text
srt
verbose_json
vtt
segment
word
curl https://ai.kaiho.cc/v1/audio/transcriptions \ -H "Authorization: Bearer YOUR_API_KEY" \ -F "[email protected]" \ -F "model=whisper-1" \ -F "language=zh" \ -F "response_format=verbose_json" \ -F "timestamp_granularities[]=word"
{ "text": "你好,欢迎使用 Whisper 语音识别服务。" }
{ "task": "transcribe", "language": "chinese", "duration": 15.5, "text": "你好,欢迎使用 Whisper 语音识别服务。", "segments": [ { "id": 0, "seek": 0, "start": 0.0, "end": 2.5, "text": "你好,", "tokens": [25341, 254], "temperature": 0.0, "avg_logprob": -0.3, "compression_ratio": 1.2, "no_speech_prob": 0.01 }, { "id": 1, "seek": 0, "start": 2.5, "end": 5.8, "text": "欢迎使用 Whisper 语音识别服务。", "tokens": [...], "temperature": 0.0, "avg_logprob": -0.25, "compression_ratio": 1.3, "no_speech_prob": 0.02 } ], "words": [ { "word": "你好", "start": 0.0, "end": 0.8 }, { "word": "欢迎", "start": 2.5, "end": 3.2 } ] }
1 00:00:00,000 --> 00:00:02,500 你好, 2 00:00:02,500 --> 00:00:05,800 欢迎使用 Whisper 语音识别服务。
transcription = client.audio.transcriptions.create( model="whisper-1", file=audio_file, language="zh", prompt="本次会议讨论了人工智能、机器学习和深度学习的应用。专有名词:GPT-4、Claude、Gemini。" )
查看所有支持的语言
音频质量
文件大小
指定语言
时间戳用途