模型能力
语音模型
FocusAPI 语音模型接入指南:语音转文字 STT、文字转语音 TTS、音频上传、OpenAI Audio 兼容路径、文件大小、格式和超时说明。
语音能力主要分为两类:语音转文字(STT) 和 文字转语音(TTS)。常见模型可以使用 OpenAI Audio 兼容路径,也可能有厂商原生参数。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
FocusAPI 语音模型接入指南:语音转文字 STT、文字转语音 TTS、音频上传、OpenAI Audio 兼容路径、文件大小、格式和超时说明。
POST /v1/audio/transcriptions
curl https://www.focusapi.cn/v1/audio/transcriptions \
-H "Authorization: Bearer sk-your-api-key" \
-F file="@/path/to/audio.mp3" \
-F model="whisper-1"
POST /v1/audio/speech
curl https://www.focusapi.cn/v1/audio/speech \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "tts-1",
"input": "你好,欢迎使用 FocusAPI",
"voice": "alloy"
}' \
--output speech.mp3
| 能力 | 参数 | 说明 |
|---|---|---|
| STT | file | 上传音频文件,通常使用 multipart/form-data |
| STT | model | 语音识别模型 ID |
| STT | language | 可选,指定音频语言 |
| TTS | input | 要朗读的文本 |
| TTS | voice | 音色,取决于模型支持 |
| TTS | response_format | 输出格式,如 mp3、wav 等 |
