cURL
curl --request POST \ --url https://api.qhaigc.net/v1/audio/transcriptions \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: multipart/form-data' \ --form 'model=<string>' \ --form file='@example-file' \ --form 'response_format=<string>'
{ "text": "<string>" }
将语音文件识别并转换为文本内容
model
string
qhai-asr-lite
file
response_format
json
import openai client = openai.OpenAI( api_key="sk-your-api-key-here", base_url="https://api.qhaigc.net/v1" ) audio_file = open("path/to/file.mp3", "rb") transcription = client.audio.transcriptions.create( model="qhai-asr-lite", file=audio_file ) print(transcription.text)
{ "text": "你好,这是启航 AI 的语音识别服务测试。" }
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Bearer <token>
<token>
成功响应